From keithvz at verizon.net Thu Nov 1 08:08:58 2007 From: keithvz at verizon.net (Keith) Date: Thu, 01 Nov 2007 10:08:58 -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: <4729DDFA.7080206@verizon.net> Trent Jarvi wrote: > 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? Well, I honestly don't know how all this fits together. I think it's just a matter of enabling the right flow control option within the standard serial framework to tell the device driver, "HEY START USING DTR/DSR FOR FLOW CONTROL." If what UGeorge said,(about that type of nitty-gritty lead control being done within the device driver), is true, then this confirms my suspicion. I tried narrowing down within the Linux drivers what you are looking for, but I can't entirely tell wth I'm looking at. (virtual com port drivers -- they are included compiled by default with Ubuntu, source included) http://www.ftdichip.com/Drivers/VCP/Linux/ftdi_sio.tar.gz Hahahaa, they make a reference to DTR flow control being supported but say (UGH) in parenthesis. You can also use their direct device driver library on Ubuntu -- libftd2xx.so.0.4.13. No source code. http://www.ftdichip.com/Drivers/D2XX/Linux/libftd2xx0.4.13.tar.gz In that case, you make a call to their FT_SetFlowControl() function. FT_STATUS FT_SetFlowControl (FT_HANDLE ftHandle, USHORT usFlowControl, UCHAR uXon,UCHAR uXoff) Parameters ftHandle Handle of the device. usFlowControl Must be one of FT_FLOW_NONE, FT_FLOW_RTS_CTS, ****FT_FLOW_DTR_DSR**** or FT_FLOW_XON_XOFF. uXon Character used to signal Xon. Only used if flow control is FT_FLOW_XON_XOFF. uXoff Character used to signal Xoff. Only used if flow control is FT_FLOW_XON_XOFF. This is from their programming guide http://www.ftdichip.com/Documents/ProgramGuides/D2XXPG34.pdf I actually want to take this a step further and say that I think the flow control is actually handled right on the device itself in hardware/firmware. It's enabled through the device driver, but I think the maintaining of buffers, asserting/deasserting of leads, etc is handled by the device. For the time being, I've switched to jd2xx, https://jd2xx.dev.java.net/ and http://bleyer.org/jd2xx/ These are Java wrappers for the device driver libraries. It allows almost direct access to the well-documented device drivers from Java. I hope this helps Keith From tjarvi at qbang.org Thu Nov 1 11:09:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:09:51 -0600 (MDT) 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: Hi Martin, What I usually have done is allow changes that do not impact working software including changes to methods not documented in CommAPI (which remain undocumented in rxtx) and fixes to known problems in the documented portions. That way if you use the documented API, the releases should only become better with time. If you use the undocumented portions, the behavior is not as predictable but open for improvement. On Wed, 31 Oct 2007, 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 >> > From tjarvi at qbang.org Thu Nov 1 11:15:52 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:15:52 -0600 (MDT) 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: I too use rxtx in commercial products. The problem I've been trying to address while bringing the server back was how to make it possible for hobby folks to build the same software as companies so we can move rxtx along a little faster. Exposing internal tools is not an option at this time, the public rxtx builds have been done on my home machine which has drives hanging out of it all over the place dying one at a time. This isn't maintainable. I'm currently looking at the possibility of making an S3 image available on Amazon's EC. These are machines you can rent for ~10 cents an hour which is more than enough to build rxtx. The S3 image is not changed when people use it so everyone has the same starting point. With this, we could all build rxtx for ~20 platforms for a small price and eliminate tool issues. On Wed, 31 Oct 2007, Greg Johnson wrote: > 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 tjarvi at qbang.org Thu Nov 1 11:19:55 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:19:55 -0600 (MDT) 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: On Wed, 31 Oct 2007, 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. I was helping Dmitry do the Mac OS X port without access to a machine when we put that in. In the archives there is information (easily found with google on Apple's site) that describes how their API (and others) can determine if a port is used and ignore it. I think these changes are in CVS but need to confirm. The bottom line is that rxtx should not have used lock files on Mac. It was just ignorance of the system on my part. -- Trent Jarvi tjarvi at qbang.org From fabioanjos at gmail.com Thu Nov 1 12:35:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Thu, 1 Nov 2007 15:35:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Hi, I was using SerialEventListener in my project. But, as was said here, id doesnt work very well with virtual serial ports. So, I changed the strategy using the code posted here in this thread: try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > 0) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } The thing is that in my tests I could notice that in.read(buffer) never blocks. Even when there's nothing to read. Instead of blocking when there's nothing to read it returns 0. So, my questions are: 1. Am I doing something wrong? 2. If not, wouldnt this decrease performance? (the thread would be locked in a loop that does nothing.) 3. Is there a better way to do the job? Thanks in advance!! F?bio -------- On 10/31/07, Andre-John Mas wrote: > > > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/0aee59d0/attachment-0002.html From ajmas at sympatico.ca Thu Nov 1 16:07:55 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Nov 2007 18:07:55 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Message-ID: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From sarah_662005 at yahoo.com Thu Nov 1 17:10:05 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Thu, 1 Nov 2007 16:10:05 -0700 (PDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Message-ID: <351433.37166.qm@web55814.mail.re3.yahoo.com> Thank you very much for your help. Now the application works fine. the serialEvent gets triggered. Rxtx is cool! ----- Original Message ---- From: Andre-John Mas To: Sara Hugh ; RXTX Developers and Users Sent: Wednesday, October 31, 2007 9:55:45 AM Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered 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 __________________________________________________ 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/20071101/4a86bea6/attachment-0002.html From tjarvi at qbang.org Thu Nov 1 17:58:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 17:58:02 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx Message-ID: The rxtx.org site is primarily interested in the hobby aspects of rxtx. Obviously, there are some companies following the work too. These interests bring larger workflows and concerns about details hobby folks may not care about. They also bring many more users. I know the company I work for has a quality engineering effort going on which includes rxtx. While the server was down, I was contacted by another company that was missing the binaries for their testing. Several people have mentioned concerns about a stable release for like reasons. Would there be interest on the quality side of the coin to get together? It could be just sharing email's with each other or a seperate list for QE/QA. I can not say for sure, but we may be able to share some of our efforts/results that could help keep rxtx releases stable. -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Fri Nov 2 01:42:55 2007 From: scldad at sdc.com.au (Stephen Davies) Date: Fri, 2 Nov 2007 18:12:55 +1030 Subject: [Rxtx] Multiple modems Message-ID: <200711021812.56047.scldad@sdc.com.au> This may or may not be related to the Multiple Ports thread. I have an application which uses rxtx on Linux (via cron jobs) to connect multiple modems to remote sensing devices. The application works fine most of the time but occasionally fails to connect if two (or more) connection attempts happen at about the same time. When it fails, it looks as if it may get confused as to which port it is talking to. The app has a "base" component that looks for an available port, opens it and then creates an input thread and an output thread for the connection and data transfer. The "base" component uses this code: // loop round all known ports until one is available. Give up after three minutes Counter ptimeout = new Counter(); while(!portFound && ptimeout.elapsed() < 180000) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // special case. ttyS0 is not available to us on this server. if (!portId.isCurrentlyOwned() && !portId.getName().equals("/dev/ttyS0")) { gLog.debug(lognm + ": Found port " + portId.getName()); try { serialPort = (RXTXPort) portId.open("AguaModem", 10000); } catch (Exception e) { gLog.error(lognm + ": Port " + portId.getName() + " will not open."); gLog.error(e.getMessage()); continue; } AguaModem aguamodem = new AguaModem(); portFound = true; break; } gLog.debug(lognm + ": Port " + portId.getName() + " is busy"); } } } I am wondering about the isCurrentlyOwned method. Does this actually tell me whether a port is currently being used by another process? TIA, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From fabioanjos at gmail.com Fri Nov 2 04:59:58 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 07:59:58 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Message-ID: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/9009eb1d/attachment-0002.html From netbeans at gatworks.com Fri Nov 2 06:28:13 2007 From: netbeans at gatworks.com (U. George) Date: Fri, 02 Nov 2007 08:28:13 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <472B17DD.1050508@gatworks.com> It should normally block ( unless eof / event ) . so its a :{ whats the device ( to recreate if possible ) and how do u open. > My question is, is there a way to make in.read block the thead until > there's something to read? > From fabioanjos at gmail.com Fri Nov 2 06:34:46 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 09:34:46 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > On 11/1/07, Andre-John Mas wrote: > > > > Fabio, > > > > Turns out there was a small error in my example. The test should be: > > > > (numBytes = in.read(buffer)) > -1 > > > > This is because -1 indicates an end of file (end of data stream) > > > > Andre > > > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > > > Hi, > > > > > > I was using SerialEventListener in my project. But, as was said > > > here, id doesnt work very well with virtual serial ports. > > > So, I changed the strategy using the code posted here in this thread: > > > > > > try{ > > > in = port.getInputStream(); > > > out = port.getOutputStream(); > > > int numBytes = 0; > > > while(active){ > > > > > > byte[] buffer = new byte[10]; > > > > > > while ( (numBytes = in.read(buffer)) > 0) > > > { > > > String dataValue = new String(buffer,0,numBytes); > > > processInput(dataValue); > > > } > > > > > > if(numBytes==-1){ > > > break; > > > } > > > > > > Thread.sleep(50); > > > } > > > > > > }catch(IOException e){ > > > logger.info("falha de comunicacao "+ > > > getReceptor().getPort() ); > > > > > > }catch(InterruptedException e){ > > > logger.info ("Interrompendo leitura da porta "+ > > > getReceptor().getPort() ); > > > } > > > > > > The thing is that in my tests I could notice that in.read(buffer) > > > never blocks. Even when there's nothing to read. Instead of blocking > > > when there's nothing to read it returns 0. > > > > > > So, my questions are: > > > > > > 1. Am I doing something wrong? > > > 2. If not, wouldnt this decrease performance? (the thread would be > > > locked in a loop that does nothing.) > > > 3. Is there a better way to do the job? > > > > > > Thanks in advance!! > > > > > > F?bio > > > -------- > > > > > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > > 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 > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > > > > > -- > > > Atenciosamente, > > > F?bio Cristiano dos Anjos > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/5306c4b1/attachment-0002.html From nick.circelli at infrasafe.com Fri Nov 2 07:01:17 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Fri, 2 Nov 2007 08:01:17 -0500 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com><29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com><90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca><29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Message-ID: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> I'm pretty sure that not blocking has to do with you virtual ports. Cause it should block. Maybe you should try: while ((numBytes = in.available()) > 0) { If (numBytes > buffer.length) { numBytes = buffer.length; // in case you have buffer overflow } numBytes = in.read(buffer, 0 , numBytes)); String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } Also, just for optimization, I'd move that byte[] buffer = new byte[10]; out of the while since you don't need to reallocate it every iteration. ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of F?bio Cristiano dos Anjos Sent: Friday, November 02, 2007 8:35 AM To: RXTX Developers and Users Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream (); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas < ajmas at sympatico.ca > wrote: Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info ("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Atenciosamente, F?bio Cristiano dos Anjos -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/4de7f6a3/attachment-0002.html From fabioanjos at gmail.com Fri Nov 2 07:36:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 10:36:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> Message-ID: <29788b250711020636q1588c88fgaa5e27f5504164fb@mail.gmail.com> Hi Nick, Actually, it doesnt block for physical ports too. And, the method avaiable does not block either, so when there's nothing avaiable the loop ends and the thread stops lintening to the port. But I did some more test with serialEventListener, and now its working. I realy dont know what I've done to get it working. I just start woking as soon as I decided to test it again. It was said here that serialEventListener is not reliable for virtual serial ports. Is there another way to read it, without compromising performance? Tanks again!! F?bio ------- On 11/2/07, Nick Circelli wrote: > > I'm pretty sure that not blocking has to do with you virtual ports. > Cause it should block. > > Maybe you should try: > > > > while ((numBytes = in.available()) > 0) > > { > > If (numBytes > buffer.length) { > > numBytes = buffer.length; // in case you have buffer overflow > > } > > numBytes = in.read(buffer, 0 , numBytes)); > > String dataValue = new String(buffer,0,numBytes,"ASCII"); > > processInput(dataValue); > > } > > > > Also, just for optimization, I'd move that byte[] buffer = new > byte[10]; > > out of the while since you don't need to reallocate it every iteration. > > > ------------------------------ > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On Behalf > Of *F?bio Cristiano dos Anjos > *Sent:* Friday, November 02, 2007 8:35 AM > *To:* RXTX Developers and Users > *Subject:* Re: [Rxtx] serialEvent(SerialPortEvent event) never be > triggered > > > > Hi, > > I think i missunderstand something here. > The code you post here was meant to be used inside serialEvent method, > right? > > The think is, that i cannot user SerialEventListener to read serial ports, > because i need to read virual serial ports and id does not behaves well, as > said here before. serialEvent is never triggered. > > So what I quit using SerialEventListener and created a thread to listen to > the port: > > public void run(){ > try{ > in = port.getInputStream(); > out = port.getOutputStream (); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new > String(buffer,0,numBytes,"ASCII"); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ getReceptor().getPort() > ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > } > > > So, the problem is that in.read(buffer) always returns 0 when there is > nothing to read, instead of blocking the flow, and the thread becames locked > in the loop. > > I hope you can help me solve this. > > Thanks in advance! > > F?bio > -------- > > On 11/2/07, *F?bio Cristiano dos Anjos* wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > > > On 11/1/07, *Andre-John Mas* < ajmas at sympatico.ca> wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info ("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/571df6ea/attachment.html From tjarvi at qbang.org Fri Nov 2 08:32:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Nov 2007 08:32:15 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: References: Message-ID: On Fri, 2 Nov 2007, Greg Johnson wrote: > Hi Trent, folks, > Having a single rxtx that is suitable for commercial uses and hobbyists both > would be a great idea? Perhaps it would be worth submitting rxtx as a > proposal to Codehaus - they not only provide excellent tools (Jira (bug > tracker), Confluence (wiki)) but also support build management ( > maestro, continuum, bamboo). Relying on your personal machine (btw, frii.com > / rxtx.org is down again?) seems like a burden you shouldn't have to shoulder > alone. Hi Greg, There may be a little confusion here. There is no need to have two seperate rxtx releases. What I'm trying to encourage is a discussion between some of the people responsible for making sure rxtx does not break their products each release. Usually these people are interested in testing a set of functionality their product depends upon. They do not work with rxtx code but rather traps to catch when rxtx developers break something. This goes on all the time in isolated labs. There are many services that offer to do various pieces of a project for you if you... Anyone is free to do the 'if you' portion with rxtx and see how it goes. I'm actually interested in doing less of that than more. The rxtx.org work I do just happens to overlap with other things I do for personal/family use. The reason I suggest the amazon solution is that anyone can take full control of the environment for a day and it costs less than a package of gum without causing harm to what anyone else is doing. I assume the down question was with respect to a mod_security setting that has been resolved. If not, please post a url to the problem. -- Trent Jarvi tjarvi at qbang.org From keithvz at verizon.net Thu Nov 1 08:08:58 2007 From: keithvz at verizon.net (Keith) Date: Thu, 01 Nov 2007 10:08:58 -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: <4729DDFA.7080206@verizon.net> Trent Jarvi wrote: > 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? Well, I honestly don't know how all this fits together. I think it's just a matter of enabling the right flow control option within the standard serial framework to tell the device driver, "HEY START USING DTR/DSR FOR FLOW CONTROL." If what UGeorge said,(about that type of nitty-gritty lead control being done within the device driver), is true, then this confirms my suspicion. I tried narrowing down within the Linux drivers what you are looking for, but I can't entirely tell wth I'm looking at. (virtual com port drivers -- they are included compiled by default with Ubuntu, source included) http://www.ftdichip.com/Drivers/VCP/Linux/ftdi_sio.tar.gz Hahahaa, they make a reference to DTR flow control being supported but say (UGH) in parenthesis. You can also use their direct device driver library on Ubuntu -- libftd2xx.so.0.4.13. No source code. http://www.ftdichip.com/Drivers/D2XX/Linux/libftd2xx0.4.13.tar.gz In that case, you make a call to their FT_SetFlowControl() function. FT_STATUS FT_SetFlowControl (FT_HANDLE ftHandle, USHORT usFlowControl, UCHAR uXon,UCHAR uXoff) Parameters ftHandle Handle of the device. usFlowControl Must be one of FT_FLOW_NONE, FT_FLOW_RTS_CTS, ****FT_FLOW_DTR_DSR**** or FT_FLOW_XON_XOFF. uXon Character used to signal Xon. Only used if flow control is FT_FLOW_XON_XOFF. uXoff Character used to signal Xoff. Only used if flow control is FT_FLOW_XON_XOFF. This is from their programming guide http://www.ftdichip.com/Documents/ProgramGuides/D2XXPG34.pdf I actually want to take this a step further and say that I think the flow control is actually handled right on the device itself in hardware/firmware. It's enabled through the device driver, but I think the maintaining of buffers, asserting/deasserting of leads, etc is handled by the device. For the time being, I've switched to jd2xx, https://jd2xx.dev.java.net/ and http://bleyer.org/jd2xx/ These are Java wrappers for the device driver libraries. It allows almost direct access to the well-documented device drivers from Java. I hope this helps Keith From tjarvi at qbang.org Thu Nov 1 11:09:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:09:51 -0600 (MDT) 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: Hi Martin, What I usually have done is allow changes that do not impact working software including changes to methods not documented in CommAPI (which remain undocumented in rxtx) and fixes to known problems in the documented portions. That way if you use the documented API, the releases should only become better with time. If you use the undocumented portions, the behavior is not as predictable but open for improvement. On Wed, 31 Oct 2007, 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 >> > From tjarvi at qbang.org Thu Nov 1 11:15:52 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:15:52 -0600 (MDT) 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: I too use rxtx in commercial products. The problem I've been trying to address while bringing the server back was how to make it possible for hobby folks to build the same software as companies so we can move rxtx along a little faster. Exposing internal tools is not an option at this time, the public rxtx builds have been done on my home machine which has drives hanging out of it all over the place dying one at a time. This isn't maintainable. I'm currently looking at the possibility of making an S3 image available on Amazon's EC. These are machines you can rent for ~10 cents an hour which is more than enough to build rxtx. The S3 image is not changed when people use it so everyone has the same starting point. With this, we could all build rxtx for ~20 platforms for a small price and eliminate tool issues. On Wed, 31 Oct 2007, Greg Johnson wrote: > 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 tjarvi at qbang.org Thu Nov 1 11:19:55 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:19:55 -0600 (MDT) 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: On Wed, 31 Oct 2007, 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. I was helping Dmitry do the Mac OS X port without access to a machine when we put that in. In the archives there is information (easily found with google on Apple's site) that describes how their API (and others) can determine if a port is used and ignore it. I think these changes are in CVS but need to confirm. The bottom line is that rxtx should not have used lock files on Mac. It was just ignorance of the system on my part. -- Trent Jarvi tjarvi at qbang.org From fabioanjos at gmail.com Thu Nov 1 12:35:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Thu, 1 Nov 2007 15:35:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Hi, I was using SerialEventListener in my project. But, as was said here, id doesnt work very well with virtual serial ports. So, I changed the strategy using the code posted here in this thread: try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > 0) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } The thing is that in my tests I could notice that in.read(buffer) never blocks. Even when there's nothing to read. Instead of blocking when there's nothing to read it returns 0. So, my questions are: 1. Am I doing something wrong? 2. If not, wouldnt this decrease performance? (the thread would be locked in a loop that does nothing.) 3. Is there a better way to do the job? Thanks in advance!! F?bio -------- On 10/31/07, Andre-John Mas wrote: > > > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/0aee59d0/attachment-0003.html From ajmas at sympatico.ca Thu Nov 1 16:07:55 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Nov 2007 18:07:55 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Message-ID: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From sarah_662005 at yahoo.com Thu Nov 1 17:10:05 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Thu, 1 Nov 2007 16:10:05 -0700 (PDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Message-ID: <351433.37166.qm@web55814.mail.re3.yahoo.com> Thank you very much for your help. Now the application works fine. the serialEvent gets triggered. Rxtx is cool! ----- Original Message ---- From: Andre-John Mas To: Sara Hugh ; RXTX Developers and Users Sent: Wednesday, October 31, 2007 9:55:45 AM Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered 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 __________________________________________________ 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/20071101/4a86bea6/attachment-0003.html From tjarvi at qbang.org Thu Nov 1 17:58:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 17:58:02 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx Message-ID: The rxtx.org site is primarily interested in the hobby aspects of rxtx. Obviously, there are some companies following the work too. These interests bring larger workflows and concerns about details hobby folks may not care about. They also bring many more users. I know the company I work for has a quality engineering effort going on which includes rxtx. While the server was down, I was contacted by another company that was missing the binaries for their testing. Several people have mentioned concerns about a stable release for like reasons. Would there be interest on the quality side of the coin to get together? It could be just sharing email's with each other or a seperate list for QE/QA. I can not say for sure, but we may be able to share some of our efforts/results that could help keep rxtx releases stable. -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Fri Nov 2 01:42:55 2007 From: scldad at sdc.com.au (Stephen Davies) Date: Fri, 2 Nov 2007 18:12:55 +1030 Subject: [Rxtx] Multiple modems Message-ID: <200711021812.56047.scldad@sdc.com.au> This may or may not be related to the Multiple Ports thread. I have an application which uses rxtx on Linux (via cron jobs) to connect multiple modems to remote sensing devices. The application works fine most of the time but occasionally fails to connect if two (or more) connection attempts happen at about the same time. When it fails, it looks as if it may get confused as to which port it is talking to. The app has a "base" component that looks for an available port, opens it and then creates an input thread and an output thread for the connection and data transfer. The "base" component uses this code: // loop round all known ports until one is available. Give up after three minutes Counter ptimeout = new Counter(); while(!portFound && ptimeout.elapsed() < 180000) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // special case. ttyS0 is not available to us on this server. if (!portId.isCurrentlyOwned() && !portId.getName().equals("/dev/ttyS0")) { gLog.debug(lognm + ": Found port " + portId.getName()); try { serialPort = (RXTXPort) portId.open("AguaModem", 10000); } catch (Exception e) { gLog.error(lognm + ": Port " + portId.getName() + " will not open."); gLog.error(e.getMessage()); continue; } AguaModem aguamodem = new AguaModem(); portFound = true; break; } gLog.debug(lognm + ": Port " + portId.getName() + " is busy"); } } } I am wondering about the isCurrentlyOwned method. Does this actually tell me whether a port is currently being used by another process? TIA, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From fabioanjos at gmail.com Fri Nov 2 04:59:58 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 07:59:58 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Message-ID: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/9009eb1d/attachment-0003.html From netbeans at gatworks.com Fri Nov 2 06:28:13 2007 From: netbeans at gatworks.com (U. George) Date: Fri, 02 Nov 2007 08:28:13 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <472B17DD.1050508@gatworks.com> It should normally block ( unless eof / event ) . so its a :{ whats the device ( to recreate if possible ) and how do u open. > My question is, is there a way to make in.read block the thead until > there's something to read? > From fabioanjos at gmail.com Fri Nov 2 06:34:46 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 09:34:46 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > On 11/1/07, Andre-John Mas wrote: > > > > Fabio, > > > > Turns out there was a small error in my example. The test should be: > > > > (numBytes = in.read(buffer)) > -1 > > > > This is because -1 indicates an end of file (end of data stream) > > > > Andre > > > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > > > Hi, > > > > > > I was using SerialEventListener in my project. But, as was said > > > here, id doesnt work very well with virtual serial ports. > > > So, I changed the strategy using the code posted here in this thread: > > > > > > try{ > > > in = port.getInputStream(); > > > out = port.getOutputStream(); > > > int numBytes = 0; > > > while(active){ > > > > > > byte[] buffer = new byte[10]; > > > > > > while ( (numBytes = in.read(buffer)) > 0) > > > { > > > String dataValue = new String(buffer,0,numBytes); > > > processInput(dataValue); > > > } > > > > > > if(numBytes==-1){ > > > break; > > > } > > > > > > Thread.sleep(50); > > > } > > > > > > }catch(IOException e){ > > > logger.info("falha de comunicacao "+ > > > getReceptor().getPort() ); > > > > > > }catch(InterruptedException e){ > > > logger.info ("Interrompendo leitura da porta "+ > > > getReceptor().getPort() ); > > > } > > > > > > The thing is that in my tests I could notice that in.read(buffer) > > > never blocks. Even when there's nothing to read. Instead of blocking > > > when there's nothing to read it returns 0. > > > > > > So, my questions are: > > > > > > 1. Am I doing something wrong? > > > 2. If not, wouldnt this decrease performance? (the thread would be > > > locked in a loop that does nothing.) > > > 3. Is there a better way to do the job? > > > > > > Thanks in advance!! > > > > > > F?bio > > > -------- > > > > > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > > 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 > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > > > > > -- > > > Atenciosamente, > > > F?bio Cristiano dos Anjos > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/5306c4b1/attachment-0003.html From nick.circelli at infrasafe.com Fri Nov 2 07:01:17 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Fri, 2 Nov 2007 08:01:17 -0500 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com><29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com><90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca><29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Message-ID: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> I'm pretty sure that not blocking has to do with you virtual ports. Cause it should block. Maybe you should try: while ((numBytes = in.available()) > 0) { If (numBytes > buffer.length) { numBytes = buffer.length; // in case you have buffer overflow } numBytes = in.read(buffer, 0 , numBytes)); String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } Also, just for optimization, I'd move that byte[] buffer = new byte[10]; out of the while since you don't need to reallocate it every iteration. ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of F?bio Cristiano dos Anjos Sent: Friday, November 02, 2007 8:35 AM To: RXTX Developers and Users Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream (); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas < ajmas at sympatico.ca > wrote: Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info ("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Atenciosamente, F?bio Cristiano dos Anjos -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/4de7f6a3/attachment-0003.html From fabioanjos at gmail.com Fri Nov 2 07:36:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 10:36:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> Message-ID: <29788b250711020636q1588c88fgaa5e27f5504164fb@mail.gmail.com> Hi Nick, Actually, it doesnt block for physical ports too. And, the method avaiable does not block either, so when there's nothing avaiable the loop ends and the thread stops lintening to the port. But I did some more test with serialEventListener, and now its working. I realy dont know what I've done to get it working. I just start woking as soon as I decided to test it again. It was said here that serialEventListener is not reliable for virtual serial ports. Is there another way to read it, without compromising performance? Tanks again!! F?bio ------- On 11/2/07, Nick Circelli wrote: > > I'm pretty sure that not blocking has to do with you virtual ports. > Cause it should block. > > Maybe you should try: > > > > while ((numBytes = in.available()) > 0) > > { > > If (numBytes > buffer.length) { > > numBytes = buffer.length; // in case you have buffer overflow > > } > > numBytes = in.read(buffer, 0 , numBytes)); > > String dataValue = new String(buffer,0,numBytes,"ASCII"); > > processInput(dataValue); > > } > > > > Also, just for optimization, I'd move that byte[] buffer = new > byte[10]; > > out of the while since you don't need to reallocate it every iteration. > > > ------------------------------ > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On Behalf > Of *F?bio Cristiano dos Anjos > *Sent:* Friday, November 02, 2007 8:35 AM > *To:* RXTX Developers and Users > *Subject:* Re: [Rxtx] serialEvent(SerialPortEvent event) never be > triggered > > > > Hi, > > I think i missunderstand something here. > The code you post here was meant to be used inside serialEvent method, > right? > > The think is, that i cannot user SerialEventListener to read serial ports, > because i need to read virual serial ports and id does not behaves well, as > said here before. serialEvent is never triggered. > > So what I quit using SerialEventListener and created a thread to listen to > the port: > > public void run(){ > try{ > in = port.getInputStream(); > out = port.getOutputStream (); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new > String(buffer,0,numBytes,"ASCII"); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ getReceptor().getPort() > ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > } > > > So, the problem is that in.read(buffer) always returns 0 when there is > nothing to read, instead of blocking the flow, and the thread becames locked > in the loop. > > I hope you can help me solve this. > > Thanks in advance! > > F?bio > -------- > > On 11/2/07, *F?bio Cristiano dos Anjos* wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > > > On 11/1/07, *Andre-John Mas* < ajmas at sympatico.ca> wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info ("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/571df6ea/attachment-0002.html From tjarvi at qbang.org Fri Nov 2 08:32:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Nov 2007 08:32:15 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: References: Message-ID: On Fri, 2 Nov 2007, Greg Johnson wrote: > Hi Trent, folks, > Having a single rxtx that is suitable for commercial uses and hobbyists both > would be a great idea? Perhaps it would be worth submitting rxtx as a > proposal to Codehaus - they not only provide excellent tools (Jira (bug > tracker), Confluence (wiki)) but also support build management ( > maestro, continuum, bamboo). Relying on your personal machine (btw, frii.com > / rxtx.org is down again?) seems like a burden you shouldn't have to shoulder > alone. Hi Greg, There may be a little confusion here. There is no need to have two seperate rxtx releases. What I'm trying to encourage is a discussion between some of the people responsible for making sure rxtx does not break their products each release. Usually these people are interested in testing a set of functionality their product depends upon. They do not work with rxtx code but rather traps to catch when rxtx developers break something. This goes on all the time in isolated labs. There are many services that offer to do various pieces of a project for you if you... Anyone is free to do the 'if you' portion with rxtx and see how it goes. I'm actually interested in doing less of that than more. The rxtx.org work I do just happens to overlap with other things I do for personal/family use. The reason I suggest the amazon solution is that anyone can take full control of the environment for a day and it costs less than a package of gum without causing harm to what anyone else is doing. I assume the down question was with respect to a mod_security setting that has been resolved. If not, please post a url to the problem. -- Trent Jarvi tjarvi at qbang.org From nsayer at kfu.com Sat Nov 3 20:17:49 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 19:17:49 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? Message-ID: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Has anyone got RXTX working with an app under Leopard? My app hangs on port open (it works fine with Tiger). The relevant thread looks like this in the activity monitor: 1536 JVM_InvokeMethod 1536 0x48ccd0 1536 0x46f8a0 1536 0x4c3ff4 1536 0x4c4284 1536 0x357d160 1536 0x357faac 1536 Java_gnu_io_RXTXPort_open 1536 open $NOCANCEL$UNIX2003 1536 open $NOCANCEL$UNIX2003 From ajmas at sympatico.ca Sat Nov 3 22:02:04 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 00:02:04 -0400 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> RXTX works for me with Leopard. I am currently using it communicate with a Bluetooth GPS. What computer and device are you trying to use? Is the driver for your serial device compatible with MacOS X 10.5? Andre On 3-Nov-07, at 22:17 , Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From nsayer at kfu.com Sat Nov 3 22:17:47 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 21:17:47 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> Message-ID: <1720F723-3643-438C-B3AB-E09A67536977@kfu.com> On Nov 3, 2007, at 9:02 PM, Andre-John Mas wrote: > RXTX works for me with Leopard. I am currently using it communicate > with a Bluetooth GPS. > > What computer and device are you trying to use? Is the driver for > your serial device compatible with MacOS X 10.5? An Intel mac mini The FTDI USB serial driver an XMPCR, which is just a fancy serial controlled radio and an FTDI usb-to-serial chip I've successfully used the FTDI driver with another FTDI device in another context. > > > Andre > > On 3-Nov-07, at 22:17 , Nick Sayer wrote: > >> Has anyone got RXTX working with an app under Leopard? >> >> My app hangs on port open (it works fine with Tiger). The relevant >> thread looks like this in the activity monitor: >> >> 1536 JVM_InvokeMethod >> 1536 0x48ccd0 >> 1536 0x46f8a0 >> 1536 0x4c3ff4 >> 1536 0x4c4284 >> 1536 0x357d160 >> 1536 0x357faac >> 1536 >> Java_gnu_io_RXTXPort_open >> 1536 open >> $NOCANCEL$UNIX2003 >> 1536 open >> $NOCANCEL$UNIX2003 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From racecar at gmail.com Sat Nov 3 22:25:53 2007 From: racecar at gmail.com (Kevin Mateo Lim) Date: Sat, 3 Nov 2007 21:25:53 -0700 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: Message-ID: I am alternating between two errors. After i run the macosx_setup.command, "everyone" is set to Read only in /var/lock. I notice in the terminal that the group for these perms is _uucp, not uucp. In that state, I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 check_group_uucp(): error testing lock file creation Error details:Permission deniedcheck_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException : Error inside Serial.() at processing.serial.Serial.errorMessage(Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.( Serial.java:102) at Temporary_829_3245.setup(Temporary_829_3245.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java :690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) Then, I hand edit the "everyone" permissions for /var/lock/ to Read and Write (note /var/spool/uucp is Read/Write in all cases, and doesn't change). I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX uucp_lock() /var/lock/LK.003.009.000 is there gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException: Error inside Serial.() at processing.serial.Serial.errorMessage (Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.(Serial.java:102) at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java:690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) See here: http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071103/f1a2c467/attachment.html From greg.johnson at manchester.ac.uk Sun Nov 4 02:31:13 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sun, 4 Nov 2007 10:31:13 +0100 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <28B5E0A0-0802-4C74-AC21-87ED35F3B9A2@manchester.ac.uk> Hi Nick, I also had problems initially with Leopard, but it was resolved by reinstalling the serial USB driver (FTDI in my case). The symptoms were a non-detection of any ports (but I twigged when I tried ZTerm and it had the same problem). Good luck! Cheers, greg PS I did a "Archive and install" which may be the reason my FTDI driver had disappeared - I don't think the driver has changed for 10.5 ------------------------------------------------------------------------- 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 4 Nov 2007, at 03:17, Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From keithvz at verizon.net Thu Nov 1 08:08:58 2007 From: keithvz at verizon.net (Keith) Date: Thu, 01 Nov 2007 10:08:58 -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: <4729DDFA.7080206@verizon.net> Trent Jarvi wrote: > 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? Well, I honestly don't know how all this fits together. I think it's just a matter of enabling the right flow control option within the standard serial framework to tell the device driver, "HEY START USING DTR/DSR FOR FLOW CONTROL." If what UGeorge said,(about that type of nitty-gritty lead control being done within the device driver), is true, then this confirms my suspicion. I tried narrowing down within the Linux drivers what you are looking for, but I can't entirely tell wth I'm looking at. (virtual com port drivers -- they are included compiled by default with Ubuntu, source included) http://www.ftdichip.com/Drivers/VCP/Linux/ftdi_sio.tar.gz Hahahaa, they make a reference to DTR flow control being supported but say (UGH) in parenthesis. You can also use their direct device driver library on Ubuntu -- libftd2xx.so.0.4.13. No source code. http://www.ftdichip.com/Drivers/D2XX/Linux/libftd2xx0.4.13.tar.gz In that case, you make a call to their FT_SetFlowControl() function. FT_STATUS FT_SetFlowControl (FT_HANDLE ftHandle, USHORT usFlowControl, UCHAR uXon,UCHAR uXoff) Parameters ftHandle Handle of the device. usFlowControl Must be one of FT_FLOW_NONE, FT_FLOW_RTS_CTS, ****FT_FLOW_DTR_DSR**** or FT_FLOW_XON_XOFF. uXon Character used to signal Xon. Only used if flow control is FT_FLOW_XON_XOFF. uXoff Character used to signal Xoff. Only used if flow control is FT_FLOW_XON_XOFF. This is from their programming guide http://www.ftdichip.com/Documents/ProgramGuides/D2XXPG34.pdf I actually want to take this a step further and say that I think the flow control is actually handled right on the device itself in hardware/firmware. It's enabled through the device driver, but I think the maintaining of buffers, asserting/deasserting of leads, etc is handled by the device. For the time being, I've switched to jd2xx, https://jd2xx.dev.java.net/ and http://bleyer.org/jd2xx/ These are Java wrappers for the device driver libraries. It allows almost direct access to the well-documented device drivers from Java. I hope this helps Keith From tjarvi at qbang.org Thu Nov 1 11:09:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:09:51 -0600 (MDT) 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: Hi Martin, What I usually have done is allow changes that do not impact working software including changes to methods not documented in CommAPI (which remain undocumented in rxtx) and fixes to known problems in the documented portions. That way if you use the documented API, the releases should only become better with time. If you use the undocumented portions, the behavior is not as predictable but open for improvement. On Wed, 31 Oct 2007, 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 >> > From tjarvi at qbang.org Thu Nov 1 11:15:52 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:15:52 -0600 (MDT) 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: I too use rxtx in commercial products. The problem I've been trying to address while bringing the server back was how to make it possible for hobby folks to build the same software as companies so we can move rxtx along a little faster. Exposing internal tools is not an option at this time, the public rxtx builds have been done on my home machine which has drives hanging out of it all over the place dying one at a time. This isn't maintainable. I'm currently looking at the possibility of making an S3 image available on Amazon's EC. These are machines you can rent for ~10 cents an hour which is more than enough to build rxtx. The S3 image is not changed when people use it so everyone has the same starting point. With this, we could all build rxtx for ~20 platforms for a small price and eliminate tool issues. On Wed, 31 Oct 2007, Greg Johnson wrote: > 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 tjarvi at qbang.org Thu Nov 1 11:19:55 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:19:55 -0600 (MDT) 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: On Wed, 31 Oct 2007, 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. I was helping Dmitry do the Mac OS X port without access to a machine when we put that in. In the archives there is information (easily found with google on Apple's site) that describes how their API (and others) can determine if a port is used and ignore it. I think these changes are in CVS but need to confirm. The bottom line is that rxtx should not have used lock files on Mac. It was just ignorance of the system on my part. -- Trent Jarvi tjarvi at qbang.org From fabioanjos at gmail.com Thu Nov 1 12:35:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Thu, 1 Nov 2007 15:35:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Hi, I was using SerialEventListener in my project. But, as was said here, id doesnt work very well with virtual serial ports. So, I changed the strategy using the code posted here in this thread: try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > 0) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } The thing is that in my tests I could notice that in.read(buffer) never blocks. Even when there's nothing to read. Instead of blocking when there's nothing to read it returns 0. So, my questions are: 1. Am I doing something wrong? 2. If not, wouldnt this decrease performance? (the thread would be locked in a loop that does nothing.) 3. Is there a better way to do the job? Thanks in advance!! F?bio -------- On 10/31/07, Andre-John Mas wrote: > > > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/0aee59d0/attachment-0004.html From ajmas at sympatico.ca Thu Nov 1 16:07:55 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Nov 2007 18:07:55 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Message-ID: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From sarah_662005 at yahoo.com Thu Nov 1 17:10:05 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Thu, 1 Nov 2007 16:10:05 -0700 (PDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Message-ID: <351433.37166.qm@web55814.mail.re3.yahoo.com> Thank you very much for your help. Now the application works fine. the serialEvent gets triggered. Rxtx is cool! ----- Original Message ---- From: Andre-John Mas To: Sara Hugh ; RXTX Developers and Users Sent: Wednesday, October 31, 2007 9:55:45 AM Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered 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 __________________________________________________ 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/20071101/4a86bea6/attachment-0004.html From tjarvi at qbang.org Thu Nov 1 17:58:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 17:58:02 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx Message-ID: The rxtx.org site is primarily interested in the hobby aspects of rxtx. Obviously, there are some companies following the work too. These interests bring larger workflows and concerns about details hobby folks may not care about. They also bring many more users. I know the company I work for has a quality engineering effort going on which includes rxtx. While the server was down, I was contacted by another company that was missing the binaries for their testing. Several people have mentioned concerns about a stable release for like reasons. Would there be interest on the quality side of the coin to get together? It could be just sharing email's with each other or a seperate list for QE/QA. I can not say for sure, but we may be able to share some of our efforts/results that could help keep rxtx releases stable. -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Fri Nov 2 01:42:55 2007 From: scldad at sdc.com.au (Stephen Davies) Date: Fri, 2 Nov 2007 18:12:55 +1030 Subject: [Rxtx] Multiple modems Message-ID: <200711021812.56047.scldad@sdc.com.au> This may or may not be related to the Multiple Ports thread. I have an application which uses rxtx on Linux (via cron jobs) to connect multiple modems to remote sensing devices. The application works fine most of the time but occasionally fails to connect if two (or more) connection attempts happen at about the same time. When it fails, it looks as if it may get confused as to which port it is talking to. The app has a "base" component that looks for an available port, opens it and then creates an input thread and an output thread for the connection and data transfer. The "base" component uses this code: // loop round all known ports until one is available. Give up after three minutes Counter ptimeout = new Counter(); while(!portFound && ptimeout.elapsed() < 180000) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // special case. ttyS0 is not available to us on this server. if (!portId.isCurrentlyOwned() && !portId.getName().equals("/dev/ttyS0")) { gLog.debug(lognm + ": Found port " + portId.getName()); try { serialPort = (RXTXPort) portId.open("AguaModem", 10000); } catch (Exception e) { gLog.error(lognm + ": Port " + portId.getName() + " will not open."); gLog.error(e.getMessage()); continue; } AguaModem aguamodem = new AguaModem(); portFound = true; break; } gLog.debug(lognm + ": Port " + portId.getName() + " is busy"); } } } I am wondering about the isCurrentlyOwned method. Does this actually tell me whether a port is currently being used by another process? TIA, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From fabioanjos at gmail.com Fri Nov 2 04:59:58 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 07:59:58 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Message-ID: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/9009eb1d/attachment-0004.html From netbeans at gatworks.com Fri Nov 2 06:28:13 2007 From: netbeans at gatworks.com (U. George) Date: Fri, 02 Nov 2007 08:28:13 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <472B17DD.1050508@gatworks.com> It should normally block ( unless eof / event ) . so its a :{ whats the device ( to recreate if possible ) and how do u open. > My question is, is there a way to make in.read block the thead until > there's something to read? > From fabioanjos at gmail.com Fri Nov 2 06:34:46 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 09:34:46 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > On 11/1/07, Andre-John Mas wrote: > > > > Fabio, > > > > Turns out there was a small error in my example. The test should be: > > > > (numBytes = in.read(buffer)) > -1 > > > > This is because -1 indicates an end of file (end of data stream) > > > > Andre > > > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > > > Hi, > > > > > > I was using SerialEventListener in my project. But, as was said > > > here, id doesnt work very well with virtual serial ports. > > > So, I changed the strategy using the code posted here in this thread: > > > > > > try{ > > > in = port.getInputStream(); > > > out = port.getOutputStream(); > > > int numBytes = 0; > > > while(active){ > > > > > > byte[] buffer = new byte[10]; > > > > > > while ( (numBytes = in.read(buffer)) > 0) > > > { > > > String dataValue = new String(buffer,0,numBytes); > > > processInput(dataValue); > > > } > > > > > > if(numBytes==-1){ > > > break; > > > } > > > > > > Thread.sleep(50); > > > } > > > > > > }catch(IOException e){ > > > logger.info("falha de comunicacao "+ > > > getReceptor().getPort() ); > > > > > > }catch(InterruptedException e){ > > > logger.info ("Interrompendo leitura da porta "+ > > > getReceptor().getPort() ); > > > } > > > > > > The thing is that in my tests I could notice that in.read(buffer) > > > never blocks. Even when there's nothing to read. Instead of blocking > > > when there's nothing to read it returns 0. > > > > > > So, my questions are: > > > > > > 1. Am I doing something wrong? > > > 2. If not, wouldnt this decrease performance? (the thread would be > > > locked in a loop that does nothing.) > > > 3. Is there a better way to do the job? > > > > > > Thanks in advance!! > > > > > > F?bio > > > -------- > > > > > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > > 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 > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > > > > > -- > > > Atenciosamente, > > > F?bio Cristiano dos Anjos > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/5306c4b1/attachment-0004.html From nick.circelli at infrasafe.com Fri Nov 2 07:01:17 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Fri, 2 Nov 2007 08:01:17 -0500 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com><29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com><90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca><29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Message-ID: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> I'm pretty sure that not blocking has to do with you virtual ports. Cause it should block. Maybe you should try: while ((numBytes = in.available()) > 0) { If (numBytes > buffer.length) { numBytes = buffer.length; // in case you have buffer overflow } numBytes = in.read(buffer, 0 , numBytes)); String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } Also, just for optimization, I'd move that byte[] buffer = new byte[10]; out of the while since you don't need to reallocate it every iteration. ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of F?bio Cristiano dos Anjos Sent: Friday, November 02, 2007 8:35 AM To: RXTX Developers and Users Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream (); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas < ajmas at sympatico.ca > wrote: Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info ("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Atenciosamente, F?bio Cristiano dos Anjos -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/4de7f6a3/attachment-0004.html From fabioanjos at gmail.com Fri Nov 2 07:36:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 10:36:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> Message-ID: <29788b250711020636q1588c88fgaa5e27f5504164fb@mail.gmail.com> Hi Nick, Actually, it doesnt block for physical ports too. And, the method avaiable does not block either, so when there's nothing avaiable the loop ends and the thread stops lintening to the port. But I did some more test with serialEventListener, and now its working. I realy dont know what I've done to get it working. I just start woking as soon as I decided to test it again. It was said here that serialEventListener is not reliable for virtual serial ports. Is there another way to read it, without compromising performance? Tanks again!! F?bio ------- On 11/2/07, Nick Circelli wrote: > > I'm pretty sure that not blocking has to do with you virtual ports. > Cause it should block. > > Maybe you should try: > > > > while ((numBytes = in.available()) > 0) > > { > > If (numBytes > buffer.length) { > > numBytes = buffer.length; // in case you have buffer overflow > > } > > numBytes = in.read(buffer, 0 , numBytes)); > > String dataValue = new String(buffer,0,numBytes,"ASCII"); > > processInput(dataValue); > > } > > > > Also, just for optimization, I'd move that byte[] buffer = new > byte[10]; > > out of the while since you don't need to reallocate it every iteration. > > > ------------------------------ > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On Behalf > Of *F?bio Cristiano dos Anjos > *Sent:* Friday, November 02, 2007 8:35 AM > *To:* RXTX Developers and Users > *Subject:* Re: [Rxtx] serialEvent(SerialPortEvent event) never be > triggered > > > > Hi, > > I think i missunderstand something here. > The code you post here was meant to be used inside serialEvent method, > right? > > The think is, that i cannot user SerialEventListener to read serial ports, > because i need to read virual serial ports and id does not behaves well, as > said here before. serialEvent is never triggered. > > So what I quit using SerialEventListener and created a thread to listen to > the port: > > public void run(){ > try{ > in = port.getInputStream(); > out = port.getOutputStream (); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new > String(buffer,0,numBytes,"ASCII"); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ getReceptor().getPort() > ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > } > > > So, the problem is that in.read(buffer) always returns 0 when there is > nothing to read, instead of blocking the flow, and the thread becames locked > in the loop. > > I hope you can help me solve this. > > Thanks in advance! > > F?bio > -------- > > On 11/2/07, *F?bio Cristiano dos Anjos* wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > > > On 11/1/07, *Andre-John Mas* < ajmas at sympatico.ca> wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info ("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/571df6ea/attachment-0003.html From tjarvi at qbang.org Fri Nov 2 08:32:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Nov 2007 08:32:15 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: References: Message-ID: On Fri, 2 Nov 2007, Greg Johnson wrote: > Hi Trent, folks, > Having a single rxtx that is suitable for commercial uses and hobbyists both > would be a great idea? Perhaps it would be worth submitting rxtx as a > proposal to Codehaus - they not only provide excellent tools (Jira (bug > tracker), Confluence (wiki)) but also support build management ( > maestro, continuum, bamboo). Relying on your personal machine (btw, frii.com > / rxtx.org is down again?) seems like a burden you shouldn't have to shoulder > alone. Hi Greg, There may be a little confusion here. There is no need to have two seperate rxtx releases. What I'm trying to encourage is a discussion between some of the people responsible for making sure rxtx does not break their products each release. Usually these people are interested in testing a set of functionality their product depends upon. They do not work with rxtx code but rather traps to catch when rxtx developers break something. This goes on all the time in isolated labs. There are many services that offer to do various pieces of a project for you if you... Anyone is free to do the 'if you' portion with rxtx and see how it goes. I'm actually interested in doing less of that than more. The rxtx.org work I do just happens to overlap with other things I do for personal/family use. The reason I suggest the amazon solution is that anyone can take full control of the environment for a day and it costs less than a package of gum without causing harm to what anyone else is doing. I assume the down question was with respect to a mod_security setting that has been resolved. If not, please post a url to the problem. -- Trent Jarvi tjarvi at qbang.org From nsayer at kfu.com Sat Nov 3 20:17:49 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 19:17:49 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? Message-ID: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Has anyone got RXTX working with an app under Leopard? My app hangs on port open (it works fine with Tiger). The relevant thread looks like this in the activity monitor: 1536 JVM_InvokeMethod 1536 0x48ccd0 1536 0x46f8a0 1536 0x4c3ff4 1536 0x4c4284 1536 0x357d160 1536 0x357faac 1536 Java_gnu_io_RXTXPort_open 1536 open $NOCANCEL$UNIX2003 1536 open $NOCANCEL$UNIX2003 From ajmas at sympatico.ca Sat Nov 3 22:02:04 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 00:02:04 -0400 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> RXTX works for me with Leopard. I am currently using it communicate with a Bluetooth GPS. What computer and device are you trying to use? Is the driver for your serial device compatible with MacOS X 10.5? Andre On 3-Nov-07, at 22:17 , Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From nsayer at kfu.com Sat Nov 3 22:17:47 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 21:17:47 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> Message-ID: <1720F723-3643-438C-B3AB-E09A67536977@kfu.com> On Nov 3, 2007, at 9:02 PM, Andre-John Mas wrote: > RXTX works for me with Leopard. I am currently using it communicate > with a Bluetooth GPS. > > What computer and device are you trying to use? Is the driver for > your serial device compatible with MacOS X 10.5? An Intel mac mini The FTDI USB serial driver an XMPCR, which is just a fancy serial controlled radio and an FTDI usb-to-serial chip I've successfully used the FTDI driver with another FTDI device in another context. > > > Andre > > On 3-Nov-07, at 22:17 , Nick Sayer wrote: > >> Has anyone got RXTX working with an app under Leopard? >> >> My app hangs on port open (it works fine with Tiger). The relevant >> thread looks like this in the activity monitor: >> >> 1536 JVM_InvokeMethod >> 1536 0x48ccd0 >> 1536 0x46f8a0 >> 1536 0x4c3ff4 >> 1536 0x4c4284 >> 1536 0x357d160 >> 1536 0x357faac >> 1536 >> Java_gnu_io_RXTXPort_open >> 1536 open >> $NOCANCEL$UNIX2003 >> 1536 open >> $NOCANCEL$UNIX2003 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From racecar at gmail.com Sat Nov 3 22:25:53 2007 From: racecar at gmail.com (Kevin Mateo Lim) Date: Sat, 3 Nov 2007 21:25:53 -0700 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: Message-ID: I am alternating between two errors. After i run the macosx_setup.command, "everyone" is set to Read only in /var/lock. I notice in the terminal that the group for these perms is _uucp, not uucp. In that state, I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 check_group_uucp(): error testing lock file creation Error details:Permission deniedcheck_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException : Error inside Serial.() at processing.serial.Serial.errorMessage(Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.( Serial.java:102) at Temporary_829_3245.setup(Temporary_829_3245.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java :690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) Then, I hand edit the "everyone" permissions for /var/lock/ to Read and Write (note /var/spool/uucp is Read/Write in all cases, and doesn't change). I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX uucp_lock() /var/lock/LK.003.009.000 is there gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException: Error inside Serial.() at processing.serial.Serial.errorMessage (Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.(Serial.java:102) at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java:690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) See here: http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071103/f1a2c467/attachment-0001.html From greg.johnson at manchester.ac.uk Sun Nov 4 02:31:13 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sun, 4 Nov 2007 10:31:13 +0100 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <28B5E0A0-0802-4C74-AC21-87ED35F3B9A2@manchester.ac.uk> Hi Nick, I also had problems initially with Leopard, but it was resolved by reinstalling the serial USB driver (FTDI in my case). The symptoms were a non-detection of any ports (but I twigged when I tried ZTerm and it had the same problem). Good luck! Cheers, greg PS I did a "Archive and install" which may be the reason my FTDI driver had disappeared - I don't think the driver has changed for 10.5 ------------------------------------------------------------------------- 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 4 Nov 2007, at 03:17, Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Sun Nov 4 13:01:12 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 15:01:12 -0500 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: Message-ID: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Hi, You will need to get the 2.1-8 code from CVS. See the FAQ for more information: http://rxtx.qbang.org/wiki/index.php/FAQ Andre On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > I am alternating between two errors. > > After i run the macosx_setup.command, "everyone" is set to Read only > in /var/lock. I notice in the terminal that the group for these > perms is _uucp, not uucp. > > In that state, I get this error: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > check_group_uucp(): error testing lock file creation Error > details:Permission deniedcheck_lock_status: No permission to create > lock file. > please see: How can I use Lock Files with rxtx? in INSTALL > gnu.io.PortInUseException: Unknown Application > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > java.lang.RuntimeException : Error inside Serial.() > > at processing.serial.Serial.errorMessage(Serial.java:583) > > at processing.serial.Serial.(Serial.java:148) > > at processing.serial.Serial.( Serial.java:102) > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > at processing.core.PApplet.run(PApplet.java:1556) > > at java.lang.Thread.run(Thread.java:613) > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > and Write (note /var/spool/uucp is Read/Write in all cases, and > doesn't change). I get this error: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > gnu.io.PortInUseException: Unknown Application > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > java.lang.RuntimeException: Error inside Serial.() > > at processing.serial.Serial.errorMessage (Serial.java:583) > > at processing.serial.Serial.(Serial.java:148) > > at processing.serial.Serial.(Serial.java:102) > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > at processing.core.PApplet.run(PApplet.java:1556) > > at java.lang.Thread.run(Thread.java:613) > > See here: > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From netbeans at gatworks.com Sun Nov 4 14:33:35 2007 From: netbeans at gatworks.com (U. George) Date: Sun, 04 Nov 2007 16:33:35 -0500 Subject: [Rxtx] #ifndef TIOCSERGETLSR Message-ID: <472E3AAF.7050709@gatworks.com> For Linux, it seems that you need the code for both *having* a TIOCSERGETLSR, and *not having* a TIOCSERGETLSR. Maybe the ioctl exists system wide, but not necessarily for the device driver itself ( always returns -1 ) . Are there systems that have a *functioning* TIOCSERGETLSR for all their devices? Then this would be the case where the "#ifndef TIOCSERGETLSR" directive could be useful is eliminating the unnecessary code and tests. And for those systems that dont have a TIOCSERGETLSR, then the code for TIOCSERGETLSR can be eliminated. It would be a simple case to have, as a foundation, all the code to simulate the missing TIOCSERGETLSR ioctl. If the system does have the ioctl, then that code can be ifdef'd in, and co-exist with the functionality of the code that simulates the missing TIOCSERGETLSR ioctl. From racecar at gmail.com Sun Nov 4 17:30:19 2007 From: racecar at gmail.com (Kevin Mateo Lim) Date: Sun, 4 Nov 2007 17:30:19 -0700 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: the README.OSX reads: Put libSerial.jnilib in the directory of the application (the JavaVM will find it there). Add RXTXComm.jar to the application classpath or include the classes in the application jar. (Some applications already include the RXTX classes in their application jar, in which case only the file libSerial.jnilib is required). I can't find libSerial.jnilib I put librxtxSerial.jnilib into my Processing /libraries/serial/library/ directory. Yet it still sees the old version: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 On 11/4/07, Andre-John Mas wrote: > > Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > 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/20071104/c0a83f91/attachment-0001.html From ajmas at sympatico.ca Sun Nov 4 17:41:47 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 19:41:47 -0500 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> If you are wanting it to be available for all applications, - for all users: /Library/Java/Extensions - for your user: ~/Library/Java/Extensions Or just for your application, then it should be in the same directory from which yo are launching your application. If you are getting the 2.1-8 source, then the library built is called: librxtxSerial.jnilib despite what the docs say. Andre On 4-Nov-07, at 19:30 , Kevin Mateo Lim wrote: > > the README.OSX reads: > Put > libSerial.jnilib > in the directory of the application (the JavaVM will find it there). > Add > RXTXComm.jar > to the application classpath or include the classes in the > application jar. > (Some applications already include the RXTX classes in their > application jar, > in which case only the file libSerial.jnilib is required). > > > I can't find libSerial.jnilib > I put librxtxSerial.jnilib into my Processing /libraries/serial/ > library/ directory. > > Yet it still sees the old version: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > On 11/4/07, Andre-John Mas wrote: Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial .(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay (PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > From bschlining at gmail.com Sun Nov 4 19:46:23 2007 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 4 Nov 2007 18:46:23 -0800 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> Message-ID: > > Or just for your application, then it should be in the same directory > from which yo are launching your application. Just wanted to add one more way of specifying the native lib location... If you don't want to define it globally by putting it in /Library/Java/Extensions (and you don't, it's a very very bad practice) you can also specify the location of the native library when starting the JVM by specifying the 'java.library.path' property. For example: java -Djava.library.path=/Path/To/Directory/With/RXTX/Library YourMainClass -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071104/c5af6980/attachment.html From greg.johnson at manchester.ac.uk Mon Nov 5 01:39:02 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Mon, 5 Nov 2007 09:39:02 +0100 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: The 2.1-8 code reports 2.1-7, hence your (and my) confusion. But as long as you've removed all traces of the old library, it really _is_ 2.1-8. And if you specify the library path to the VM, don't make my mistake (on OSX at least) - you need to respecify the entire library path it had by default, as the command line argument replaces the path, rather than appending to it. 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 5 Nov 2007, at 01:30, Kevin Mateo Lim wrote: > > the README.OSX reads: > Put > libSerial.jnilib > in the directory of the application (the JavaVM will find it there). > Add > RXTXComm.jar > to the application classpath or include the classes in the > application jar. > (Some applications already include the RXTX classes in their > application jar, > in which case only the file libSerial.jnilib is required). > > > I can't find libSerial.jnilib > I put librxtxSerial.jnilib into my Processing /libraries/serial/ > library/ directory. > > Yet it still sees the old version: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > On 11/4/07, Andre-John Mas wrote: > Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial .(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay (PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > 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 HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071105/7f50506d/attachment.html From cyrille.dumont at tatexpress.fr Mon Nov 5 05:46:03 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 05 Nov 2007 13:46:03 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: References: <472727F1.1000704@tatexpress.fr> Message-ID: <472F108B.2090101@tatexpress.fr> Thanks a lot for your solution ... but I'm not a expert in JAVA ... (sorry) For the moment I've this function : """ public void serialEvent(SerialPortEvent e) { StringBuffer inputBuffer = new StringBuffer(); int newData = 0; switch (e.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } //-- Manag. Data from Scanner this.MngDataScanner(inputBuffer.toString()); break; case SerialPortEvent.BI:; //-- Break Received } } """ How can I do what you write ? ( maybe a simple ex ? ) PS : I don't know the PDF417 size (could be, for example, 338 char, or 500 ... ; what I know is that it can't be more than 800 char) Thanks in advance. Best regards. Trent Jarvi a ?crit : > 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 keithvz at verizon.net Thu Nov 1 08:08:58 2007 From: keithvz at verizon.net (Keith) Date: Thu, 01 Nov 2007 10:08:58 -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: <4729DDFA.7080206@verizon.net> Trent Jarvi wrote: > 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? Well, I honestly don't know how all this fits together. I think it's just a matter of enabling the right flow control option within the standard serial framework to tell the device driver, "HEY START USING DTR/DSR FOR FLOW CONTROL." If what UGeorge said,(about that type of nitty-gritty lead control being done within the device driver), is true, then this confirms my suspicion. I tried narrowing down within the Linux drivers what you are looking for, but I can't entirely tell wth I'm looking at. (virtual com port drivers -- they are included compiled by default with Ubuntu, source included) http://www.ftdichip.com/Drivers/VCP/Linux/ftdi_sio.tar.gz Hahahaa, they make a reference to DTR flow control being supported but say (UGH) in parenthesis. You can also use their direct device driver library on Ubuntu -- libftd2xx.so.0.4.13. No source code. http://www.ftdichip.com/Drivers/D2XX/Linux/libftd2xx0.4.13.tar.gz In that case, you make a call to their FT_SetFlowControl() function. FT_STATUS FT_SetFlowControl (FT_HANDLE ftHandle, USHORT usFlowControl, UCHAR uXon,UCHAR uXoff) Parameters ftHandle Handle of the device. usFlowControl Must be one of FT_FLOW_NONE, FT_FLOW_RTS_CTS, ****FT_FLOW_DTR_DSR**** or FT_FLOW_XON_XOFF. uXon Character used to signal Xon. Only used if flow control is FT_FLOW_XON_XOFF. uXoff Character used to signal Xoff. Only used if flow control is FT_FLOW_XON_XOFF. This is from their programming guide http://www.ftdichip.com/Documents/ProgramGuides/D2XXPG34.pdf I actually want to take this a step further and say that I think the flow control is actually handled right on the device itself in hardware/firmware. It's enabled through the device driver, but I think the maintaining of buffers, asserting/deasserting of leads, etc is handled by the device. For the time being, I've switched to jd2xx, https://jd2xx.dev.java.net/ and http://bleyer.org/jd2xx/ These are Java wrappers for the device driver libraries. It allows almost direct access to the well-documented device drivers from Java. I hope this helps Keith From tjarvi at qbang.org Thu Nov 1 11:09:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:09:51 -0600 (MDT) 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: Hi Martin, What I usually have done is allow changes that do not impact working software including changes to methods not documented in CommAPI (which remain undocumented in rxtx) and fixes to known problems in the documented portions. That way if you use the documented API, the releases should only become better with time. If you use the undocumented portions, the behavior is not as predictable but open for improvement. On Wed, 31 Oct 2007, 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 >> > From tjarvi at qbang.org Thu Nov 1 11:15:52 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:15:52 -0600 (MDT) 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: I too use rxtx in commercial products. The problem I've been trying to address while bringing the server back was how to make it possible for hobby folks to build the same software as companies so we can move rxtx along a little faster. Exposing internal tools is not an option at this time, the public rxtx builds have been done on my home machine which has drives hanging out of it all over the place dying one at a time. This isn't maintainable. I'm currently looking at the possibility of making an S3 image available on Amazon's EC. These are machines you can rent for ~10 cents an hour which is more than enough to build rxtx. The S3 image is not changed when people use it so everyone has the same starting point. With this, we could all build rxtx for ~20 platforms for a small price and eliminate tool issues. On Wed, 31 Oct 2007, Greg Johnson wrote: > 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 tjarvi at qbang.org Thu Nov 1 11:19:55 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:19:55 -0600 (MDT) 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: On Wed, 31 Oct 2007, 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. I was helping Dmitry do the Mac OS X port without access to a machine when we put that in. In the archives there is information (easily found with google on Apple's site) that describes how their API (and others) can determine if a port is used and ignore it. I think these changes are in CVS but need to confirm. The bottom line is that rxtx should not have used lock files on Mac. It was just ignorance of the system on my part. -- Trent Jarvi tjarvi at qbang.org From fabioanjos at gmail.com Thu Nov 1 12:35:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Thu, 1 Nov 2007 15:35:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Hi, I was using SerialEventListener in my project. But, as was said here, id doesnt work very well with virtual serial ports. So, I changed the strategy using the code posted here in this thread: try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > 0) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } The thing is that in my tests I could notice that in.read(buffer) never blocks. Even when there's nothing to read. Instead of blocking when there's nothing to read it returns 0. So, my questions are: 1. Am I doing something wrong? 2. If not, wouldnt this decrease performance? (the thread would be locked in a loop that does nothing.) 3. Is there a better way to do the job? Thanks in advance!! F?bio -------- On 10/31/07, Andre-John Mas wrote: > > > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/0aee59d0/attachment-0005.html From ajmas at sympatico.ca Thu Nov 1 16:07:55 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Nov 2007 18:07:55 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Message-ID: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From sarah_662005 at yahoo.com Thu Nov 1 17:10:05 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Thu, 1 Nov 2007 16:10:05 -0700 (PDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Message-ID: <351433.37166.qm@web55814.mail.re3.yahoo.com> Thank you very much for your help. Now the application works fine. the serialEvent gets triggered. Rxtx is cool! ----- Original Message ---- From: Andre-John Mas To: Sara Hugh ; RXTX Developers and Users Sent: Wednesday, October 31, 2007 9:55:45 AM Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered 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 __________________________________________________ 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/20071101/4a86bea6/attachment-0005.html From tjarvi at qbang.org Thu Nov 1 17:58:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 17:58:02 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx Message-ID: The rxtx.org site is primarily interested in the hobby aspects of rxtx. Obviously, there are some companies following the work too. These interests bring larger workflows and concerns about details hobby folks may not care about. They also bring many more users. I know the company I work for has a quality engineering effort going on which includes rxtx. While the server was down, I was contacted by another company that was missing the binaries for their testing. Several people have mentioned concerns about a stable release for like reasons. Would there be interest on the quality side of the coin to get together? It could be just sharing email's with each other or a seperate list for QE/QA. I can not say for sure, but we may be able to share some of our efforts/results that could help keep rxtx releases stable. -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Fri Nov 2 01:42:55 2007 From: scldad at sdc.com.au (Stephen Davies) Date: Fri, 2 Nov 2007 18:12:55 +1030 Subject: [Rxtx] Multiple modems Message-ID: <200711021812.56047.scldad@sdc.com.au> This may or may not be related to the Multiple Ports thread. I have an application which uses rxtx on Linux (via cron jobs) to connect multiple modems to remote sensing devices. The application works fine most of the time but occasionally fails to connect if two (or more) connection attempts happen at about the same time. When it fails, it looks as if it may get confused as to which port it is talking to. The app has a "base" component that looks for an available port, opens it and then creates an input thread and an output thread for the connection and data transfer. The "base" component uses this code: // loop round all known ports until one is available. Give up after three minutes Counter ptimeout = new Counter(); while(!portFound && ptimeout.elapsed() < 180000) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // special case. ttyS0 is not available to us on this server. if (!portId.isCurrentlyOwned() && !portId.getName().equals("/dev/ttyS0")) { gLog.debug(lognm + ": Found port " + portId.getName()); try { serialPort = (RXTXPort) portId.open("AguaModem", 10000); } catch (Exception e) { gLog.error(lognm + ": Port " + portId.getName() + " will not open."); gLog.error(e.getMessage()); continue; } AguaModem aguamodem = new AguaModem(); portFound = true; break; } gLog.debug(lognm + ": Port " + portId.getName() + " is busy"); } } } I am wondering about the isCurrentlyOwned method. Does this actually tell me whether a port is currently being used by another process? TIA, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From fabioanjos at gmail.com Fri Nov 2 04:59:58 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 07:59:58 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Message-ID: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/9009eb1d/attachment-0005.html From netbeans at gatworks.com Fri Nov 2 06:28:13 2007 From: netbeans at gatworks.com (U. George) Date: Fri, 02 Nov 2007 08:28:13 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <472B17DD.1050508@gatworks.com> It should normally block ( unless eof / event ) . so its a :{ whats the device ( to recreate if possible ) and how do u open. > My question is, is there a way to make in.read block the thead until > there's something to read? > From fabioanjos at gmail.com Fri Nov 2 06:34:46 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 09:34:46 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > On 11/1/07, Andre-John Mas wrote: > > > > Fabio, > > > > Turns out there was a small error in my example. The test should be: > > > > (numBytes = in.read(buffer)) > -1 > > > > This is because -1 indicates an end of file (end of data stream) > > > > Andre > > > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > > > Hi, > > > > > > I was using SerialEventListener in my project. But, as was said > > > here, id doesnt work very well with virtual serial ports. > > > So, I changed the strategy using the code posted here in this thread: > > > > > > try{ > > > in = port.getInputStream(); > > > out = port.getOutputStream(); > > > int numBytes = 0; > > > while(active){ > > > > > > byte[] buffer = new byte[10]; > > > > > > while ( (numBytes = in.read(buffer)) > 0) > > > { > > > String dataValue = new String(buffer,0,numBytes); > > > processInput(dataValue); > > > } > > > > > > if(numBytes==-1){ > > > break; > > > } > > > > > > Thread.sleep(50); > > > } > > > > > > }catch(IOException e){ > > > logger.info("falha de comunicacao "+ > > > getReceptor().getPort() ); > > > > > > }catch(InterruptedException e){ > > > logger.info ("Interrompendo leitura da porta "+ > > > getReceptor().getPort() ); > > > } > > > > > > The thing is that in my tests I could notice that in.read(buffer) > > > never blocks. Even when there's nothing to read. Instead of blocking > > > when there's nothing to read it returns 0. > > > > > > So, my questions are: > > > > > > 1. Am I doing something wrong? > > > 2. If not, wouldnt this decrease performance? (the thread would be > > > locked in a loop that does nothing.) > > > 3. Is there a better way to do the job? > > > > > > Thanks in advance!! > > > > > > F?bio > > > -------- > > > > > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > > 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 > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > > > > > -- > > > Atenciosamente, > > > F?bio Cristiano dos Anjos > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/5306c4b1/attachment-0005.html From nick.circelli at infrasafe.com Fri Nov 2 07:01:17 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Fri, 2 Nov 2007 08:01:17 -0500 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com><29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com><90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca><29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Message-ID: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> I'm pretty sure that not blocking has to do with you virtual ports. Cause it should block. Maybe you should try: while ((numBytes = in.available()) > 0) { If (numBytes > buffer.length) { numBytes = buffer.length; // in case you have buffer overflow } numBytes = in.read(buffer, 0 , numBytes)); String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } Also, just for optimization, I'd move that byte[] buffer = new byte[10]; out of the while since you don't need to reallocate it every iteration. ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of F?bio Cristiano dos Anjos Sent: Friday, November 02, 2007 8:35 AM To: RXTX Developers and Users Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream (); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas < ajmas at sympatico.ca > wrote: Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info ("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Atenciosamente, F?bio Cristiano dos Anjos -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/4de7f6a3/attachment-0005.html From fabioanjos at gmail.com Fri Nov 2 07:36:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 10:36:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> Message-ID: <29788b250711020636q1588c88fgaa5e27f5504164fb@mail.gmail.com> Hi Nick, Actually, it doesnt block for physical ports too. And, the method avaiable does not block either, so when there's nothing avaiable the loop ends and the thread stops lintening to the port. But I did some more test with serialEventListener, and now its working. I realy dont know what I've done to get it working. I just start woking as soon as I decided to test it again. It was said here that serialEventListener is not reliable for virtual serial ports. Is there another way to read it, without compromising performance? Tanks again!! F?bio ------- On 11/2/07, Nick Circelli wrote: > > I'm pretty sure that not blocking has to do with you virtual ports. > Cause it should block. > > Maybe you should try: > > > > while ((numBytes = in.available()) > 0) > > { > > If (numBytes > buffer.length) { > > numBytes = buffer.length; // in case you have buffer overflow > > } > > numBytes = in.read(buffer, 0 , numBytes)); > > String dataValue = new String(buffer,0,numBytes,"ASCII"); > > processInput(dataValue); > > } > > > > Also, just for optimization, I'd move that byte[] buffer = new > byte[10]; > > out of the while since you don't need to reallocate it every iteration. > > > ------------------------------ > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On Behalf > Of *F?bio Cristiano dos Anjos > *Sent:* Friday, November 02, 2007 8:35 AM > *To:* RXTX Developers and Users > *Subject:* Re: [Rxtx] serialEvent(SerialPortEvent event) never be > triggered > > > > Hi, > > I think i missunderstand something here. > The code you post here was meant to be used inside serialEvent method, > right? > > The think is, that i cannot user SerialEventListener to read serial ports, > because i need to read virual serial ports and id does not behaves well, as > said here before. serialEvent is never triggered. > > So what I quit using SerialEventListener and created a thread to listen to > the port: > > public void run(){ > try{ > in = port.getInputStream(); > out = port.getOutputStream (); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new > String(buffer,0,numBytes,"ASCII"); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ getReceptor().getPort() > ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > } > > > So, the problem is that in.read(buffer) always returns 0 when there is > nothing to read, instead of blocking the flow, and the thread becames locked > in the loop. > > I hope you can help me solve this. > > Thanks in advance! > > F?bio > -------- > > On 11/2/07, *F?bio Cristiano dos Anjos* wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > > > On 11/1/07, *Andre-John Mas* < ajmas at sympatico.ca> wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info ("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/571df6ea/attachment-0004.html From tjarvi at qbang.org Fri Nov 2 08:32:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Nov 2007 08:32:15 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: References: Message-ID: On Fri, 2 Nov 2007, Greg Johnson wrote: > Hi Trent, folks, > Having a single rxtx that is suitable for commercial uses and hobbyists both > would be a great idea? Perhaps it would be worth submitting rxtx as a > proposal to Codehaus - they not only provide excellent tools (Jira (bug > tracker), Confluence (wiki)) but also support build management ( > maestro, continuum, bamboo). Relying on your personal machine (btw, frii.com > / rxtx.org is down again?) seems like a burden you shouldn't have to shoulder > alone. Hi Greg, There may be a little confusion here. There is no need to have two seperate rxtx releases. What I'm trying to encourage is a discussion between some of the people responsible for making sure rxtx does not break their products each release. Usually these people are interested in testing a set of functionality their product depends upon. They do not work with rxtx code but rather traps to catch when rxtx developers break something. This goes on all the time in isolated labs. There are many services that offer to do various pieces of a project for you if you... Anyone is free to do the 'if you' portion with rxtx and see how it goes. I'm actually interested in doing less of that than more. The rxtx.org work I do just happens to overlap with other things I do for personal/family use. The reason I suggest the amazon solution is that anyone can take full control of the environment for a day and it costs less than a package of gum without causing harm to what anyone else is doing. I assume the down question was with respect to a mod_security setting that has been resolved. If not, please post a url to the problem. -- Trent Jarvi tjarvi at qbang.org From nsayer at kfu.com Sat Nov 3 20:17:49 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 19:17:49 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? Message-ID: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Has anyone got RXTX working with an app under Leopard? My app hangs on port open (it works fine with Tiger). The relevant thread looks like this in the activity monitor: 1536 JVM_InvokeMethod 1536 0x48ccd0 1536 0x46f8a0 1536 0x4c3ff4 1536 0x4c4284 1536 0x357d160 1536 0x357faac 1536 Java_gnu_io_RXTXPort_open 1536 open $NOCANCEL$UNIX2003 1536 open $NOCANCEL$UNIX2003 From ajmas at sympatico.ca Sat Nov 3 22:02:04 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 00:02:04 -0400 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> RXTX works for me with Leopard. I am currently using it communicate with a Bluetooth GPS. What computer and device are you trying to use? Is the driver for your serial device compatible with MacOS X 10.5? Andre On 3-Nov-07, at 22:17 , Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From nsayer at kfu.com Sat Nov 3 22:17:47 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 21:17:47 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> Message-ID: <1720F723-3643-438C-B3AB-E09A67536977@kfu.com> On Nov 3, 2007, at 9:02 PM, Andre-John Mas wrote: > RXTX works for me with Leopard. I am currently using it communicate > with a Bluetooth GPS. > > What computer and device are you trying to use? Is the driver for > your serial device compatible with MacOS X 10.5? An Intel mac mini The FTDI USB serial driver an XMPCR, which is just a fancy serial controlled radio and an FTDI usb-to-serial chip I've successfully used the FTDI driver with another FTDI device in another context. > > > Andre > > On 3-Nov-07, at 22:17 , Nick Sayer wrote: > >> Has anyone got RXTX working with an app under Leopard? >> >> My app hangs on port open (it works fine with Tiger). The relevant >> thread looks like this in the activity monitor: >> >> 1536 JVM_InvokeMethod >> 1536 0x48ccd0 >> 1536 0x46f8a0 >> 1536 0x4c3ff4 >> 1536 0x4c4284 >> 1536 0x357d160 >> 1536 0x357faac >> 1536 >> Java_gnu_io_RXTXPort_open >> 1536 open >> $NOCANCEL$UNIX2003 >> 1536 open >> $NOCANCEL$UNIX2003 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From racecar at gmail.com Sat Nov 3 22:25:53 2007 From: racecar at gmail.com (Kevin Mateo Lim) Date: Sat, 3 Nov 2007 21:25:53 -0700 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: Message-ID: I am alternating between two errors. After i run the macosx_setup.command, "everyone" is set to Read only in /var/lock. I notice in the terminal that the group for these perms is _uucp, not uucp. In that state, I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 check_group_uucp(): error testing lock file creation Error details:Permission deniedcheck_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException : Error inside Serial.() at processing.serial.Serial.errorMessage(Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.( Serial.java:102) at Temporary_829_3245.setup(Temporary_829_3245.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java :690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) Then, I hand edit the "everyone" permissions for /var/lock/ to Read and Write (note /var/spool/uucp is Read/Write in all cases, and doesn't change). I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX uucp_lock() /var/lock/LK.003.009.000 is there gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException: Error inside Serial.() at processing.serial.Serial.errorMessage (Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.(Serial.java:102) at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java:690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) See here: http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071103/f1a2c467/attachment-0003.html From greg.johnson at manchester.ac.uk Sun Nov 4 02:31:13 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sun, 4 Nov 2007 10:31:13 +0100 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <28B5E0A0-0802-4C74-AC21-87ED35F3B9A2@manchester.ac.uk> Hi Nick, I also had problems initially with Leopard, but it was resolved by reinstalling the serial USB driver (FTDI in my case). The symptoms were a non-detection of any ports (but I twigged when I tried ZTerm and it had the same problem). Good luck! Cheers, greg PS I did a "Archive and install" which may be the reason my FTDI driver had disappeared - I don't think the driver has changed for 10.5 ------------------------------------------------------------------------- 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 4 Nov 2007, at 03:17, Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Sun Nov 4 13:01:12 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 15:01:12 -0500 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: Message-ID: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Hi, You will need to get the 2.1-8 code from CVS. See the FAQ for more information: http://rxtx.qbang.org/wiki/index.php/FAQ Andre On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > I am alternating between two errors. > > After i run the macosx_setup.command, "everyone" is set to Read only > in /var/lock. I notice in the terminal that the group for these > perms is _uucp, not uucp. > > In that state, I get this error: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > check_group_uucp(): error testing lock file creation Error > details:Permission deniedcheck_lock_status: No permission to create > lock file. > please see: How can I use Lock Files with rxtx? in INSTALL > gnu.io.PortInUseException: Unknown Application > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > java.lang.RuntimeException : Error inside Serial.() > > at processing.serial.Serial.errorMessage(Serial.java:583) > > at processing.serial.Serial.(Serial.java:148) > > at processing.serial.Serial.( Serial.java:102) > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > at processing.core.PApplet.run(PApplet.java:1556) > > at java.lang.Thread.run(Thread.java:613) > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > and Write (note /var/spool/uucp is Read/Write in all cases, and > doesn't change). I get this error: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > gnu.io.PortInUseException: Unknown Application > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > java.lang.RuntimeException: Error inside Serial.() > > at processing.serial.Serial.errorMessage (Serial.java:583) > > at processing.serial.Serial.(Serial.java:148) > > at processing.serial.Serial.(Serial.java:102) > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > at processing.core.PApplet.run(PApplet.java:1556) > > at java.lang.Thread.run(Thread.java:613) > > See here: > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From netbeans at gatworks.com Sun Nov 4 14:33:35 2007 From: netbeans at gatworks.com (U. George) Date: Sun, 04 Nov 2007 16:33:35 -0500 Subject: [Rxtx] #ifndef TIOCSERGETLSR Message-ID: <472E3AAF.7050709@gatworks.com> For Linux, it seems that you need the code for both *having* a TIOCSERGETLSR, and *not having* a TIOCSERGETLSR. Maybe the ioctl exists system wide, but not necessarily for the device driver itself ( always returns -1 ) . Are there systems that have a *functioning* TIOCSERGETLSR for all their devices? Then this would be the case where the "#ifndef TIOCSERGETLSR" directive could be useful is eliminating the unnecessary code and tests. And for those systems that dont have a TIOCSERGETLSR, then the code for TIOCSERGETLSR can be eliminated. It would be a simple case to have, as a foundation, all the code to simulate the missing TIOCSERGETLSR ioctl. If the system does have the ioctl, then that code can be ifdef'd in, and co-exist with the functionality of the code that simulates the missing TIOCSERGETLSR ioctl. From racecar at gmail.com Sun Nov 4 17:30:19 2007 From: racecar at gmail.com (Kevin Mateo Lim) Date: Sun, 4 Nov 2007 17:30:19 -0700 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: the README.OSX reads: Put libSerial.jnilib in the directory of the application (the JavaVM will find it there). Add RXTXComm.jar to the application classpath or include the classes in the application jar. (Some applications already include the RXTX classes in their application jar, in which case only the file libSerial.jnilib is required). I can't find libSerial.jnilib I put librxtxSerial.jnilib into my Processing /libraries/serial/library/ directory. Yet it still sees the old version: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 On 11/4/07, Andre-John Mas wrote: > > Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > 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/20071104/c0a83f91/attachment-0002.html From ajmas at sympatico.ca Sun Nov 4 17:41:47 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 19:41:47 -0500 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> If you are wanting it to be available for all applications, - for all users: /Library/Java/Extensions - for your user: ~/Library/Java/Extensions Or just for your application, then it should be in the same directory from which yo are launching your application. If you are getting the 2.1-8 source, then the library built is called: librxtxSerial.jnilib despite what the docs say. Andre On 4-Nov-07, at 19:30 , Kevin Mateo Lim wrote: > > the README.OSX reads: > Put > libSerial.jnilib > in the directory of the application (the JavaVM will find it there). > Add > RXTXComm.jar > to the application classpath or include the classes in the > application jar. > (Some applications already include the RXTX classes in their > application jar, > in which case only the file libSerial.jnilib is required). > > > I can't find libSerial.jnilib > I put librxtxSerial.jnilib into my Processing /libraries/serial/ > library/ directory. > > Yet it still sees the old version: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > On 11/4/07, Andre-John Mas wrote: Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial .(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay (PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > From bschlining at gmail.com Sun Nov 4 19:46:23 2007 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 4 Nov 2007 18:46:23 -0800 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> Message-ID: > > Or just for your application, then it should be in the same directory > from which yo are launching your application. Just wanted to add one more way of specifying the native lib location... If you don't want to define it globally by putting it in /Library/Java/Extensions (and you don't, it's a very very bad practice) you can also specify the location of the native library when starting the JVM by specifying the 'java.library.path' property. For example: java -Djava.library.path=/Path/To/Directory/With/RXTX/Library YourMainClass -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071104/c5af6980/attachment-0001.html From greg.johnson at manchester.ac.uk Mon Nov 5 01:39:02 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Mon, 5 Nov 2007 09:39:02 +0100 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: The 2.1-8 code reports 2.1-7, hence your (and my) confusion. But as long as you've removed all traces of the old library, it really _is_ 2.1-8. And if you specify the library path to the VM, don't make my mistake (on OSX at least) - you need to respecify the entire library path it had by default, as the command line argument replaces the path, rather than appending to it. 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 5 Nov 2007, at 01:30, Kevin Mateo Lim wrote: > > the README.OSX reads: > Put > libSerial.jnilib > in the directory of the application (the JavaVM will find it there). > Add > RXTXComm.jar > to the application classpath or include the classes in the > application jar. > (Some applications already include the RXTX classes in their > application jar, > in which case only the file libSerial.jnilib is required). > > > I can't find libSerial.jnilib > I put librxtxSerial.jnilib into my Processing /libraries/serial/ > library/ directory. > > Yet it still sees the old version: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > On 11/4/07, Andre-John Mas wrote: > Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial .(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay (PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > 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 HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071105/7f50506d/attachment-0001.html From cyrille.dumont at tatexpress.fr Mon Nov 5 05:46:03 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 05 Nov 2007 13:46:03 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: References: <472727F1.1000704@tatexpress.fr> Message-ID: <472F108B.2090101@tatexpress.fr> Thanks a lot for your solution ... but I'm not a expert in JAVA ... (sorry) For the moment I've this function : """ public void serialEvent(SerialPortEvent e) { StringBuffer inputBuffer = new StringBuffer(); int newData = 0; switch (e.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } //-- Manag. Data from Scanner this.MngDataScanner(inputBuffer.toString()); break; case SerialPortEvent.BI:; //-- Break Received } } """ How can I do what you write ? ( maybe a simple ex ? ) PS : I don't know the PDF417 size (could be, for example, 338 char, or 500 ... ; what I know is that it can't be more than 800 char) Thanks in advance. Best regards. Trent Jarvi a ?crit : > 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 Martin.Oberhuber at windriver.com Mon Nov 5 08:47:50 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 5 Nov 2007 16:47:50 +0100 Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> Hi Trent, are the interestes of hobbyists really so different from commercial ones? Both should be interested in high quality and innovation the like. I haven't seen too many Open Source projects from the "inside" but those that I have seen did not have separate mailing lists for quality/testing/qa versus innovation/development. What I have seen with the Open Source projects that one would call "successful" is a good deal of process around automated builds, automated unit tests, predictable release dates and milestones, and policies around commiting/contributing/reviewing changes. I think that all of these benefit commercial users and hobbyists the like. If you were just asking about who's interested in discussing changes to foster more quality, count me in. I'm just not sure whether discussing these on a separate mailing list or other channel is the right thing to do. Cheers, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From keithvz at verizon.net Thu Nov 1 08:08:58 2007 From: keithvz at verizon.net (Keith) Date: Thu, 01 Nov 2007 10:08:58 -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: <4729DDFA.7080206@verizon.net> Trent Jarvi wrote: > 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? Well, I honestly don't know how all this fits together. I think it's just a matter of enabling the right flow control option within the standard serial framework to tell the device driver, "HEY START USING DTR/DSR FOR FLOW CONTROL." If what UGeorge said,(about that type of nitty-gritty lead control being done within the device driver), is true, then this confirms my suspicion. I tried narrowing down within the Linux drivers what you are looking for, but I can't entirely tell wth I'm looking at. (virtual com port drivers -- they are included compiled by default with Ubuntu, source included) http://www.ftdichip.com/Drivers/VCP/Linux/ftdi_sio.tar.gz Hahahaa, they make a reference to DTR flow control being supported but say (UGH) in parenthesis. You can also use their direct device driver library on Ubuntu -- libftd2xx.so.0.4.13. No source code. http://www.ftdichip.com/Drivers/D2XX/Linux/libftd2xx0.4.13.tar.gz In that case, you make a call to their FT_SetFlowControl() function. FT_STATUS FT_SetFlowControl (FT_HANDLE ftHandle, USHORT usFlowControl, UCHAR uXon,UCHAR uXoff) Parameters ftHandle Handle of the device. usFlowControl Must be one of FT_FLOW_NONE, FT_FLOW_RTS_CTS, ****FT_FLOW_DTR_DSR**** or FT_FLOW_XON_XOFF. uXon Character used to signal Xon. Only used if flow control is FT_FLOW_XON_XOFF. uXoff Character used to signal Xoff. Only used if flow control is FT_FLOW_XON_XOFF. This is from their programming guide http://www.ftdichip.com/Documents/ProgramGuides/D2XXPG34.pdf I actually want to take this a step further and say that I think the flow control is actually handled right on the device itself in hardware/firmware. It's enabled through the device driver, but I think the maintaining of buffers, asserting/deasserting of leads, etc is handled by the device. For the time being, I've switched to jd2xx, https://jd2xx.dev.java.net/ and http://bleyer.org/jd2xx/ These are Java wrappers for the device driver libraries. It allows almost direct access to the well-documented device drivers from Java. I hope this helps Keith From tjarvi at qbang.org Thu Nov 1 11:09:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:09:51 -0600 (MDT) 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: Hi Martin, What I usually have done is allow changes that do not impact working software including changes to methods not documented in CommAPI (which remain undocumented in rxtx) and fixes to known problems in the documented portions. That way if you use the documented API, the releases should only become better with time. If you use the undocumented portions, the behavior is not as predictable but open for improvement. On Wed, 31 Oct 2007, 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 >> > From tjarvi at qbang.org Thu Nov 1 11:15:52 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:15:52 -0600 (MDT) 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: I too use rxtx in commercial products. The problem I've been trying to address while bringing the server back was how to make it possible for hobby folks to build the same software as companies so we can move rxtx along a little faster. Exposing internal tools is not an option at this time, the public rxtx builds have been done on my home machine which has drives hanging out of it all over the place dying one at a time. This isn't maintainable. I'm currently looking at the possibility of making an S3 image available on Amazon's EC. These are machines you can rent for ~10 cents an hour which is more than enough to build rxtx. The S3 image is not changed when people use it so everyone has the same starting point. With this, we could all build rxtx for ~20 platforms for a small price and eliminate tool issues. On Wed, 31 Oct 2007, Greg Johnson wrote: > 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 tjarvi at qbang.org Thu Nov 1 11:19:55 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:19:55 -0600 (MDT) 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: On Wed, 31 Oct 2007, 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. I was helping Dmitry do the Mac OS X port without access to a machine when we put that in. In the archives there is information (easily found with google on Apple's site) that describes how their API (and others) can determine if a port is used and ignore it. I think these changes are in CVS but need to confirm. The bottom line is that rxtx should not have used lock files on Mac. It was just ignorance of the system on my part. -- Trent Jarvi tjarvi at qbang.org From fabioanjos at gmail.com Thu Nov 1 12:35:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Thu, 1 Nov 2007 15:35:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Hi, I was using SerialEventListener in my project. But, as was said here, id doesnt work very well with virtual serial ports. So, I changed the strategy using the code posted here in this thread: try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > 0) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } The thing is that in my tests I could notice that in.read(buffer) never blocks. Even when there's nothing to read. Instead of blocking when there's nothing to read it returns 0. So, my questions are: 1. Am I doing something wrong? 2. If not, wouldnt this decrease performance? (the thread would be locked in a loop that does nothing.) 3. Is there a better way to do the job? Thanks in advance!! F?bio -------- On 10/31/07, Andre-John Mas wrote: > > > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/0aee59d0/attachment-0006.html From ajmas at sympatico.ca Thu Nov 1 16:07:55 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Nov 2007 18:07:55 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Message-ID: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From sarah_662005 at yahoo.com Thu Nov 1 17:10:05 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Thu, 1 Nov 2007 16:10:05 -0700 (PDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Message-ID: <351433.37166.qm@web55814.mail.re3.yahoo.com> Thank you very much for your help. Now the application works fine. the serialEvent gets triggered. Rxtx is cool! ----- Original Message ---- From: Andre-John Mas To: Sara Hugh ; RXTX Developers and Users Sent: Wednesday, October 31, 2007 9:55:45 AM Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered 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 __________________________________________________ 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/20071101/4a86bea6/attachment-0006.html From tjarvi at qbang.org Thu Nov 1 17:58:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 17:58:02 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx Message-ID: The rxtx.org site is primarily interested in the hobby aspects of rxtx. Obviously, there are some companies following the work too. These interests bring larger workflows and concerns about details hobby folks may not care about. They also bring many more users. I know the company I work for has a quality engineering effort going on which includes rxtx. While the server was down, I was contacted by another company that was missing the binaries for their testing. Several people have mentioned concerns about a stable release for like reasons. Would there be interest on the quality side of the coin to get together? It could be just sharing email's with each other or a seperate list for QE/QA. I can not say for sure, but we may be able to share some of our efforts/results that could help keep rxtx releases stable. -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Fri Nov 2 01:42:55 2007 From: scldad at sdc.com.au (Stephen Davies) Date: Fri, 2 Nov 2007 18:12:55 +1030 Subject: [Rxtx] Multiple modems Message-ID: <200711021812.56047.scldad@sdc.com.au> This may or may not be related to the Multiple Ports thread. I have an application which uses rxtx on Linux (via cron jobs) to connect multiple modems to remote sensing devices. The application works fine most of the time but occasionally fails to connect if two (or more) connection attempts happen at about the same time. When it fails, it looks as if it may get confused as to which port it is talking to. The app has a "base" component that looks for an available port, opens it and then creates an input thread and an output thread for the connection and data transfer. The "base" component uses this code: // loop round all known ports until one is available. Give up after three minutes Counter ptimeout = new Counter(); while(!portFound && ptimeout.elapsed() < 180000) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // special case. ttyS0 is not available to us on this server. if (!portId.isCurrentlyOwned() && !portId.getName().equals("/dev/ttyS0")) { gLog.debug(lognm + ": Found port " + portId.getName()); try { serialPort = (RXTXPort) portId.open("AguaModem", 10000); } catch (Exception e) { gLog.error(lognm + ": Port " + portId.getName() + " will not open."); gLog.error(e.getMessage()); continue; } AguaModem aguamodem = new AguaModem(); portFound = true; break; } gLog.debug(lognm + ": Port " + portId.getName() + " is busy"); } } } I am wondering about the isCurrentlyOwned method. Does this actually tell me whether a port is currently being used by another process? TIA, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From fabioanjos at gmail.com Fri Nov 2 04:59:58 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 07:59:58 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Message-ID: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/9009eb1d/attachment-0006.html From netbeans at gatworks.com Fri Nov 2 06:28:13 2007 From: netbeans at gatworks.com (U. George) Date: Fri, 02 Nov 2007 08:28:13 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <472B17DD.1050508@gatworks.com> It should normally block ( unless eof / event ) . so its a :{ whats the device ( to recreate if possible ) and how do u open. > My question is, is there a way to make in.read block the thead until > there's something to read? > From fabioanjos at gmail.com Fri Nov 2 06:34:46 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 09:34:46 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > On 11/1/07, Andre-John Mas wrote: > > > > Fabio, > > > > Turns out there was a small error in my example. The test should be: > > > > (numBytes = in.read(buffer)) > -1 > > > > This is because -1 indicates an end of file (end of data stream) > > > > Andre > > > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > > > Hi, > > > > > > I was using SerialEventListener in my project. But, as was said > > > here, id doesnt work very well with virtual serial ports. > > > So, I changed the strategy using the code posted here in this thread: > > > > > > try{ > > > in = port.getInputStream(); > > > out = port.getOutputStream(); > > > int numBytes = 0; > > > while(active){ > > > > > > byte[] buffer = new byte[10]; > > > > > > while ( (numBytes = in.read(buffer)) > 0) > > > { > > > String dataValue = new String(buffer,0,numBytes); > > > processInput(dataValue); > > > } > > > > > > if(numBytes==-1){ > > > break; > > > } > > > > > > Thread.sleep(50); > > > } > > > > > > }catch(IOException e){ > > > logger.info("falha de comunicacao "+ > > > getReceptor().getPort() ); > > > > > > }catch(InterruptedException e){ > > > logger.info ("Interrompendo leitura da porta "+ > > > getReceptor().getPort() ); > > > } > > > > > > The thing is that in my tests I could notice that in.read(buffer) > > > never blocks. Even when there's nothing to read. Instead of blocking > > > when there's nothing to read it returns 0. > > > > > > So, my questions are: > > > > > > 1. Am I doing something wrong? > > > 2. If not, wouldnt this decrease performance? (the thread would be > > > locked in a loop that does nothing.) > > > 3. Is there a better way to do the job? > > > > > > Thanks in advance!! > > > > > > F?bio > > > -------- > > > > > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > > 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 > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > > > > > -- > > > Atenciosamente, > > > F?bio Cristiano dos Anjos > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/5306c4b1/attachment-0006.html From nick.circelli at infrasafe.com Fri Nov 2 07:01:17 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Fri, 2 Nov 2007 08:01:17 -0500 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com><29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com><90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca><29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Message-ID: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> I'm pretty sure that not blocking has to do with you virtual ports. Cause it should block. Maybe you should try: while ((numBytes = in.available()) > 0) { If (numBytes > buffer.length) { numBytes = buffer.length; // in case you have buffer overflow } numBytes = in.read(buffer, 0 , numBytes)); String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } Also, just for optimization, I'd move that byte[] buffer = new byte[10]; out of the while since you don't need to reallocate it every iteration. ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of F?bio Cristiano dos Anjos Sent: Friday, November 02, 2007 8:35 AM To: RXTX Developers and Users Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream (); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas < ajmas at sympatico.ca > wrote: Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info ("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Atenciosamente, F?bio Cristiano dos Anjos -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/4de7f6a3/attachment-0006.html From fabioanjos at gmail.com Fri Nov 2 07:36:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 10:36:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> Message-ID: <29788b250711020636q1588c88fgaa5e27f5504164fb@mail.gmail.com> Hi Nick, Actually, it doesnt block for physical ports too. And, the method avaiable does not block either, so when there's nothing avaiable the loop ends and the thread stops lintening to the port. But I did some more test with serialEventListener, and now its working. I realy dont know what I've done to get it working. I just start woking as soon as I decided to test it again. It was said here that serialEventListener is not reliable for virtual serial ports. Is there another way to read it, without compromising performance? Tanks again!! F?bio ------- On 11/2/07, Nick Circelli wrote: > > I'm pretty sure that not blocking has to do with you virtual ports. > Cause it should block. > > Maybe you should try: > > > > while ((numBytes = in.available()) > 0) > > { > > If (numBytes > buffer.length) { > > numBytes = buffer.length; // in case you have buffer overflow > > } > > numBytes = in.read(buffer, 0 , numBytes)); > > String dataValue = new String(buffer,0,numBytes,"ASCII"); > > processInput(dataValue); > > } > > > > Also, just for optimization, I'd move that byte[] buffer = new > byte[10]; > > out of the while since you don't need to reallocate it every iteration. > > > ------------------------------ > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On Behalf > Of *F?bio Cristiano dos Anjos > *Sent:* Friday, November 02, 2007 8:35 AM > *To:* RXTX Developers and Users > *Subject:* Re: [Rxtx] serialEvent(SerialPortEvent event) never be > triggered > > > > Hi, > > I think i missunderstand something here. > The code you post here was meant to be used inside serialEvent method, > right? > > The think is, that i cannot user SerialEventListener to read serial ports, > because i need to read virual serial ports and id does not behaves well, as > said here before. serialEvent is never triggered. > > So what I quit using SerialEventListener and created a thread to listen to > the port: > > public void run(){ > try{ > in = port.getInputStream(); > out = port.getOutputStream (); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new > String(buffer,0,numBytes,"ASCII"); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ getReceptor().getPort() > ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > } > > > So, the problem is that in.read(buffer) always returns 0 when there is > nothing to read, instead of blocking the flow, and the thread becames locked > in the loop. > > I hope you can help me solve this. > > Thanks in advance! > > F?bio > -------- > > On 11/2/07, *F?bio Cristiano dos Anjos* wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > > > On 11/1/07, *Andre-John Mas* < ajmas at sympatico.ca> wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info ("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/571df6ea/attachment-0005.html From tjarvi at qbang.org Fri Nov 2 08:32:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Nov 2007 08:32:15 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: References: Message-ID: On Fri, 2 Nov 2007, Greg Johnson wrote: > Hi Trent, folks, > Having a single rxtx that is suitable for commercial uses and hobbyists both > would be a great idea? Perhaps it would be worth submitting rxtx as a > proposal to Codehaus - they not only provide excellent tools (Jira (bug > tracker), Confluence (wiki)) but also support build management ( > maestro, continuum, bamboo). Relying on your personal machine (btw, frii.com > / rxtx.org is down again?) seems like a burden you shouldn't have to shoulder > alone. Hi Greg, There may be a little confusion here. There is no need to have two seperate rxtx releases. What I'm trying to encourage is a discussion between some of the people responsible for making sure rxtx does not break their products each release. Usually these people are interested in testing a set of functionality their product depends upon. They do not work with rxtx code but rather traps to catch when rxtx developers break something. This goes on all the time in isolated labs. There are many services that offer to do various pieces of a project for you if you... Anyone is free to do the 'if you' portion with rxtx and see how it goes. I'm actually interested in doing less of that than more. The rxtx.org work I do just happens to overlap with other things I do for personal/family use. The reason I suggest the amazon solution is that anyone can take full control of the environment for a day and it costs less than a package of gum without causing harm to what anyone else is doing. I assume the down question was with respect to a mod_security setting that has been resolved. If not, please post a url to the problem. -- Trent Jarvi tjarvi at qbang.org From nsayer at kfu.com Sat Nov 3 20:17:49 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 19:17:49 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? Message-ID: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Has anyone got RXTX working with an app under Leopard? My app hangs on port open (it works fine with Tiger). The relevant thread looks like this in the activity monitor: 1536 JVM_InvokeMethod 1536 0x48ccd0 1536 0x46f8a0 1536 0x4c3ff4 1536 0x4c4284 1536 0x357d160 1536 0x357faac 1536 Java_gnu_io_RXTXPort_open 1536 open $NOCANCEL$UNIX2003 1536 open $NOCANCEL$UNIX2003 From ajmas at sympatico.ca Sat Nov 3 22:02:04 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 00:02:04 -0400 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> RXTX works for me with Leopard. I am currently using it communicate with a Bluetooth GPS. What computer and device are you trying to use? Is the driver for your serial device compatible with MacOS X 10.5? Andre On 3-Nov-07, at 22:17 , Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From nsayer at kfu.com Sat Nov 3 22:17:47 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 21:17:47 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> Message-ID: <1720F723-3643-438C-B3AB-E09A67536977@kfu.com> On Nov 3, 2007, at 9:02 PM, Andre-John Mas wrote: > RXTX works for me with Leopard. I am currently using it communicate > with a Bluetooth GPS. > > What computer and device are you trying to use? Is the driver for > your serial device compatible with MacOS X 10.5? An Intel mac mini The FTDI USB serial driver an XMPCR, which is just a fancy serial controlled radio and an FTDI usb-to-serial chip I've successfully used the FTDI driver with another FTDI device in another context. > > > Andre > > On 3-Nov-07, at 22:17 , Nick Sayer wrote: > >> Has anyone got RXTX working with an app under Leopard? >> >> My app hangs on port open (it works fine with Tiger). The relevant >> thread looks like this in the activity monitor: >> >> 1536 JVM_InvokeMethod >> 1536 0x48ccd0 >> 1536 0x46f8a0 >> 1536 0x4c3ff4 >> 1536 0x4c4284 >> 1536 0x357d160 >> 1536 0x357faac >> 1536 >> Java_gnu_io_RXTXPort_open >> 1536 open >> $NOCANCEL$UNIX2003 >> 1536 open >> $NOCANCEL$UNIX2003 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From racecar at gmail.com Sat Nov 3 22:25:53 2007 From: racecar at gmail.com (Kevin Mateo Lim) Date: Sat, 3 Nov 2007 21:25:53 -0700 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: Message-ID: I am alternating between two errors. After i run the macosx_setup.command, "everyone" is set to Read only in /var/lock. I notice in the terminal that the group for these perms is _uucp, not uucp. In that state, I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 check_group_uucp(): error testing lock file creation Error details:Permission deniedcheck_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException : Error inside Serial.() at processing.serial.Serial.errorMessage(Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.( Serial.java:102) at Temporary_829_3245.setup(Temporary_829_3245.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java :690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) Then, I hand edit the "everyone" permissions for /var/lock/ to Read and Write (note /var/spool/uucp is Read/Write in all cases, and doesn't change). I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX uucp_lock() /var/lock/LK.003.009.000 is there gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException: Error inside Serial.() at processing.serial.Serial.errorMessage (Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.(Serial.java:102) at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java:690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) See here: http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071103/f1a2c467/attachment-0004.html From greg.johnson at manchester.ac.uk Sun Nov 4 02:31:13 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sun, 4 Nov 2007 10:31:13 +0100 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <28B5E0A0-0802-4C74-AC21-87ED35F3B9A2@manchester.ac.uk> Hi Nick, I also had problems initially with Leopard, but it was resolved by reinstalling the serial USB driver (FTDI in my case). The symptoms were a non-detection of any ports (but I twigged when I tried ZTerm and it had the same problem). Good luck! Cheers, greg PS I did a "Archive and install" which may be the reason my FTDI driver had disappeared - I don't think the driver has changed for 10.5 ------------------------------------------------------------------------- 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 4 Nov 2007, at 03:17, Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Sun Nov 4 13:01:12 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 15:01:12 -0500 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: Message-ID: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Hi, You will need to get the 2.1-8 code from CVS. See the FAQ for more information: http://rxtx.qbang.org/wiki/index.php/FAQ Andre On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > I am alternating between two errors. > > After i run the macosx_setup.command, "everyone" is set to Read only > in /var/lock. I notice in the terminal that the group for these > perms is _uucp, not uucp. > > In that state, I get this error: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > check_group_uucp(): error testing lock file creation Error > details:Permission deniedcheck_lock_status: No permission to create > lock file. > please see: How can I use Lock Files with rxtx? in INSTALL > gnu.io.PortInUseException: Unknown Application > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > java.lang.RuntimeException : Error inside Serial.() > > at processing.serial.Serial.errorMessage(Serial.java:583) > > at processing.serial.Serial.(Serial.java:148) > > at processing.serial.Serial.( Serial.java:102) > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > at processing.core.PApplet.run(PApplet.java:1556) > > at java.lang.Thread.run(Thread.java:613) > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > and Write (note /var/spool/uucp is Read/Write in all cases, and > doesn't change). I get this error: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > gnu.io.PortInUseException: Unknown Application > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > java.lang.RuntimeException: Error inside Serial.() > > at processing.serial.Serial.errorMessage (Serial.java:583) > > at processing.serial.Serial.(Serial.java:148) > > at processing.serial.Serial.(Serial.java:102) > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > at processing.core.PApplet.run(PApplet.java:1556) > > at java.lang.Thread.run(Thread.java:613) > > See here: > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From netbeans at gatworks.com Sun Nov 4 14:33:35 2007 From: netbeans at gatworks.com (U. George) Date: Sun, 04 Nov 2007 16:33:35 -0500 Subject: [Rxtx] #ifndef TIOCSERGETLSR Message-ID: <472E3AAF.7050709@gatworks.com> For Linux, it seems that you need the code for both *having* a TIOCSERGETLSR, and *not having* a TIOCSERGETLSR. Maybe the ioctl exists system wide, but not necessarily for the device driver itself ( always returns -1 ) . Are there systems that have a *functioning* TIOCSERGETLSR for all their devices? Then this would be the case where the "#ifndef TIOCSERGETLSR" directive could be useful is eliminating the unnecessary code and tests. And for those systems that dont have a TIOCSERGETLSR, then the code for TIOCSERGETLSR can be eliminated. It would be a simple case to have, as a foundation, all the code to simulate the missing TIOCSERGETLSR ioctl. If the system does have the ioctl, then that code can be ifdef'd in, and co-exist with the functionality of the code that simulates the missing TIOCSERGETLSR ioctl. From racecar at gmail.com Sun Nov 4 17:30:19 2007 From: racecar at gmail.com (Kevin Mateo Lim) Date: Sun, 4 Nov 2007 17:30:19 -0700 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: the README.OSX reads: Put libSerial.jnilib in the directory of the application (the JavaVM will find it there). Add RXTXComm.jar to the application classpath or include the classes in the application jar. (Some applications already include the RXTX classes in their application jar, in which case only the file libSerial.jnilib is required). I can't find libSerial.jnilib I put librxtxSerial.jnilib into my Processing /libraries/serial/library/ directory. Yet it still sees the old version: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 On 11/4/07, Andre-John Mas wrote: > > Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > 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/20071104/c0a83f91/attachment-0003.html From ajmas at sympatico.ca Sun Nov 4 17:41:47 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 19:41:47 -0500 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> If you are wanting it to be available for all applications, - for all users: /Library/Java/Extensions - for your user: ~/Library/Java/Extensions Or just for your application, then it should be in the same directory from which yo are launching your application. If you are getting the 2.1-8 source, then the library built is called: librxtxSerial.jnilib despite what the docs say. Andre On 4-Nov-07, at 19:30 , Kevin Mateo Lim wrote: > > the README.OSX reads: > Put > libSerial.jnilib > in the directory of the application (the JavaVM will find it there). > Add > RXTXComm.jar > to the application classpath or include the classes in the > application jar. > (Some applications already include the RXTX classes in their > application jar, > in which case only the file libSerial.jnilib is required). > > > I can't find libSerial.jnilib > I put librxtxSerial.jnilib into my Processing /libraries/serial/ > library/ directory. > > Yet it still sees the old version: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > On 11/4/07, Andre-John Mas wrote: Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial .(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay (PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > From bschlining at gmail.com Sun Nov 4 19:46:23 2007 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 4 Nov 2007 18:46:23 -0800 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> Message-ID: > > Or just for your application, then it should be in the same directory > from which yo are launching your application. Just wanted to add one more way of specifying the native lib location... If you don't want to define it globally by putting it in /Library/Java/Extensions (and you don't, it's a very very bad practice) you can also specify the location of the native library when starting the JVM by specifying the 'java.library.path' property. For example: java -Djava.library.path=/Path/To/Directory/With/RXTX/Library YourMainClass -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071104/c5af6980/attachment-0003.html From greg.johnson at manchester.ac.uk Mon Nov 5 01:39:02 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Mon, 5 Nov 2007 09:39:02 +0100 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: The 2.1-8 code reports 2.1-7, hence your (and my) confusion. But as long as you've removed all traces of the old library, it really _is_ 2.1-8. And if you specify the library path to the VM, don't make my mistake (on OSX at least) - you need to respecify the entire library path it had by default, as the command line argument replaces the path, rather than appending to it. 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 5 Nov 2007, at 01:30, Kevin Mateo Lim wrote: > > the README.OSX reads: > Put > libSerial.jnilib > in the directory of the application (the JavaVM will find it there). > Add > RXTXComm.jar > to the application classpath or include the classes in the > application jar. > (Some applications already include the RXTX classes in their > application jar, > in which case only the file libSerial.jnilib is required). > > > I can't find libSerial.jnilib > I put librxtxSerial.jnilib into my Processing /libraries/serial/ > library/ directory. > > Yet it still sees the old version: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > On 11/4/07, Andre-John Mas wrote: > Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial .(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay (PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > 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 HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071105/7f50506d/attachment-0003.html From cyrille.dumont at tatexpress.fr Mon Nov 5 05:46:03 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 05 Nov 2007 13:46:03 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: References: <472727F1.1000704@tatexpress.fr> Message-ID: <472F108B.2090101@tatexpress.fr> Thanks a lot for your solution ... but I'm not a expert in JAVA ... (sorry) For the moment I've this function : """ public void serialEvent(SerialPortEvent e) { StringBuffer inputBuffer = new StringBuffer(); int newData = 0; switch (e.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } //-- Manag. Data from Scanner this.MngDataScanner(inputBuffer.toString()); break; case SerialPortEvent.BI:; //-- Break Received } } """ How can I do what you write ? ( maybe a simple ex ? ) PS : I don't know the PDF417 size (could be, for example, 338 char, or 500 ... ; what I know is that it can't be more than 800 char) Thanks in advance. Best regards. Trent Jarvi a ?crit : > 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 Martin.Oberhuber at windriver.com Mon Nov 5 08:47:50 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 5 Nov 2007 16:47:50 +0100 Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> Hi Trent, are the interestes of hobbyists really so different from commercial ones? Both should be interested in high quality and innovation the like. I haven't seen too many Open Source projects from the "inside" but those that I have seen did not have separate mailing lists for quality/testing/qa versus innovation/development. What I have seen with the Open Source projects that one would call "successful" is a good deal of process around automated builds, automated unit tests, predictable release dates and milestones, and policies around commiting/contributing/reviewing changes. I think that all of these benefit commercial users and hobbyists the like. If you were just asking about who's interested in discussing changes to foster more quality, count me in. I'm just not sure whether discussing these on a separate mailing list or other channel is the right thing to do. Cheers, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From toupsz at cs.tamu.edu Tue Nov 6 14:27:04 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 15:27:04 -0600 Subject: [Rxtx] reading TTL level signals from serial? Message-ID: Dear RXTX community- I've been using RXTX to handle communicating with several hardware devices in Java (a GPS and some custom audio circuitry for my dissertation work). I have a new, high-accuracy GPS which only communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there any way to communicate with this device using RXTX, perhaps by modding the native code for Windows? If so, does anyone have any tips on how to do it? Has it perhaps already been done? Another option is for me to invert / amplify the signal in hardware, but this is difficult for me to pull off due to the sensitivity of the electronics involved...I'll likely end up using a much less accurate piece of equipment rather than go that far! If anyone could help out, I'd really appreciate it! Thanks! -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/b6c59c2b/attachment.html From netbeans at gatworks.com Tue Nov 6 14:55:22 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 06 Nov 2007 16:55:22 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: Message-ID: <4730E2CA.3090009@gatworks.com> This is really a hardware issue. Is there any device ( ie the serial port ) on your computer that will accept the voltage signals ( and load ) that your device produces? Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it happen safely ( ie u dont cook the GPS device ) I have a new, high-accuracy GPS which only > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there > any way to communicate with this device using RXTX, From toupsz at cs.tamu.edu Tue Nov 6 15:14:01 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 16:14:01 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4730E2CA.3090009@gatworks.com> References: <4730E2CA.3090009@gatworks.com> Message-ID: Actually, the device runs over USB, but shows up as a virtual serial port and is outputting these signals. The software that comes with the device (a u-blox ANTARIS 4 eval kit) is able to communicate. RXTX is able to detect and properly configure the port, but does not get any of the data from it. :-/ It seems like there must be some way to do it (obviously, ublox knows how)... -Zach On Nov 6, 2007 3:55 PM, U. George wrote: > This is really a hardware issue. > Is there any device ( ie the serial port ) on your computer that will > accept the voltage signals ( and load ) that your device produces? > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it > happen safely ( ie u dont cook the GPS device ) > > > I have a new, high-accuracy GPS which only > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there > > any way to communicate with this device using RXTX, > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/15ae7a0b/attachment.html From keithvz at verizon.net Tue Nov 6 16:16:55 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 06 Nov 2007 18:16:55 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> Message-ID: <4730F5E7.1030704@verizon.net> Zach Toups wrote: > On Nov 6, 2007 3:55 PM, U. George > wrote: > > This is really a hardware issue. > Is there any device ( ie the serial port ) on your computer that will > accept the voltage signals ( and load ) that your device produces? > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it > happen safely ( ie u dont cook the GPS device ) > > > I have a new, high-accuracy GPS which only > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is > there > > any way to communicate with this device using RXTX, > _______________________________________________ As UGeorge intimated, it's a hardware issue. If your device outputs TTL level voltages, and your USB to serial converter is RS-232, then you've got a physical hardware differences. Inverted leads and voltage issues are mainly the problem. MAXIM makes a neat little chip called the MAX233 (better than the 232, no extern caps required) You can't solve this in software. Now, there are TTL level compatible USB to serial converters available, I happen to be using one right now. This unit below is from a UK company (there might be sources in the US) http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm Parallax makes one that does 3.3 and 5v http://www.parallax.com/detail.asp?product_id=32201 (but only supports RX, TX, GND, AND DTR towards device) (i've tested a variant of the unit above, and it works with RXTX) In both cases, you'll need some creative wiring depending on the interface on your GPS. Hope this helps Keith From toupsz at cs.tamu.edu Tue Nov 6 16:53:01 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 17:53:01 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4730F5E7.1030704@verizon.net> References: <4730E2CA.3090009@gatworks.com> <4730F5E7.1030704@verizon.net> Message-ID: Yeah...I used an FTDI chip to handle USB/serial conversion on the audio equipment I built. I'm leery of trying to build a board for this ublox GPS due to all the grounding/shielding issues around it. Anyway, I apreciate the help...just sad that I can't handle the problem in software! Ublox did send me the source code for their USB drivers...but as a Java programmer, it's a bit tough for me to sort out. ;) Thanks again! -Zach On Nov 6, 2007 5:16 PM, Keith Monahan wrote: > Zach Toups wrote: > > > On Nov 6, 2007 3:55 PM, U. George > > wrote: > > > > This is really a hardware issue. > > Is there any device ( ie the serial port ) on your computer that > will > > accept the voltage signals ( and load ) that your device produces? > > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make > it > > happen safely ( ie u dont cook the GPS device ) > > > > > > I have a new, high-accuracy GPS which only > > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is > > there > > > any way to communicate with this device using RXTX, > > _______________________________________________ > > As UGeorge intimated, it's a hardware issue. > > If your device outputs TTL level voltages, and your USB to serial > converter is RS-232, then you've got a physical hardware differences. > Inverted leads and voltage issues are mainly the problem. MAXIM makes a > neat little chip called the MAX233 (better than the 232, no extern caps > required) > > You can't solve this in software. > > Now, there are TTL level compatible USB to serial converters available, > I happen to be using one right now. > > This unit below is from a UK company (there might be sources in the US) > > http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm > > Parallax makes one that does 3.3 and 5v > > http://www.parallax.com/detail.asp?product_id=32201 > (but only supports RX, TX, GND, AND DTR towards device) > > (i've tested a variant of the unit above, and it works with RXTX) > > In both cases, you'll need some creative wiring depending on the > interface on your GPS. > > Hope this helps > > Keith > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/06e88ad4/attachment.html From netbeans at gatworks.com Tue Nov 6 17:14:01 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 06 Nov 2007 19:14:01 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> <4730F5E7.1030704@verizon.net> Message-ID: <47310349.5000406@gatworks.com> what gps chipset do u have? > Ublox did send me the source code for their USB drivers...but as a Java > programmer, it's a bit tough for me to sort out. ;) From Steffen.DETTMER at ingenico.com Wed Nov 7 03:10:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 7 Nov 2007 11:10:01 +0100 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> Message-ID: <20071107101000.GN10978@elberon.bln.de.ingenico.com> * Zach Toups wrote on Tue, Nov 06, 2007 at 16:14 -0600: > Actually, the device runs over USB, but shows up as a virtual > serial port and is outputting these signals. Ahh, so what you want is to use rxtx on the serial port that is created by the driver and mapped maybe as some COM8 or whatever? I this case then IMHO it would be no hardware question but maybe a problem in your application, or some driver or indeed a rxtx issue. > The software that > comes with the device (a u-blox ANTARIS 4 eval kit) is able to > communicate. Is it sure that this software is really using the virtual serial port and only this port? oki, Steffen -- About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Wed Nov 7 04:59:10 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 06:59:10 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <20071107101000.GN10978@elberon.bln.de.ingenico.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> Message-ID: <4731A88E.6080705@gatworks.com> >> The software that >> comes with the device (a u-blox ANTARIS 4 eval kit) is able to >> communicate. > > Is it sure that this software is really using the virtual serial > port and only this port? > I have tried to read the docs. I have yet to find any explanation on a (windoz) device driver for this device ( the usb device ). That magic is not explained. For a developer thats important magic. Maybe a call to their support team is in order? From netbeans at gatworks.com Wed Nov 7 05:01:38 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 07:01:38 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <20071107101000.GN10978@elberon.bln.de.ingenico.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> Message-ID: <4731A922.7@gatworks.com> Steffen DETTMER wrote: > * Zach Toups wrote on Tue, Nov 06, 2007 at 16:14 -0600: >> Actually, the device runs over USB, but shows up as a virtual BTW: it seems that I am not getting all the Rxtx mail. Is there still a problem? From keithvz at verizon.net Thu Nov 1 08:08:58 2007 From: keithvz at verizon.net (Keith) Date: Thu, 01 Nov 2007 10:08:58 -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: <4729DDFA.7080206@verizon.net> Trent Jarvi wrote: > 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? Well, I honestly don't know how all this fits together. I think it's just a matter of enabling the right flow control option within the standard serial framework to tell the device driver, "HEY START USING DTR/DSR FOR FLOW CONTROL." If what UGeorge said,(about that type of nitty-gritty lead control being done within the device driver), is true, then this confirms my suspicion. I tried narrowing down within the Linux drivers what you are looking for, but I can't entirely tell wth I'm looking at. (virtual com port drivers -- they are included compiled by default with Ubuntu, source included) http://www.ftdichip.com/Drivers/VCP/Linux/ftdi_sio.tar.gz Hahahaa, they make a reference to DTR flow control being supported but say (UGH) in parenthesis. You can also use their direct device driver library on Ubuntu -- libftd2xx.so.0.4.13. No source code. http://www.ftdichip.com/Drivers/D2XX/Linux/libftd2xx0.4.13.tar.gz In that case, you make a call to their FT_SetFlowControl() function. FT_STATUS FT_SetFlowControl (FT_HANDLE ftHandle, USHORT usFlowControl, UCHAR uXon,UCHAR uXoff) Parameters ftHandle Handle of the device. usFlowControl Must be one of FT_FLOW_NONE, FT_FLOW_RTS_CTS, ****FT_FLOW_DTR_DSR**** or FT_FLOW_XON_XOFF. uXon Character used to signal Xon. Only used if flow control is FT_FLOW_XON_XOFF. uXoff Character used to signal Xoff. Only used if flow control is FT_FLOW_XON_XOFF. This is from their programming guide http://www.ftdichip.com/Documents/ProgramGuides/D2XXPG34.pdf I actually want to take this a step further and say that I think the flow control is actually handled right on the device itself in hardware/firmware. It's enabled through the device driver, but I think the maintaining of buffers, asserting/deasserting of leads, etc is handled by the device. For the time being, I've switched to jd2xx, https://jd2xx.dev.java.net/ and http://bleyer.org/jd2xx/ These are Java wrappers for the device driver libraries. It allows almost direct access to the well-documented device drivers from Java. I hope this helps Keith From tjarvi at qbang.org Thu Nov 1 11:09:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:09:51 -0600 (MDT) 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: Hi Martin, What I usually have done is allow changes that do not impact working software including changes to methods not documented in CommAPI (which remain undocumented in rxtx) and fixes to known problems in the documented portions. That way if you use the documented API, the releases should only become better with time. If you use the undocumented portions, the behavior is not as predictable but open for improvement. On Wed, 31 Oct 2007, 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 >> > From tjarvi at qbang.org Thu Nov 1 11:15:52 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:15:52 -0600 (MDT) 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: I too use rxtx in commercial products. The problem I've been trying to address while bringing the server back was how to make it possible for hobby folks to build the same software as companies so we can move rxtx along a little faster. Exposing internal tools is not an option at this time, the public rxtx builds have been done on my home machine which has drives hanging out of it all over the place dying one at a time. This isn't maintainable. I'm currently looking at the possibility of making an S3 image available on Amazon's EC. These are machines you can rent for ~10 cents an hour which is more than enough to build rxtx. The S3 image is not changed when people use it so everyone has the same starting point. With this, we could all build rxtx for ~20 platforms for a small price and eliminate tool issues. On Wed, 31 Oct 2007, Greg Johnson wrote: > 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 tjarvi at qbang.org Thu Nov 1 11:19:55 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:19:55 -0600 (MDT) 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: On Wed, 31 Oct 2007, 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. I was helping Dmitry do the Mac OS X port without access to a machine when we put that in. In the archives there is information (easily found with google on Apple's site) that describes how their API (and others) can determine if a port is used and ignore it. I think these changes are in CVS but need to confirm. The bottom line is that rxtx should not have used lock files on Mac. It was just ignorance of the system on my part. -- Trent Jarvi tjarvi at qbang.org From fabioanjos at gmail.com Thu Nov 1 12:35:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Thu, 1 Nov 2007 15:35:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Hi, I was using SerialEventListener in my project. But, as was said here, id doesnt work very well with virtual serial ports. So, I changed the strategy using the code posted here in this thread: try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > 0) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } The thing is that in my tests I could notice that in.read(buffer) never blocks. Even when there's nothing to read. Instead of blocking when there's nothing to read it returns 0. So, my questions are: 1. Am I doing something wrong? 2. If not, wouldnt this decrease performance? (the thread would be locked in a loop that does nothing.) 3. Is there a better way to do the job? Thanks in advance!! F?bio -------- On 10/31/07, Andre-John Mas wrote: > > > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/0aee59d0/attachment-0007.html From ajmas at sympatico.ca Thu Nov 1 16:07:55 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Nov 2007 18:07:55 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Message-ID: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From sarah_662005 at yahoo.com Thu Nov 1 17:10:05 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Thu, 1 Nov 2007 16:10:05 -0700 (PDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Message-ID: <351433.37166.qm@web55814.mail.re3.yahoo.com> Thank you very much for your help. Now the application works fine. the serialEvent gets triggered. Rxtx is cool! ----- Original Message ---- From: Andre-John Mas To: Sara Hugh ; RXTX Developers and Users Sent: Wednesday, October 31, 2007 9:55:45 AM Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered 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 __________________________________________________ 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/20071101/4a86bea6/attachment-0007.html From tjarvi at qbang.org Thu Nov 1 17:58:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 17:58:02 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx Message-ID: The rxtx.org site is primarily interested in the hobby aspects of rxtx. Obviously, there are some companies following the work too. These interests bring larger workflows and concerns about details hobby folks may not care about. They also bring many more users. I know the company I work for has a quality engineering effort going on which includes rxtx. While the server was down, I was contacted by another company that was missing the binaries for their testing. Several people have mentioned concerns about a stable release for like reasons. Would there be interest on the quality side of the coin to get together? It could be just sharing email's with each other or a seperate list for QE/QA. I can not say for sure, but we may be able to share some of our efforts/results that could help keep rxtx releases stable. -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Fri Nov 2 01:42:55 2007 From: scldad at sdc.com.au (Stephen Davies) Date: Fri, 2 Nov 2007 18:12:55 +1030 Subject: [Rxtx] Multiple modems Message-ID: <200711021812.56047.scldad@sdc.com.au> This may or may not be related to the Multiple Ports thread. I have an application which uses rxtx on Linux (via cron jobs) to connect multiple modems to remote sensing devices. The application works fine most of the time but occasionally fails to connect if two (or more) connection attempts happen at about the same time. When it fails, it looks as if it may get confused as to which port it is talking to. The app has a "base" component that looks for an available port, opens it and then creates an input thread and an output thread for the connection and data transfer. The "base" component uses this code: // loop round all known ports until one is available. Give up after three minutes Counter ptimeout = new Counter(); while(!portFound && ptimeout.elapsed() < 180000) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // special case. ttyS0 is not available to us on this server. if (!portId.isCurrentlyOwned() && !portId.getName().equals("/dev/ttyS0")) { gLog.debug(lognm + ": Found port " + portId.getName()); try { serialPort = (RXTXPort) portId.open("AguaModem", 10000); } catch (Exception e) { gLog.error(lognm + ": Port " + portId.getName() + " will not open."); gLog.error(e.getMessage()); continue; } AguaModem aguamodem = new AguaModem(); portFound = true; break; } gLog.debug(lognm + ": Port " + portId.getName() + " is busy"); } } } I am wondering about the isCurrentlyOwned method. Does this actually tell me whether a port is currently being used by another process? TIA, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From fabioanjos at gmail.com Fri Nov 2 04:59:58 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 07:59:58 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Message-ID: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/9009eb1d/attachment-0007.html From netbeans at gatworks.com Fri Nov 2 06:28:13 2007 From: netbeans at gatworks.com (U. George) Date: Fri, 02 Nov 2007 08:28:13 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <472B17DD.1050508@gatworks.com> It should normally block ( unless eof / event ) . so its a :{ whats the device ( to recreate if possible ) and how do u open. > My question is, is there a way to make in.read block the thead until > there's something to read? > From fabioanjos at gmail.com Fri Nov 2 06:34:46 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 09:34:46 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > On 11/1/07, Andre-John Mas wrote: > > > > Fabio, > > > > Turns out there was a small error in my example. The test should be: > > > > (numBytes = in.read(buffer)) > -1 > > > > This is because -1 indicates an end of file (end of data stream) > > > > Andre > > > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > > > Hi, > > > > > > I was using SerialEventListener in my project. But, as was said > > > here, id doesnt work very well with virtual serial ports. > > > So, I changed the strategy using the code posted here in this thread: > > > > > > try{ > > > in = port.getInputStream(); > > > out = port.getOutputStream(); > > > int numBytes = 0; > > > while(active){ > > > > > > byte[] buffer = new byte[10]; > > > > > > while ( (numBytes = in.read(buffer)) > 0) > > > { > > > String dataValue = new String(buffer,0,numBytes); > > > processInput(dataValue); > > > } > > > > > > if(numBytes==-1){ > > > break; > > > } > > > > > > Thread.sleep(50); > > > } > > > > > > }catch(IOException e){ > > > logger.info("falha de comunicacao "+ > > > getReceptor().getPort() ); > > > > > > }catch(InterruptedException e){ > > > logger.info ("Interrompendo leitura da porta "+ > > > getReceptor().getPort() ); > > > } > > > > > > The thing is that in my tests I could notice that in.read(buffer) > > > never blocks. Even when there's nothing to read. Instead of blocking > > > when there's nothing to read it returns 0. > > > > > > So, my questions are: > > > > > > 1. Am I doing something wrong? > > > 2. If not, wouldnt this decrease performance? (the thread would be > > > locked in a loop that does nothing.) > > > 3. Is there a better way to do the job? > > > > > > Thanks in advance!! > > > > > > F?bio > > > -------- > > > > > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > > 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 > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > > > > > -- > > > Atenciosamente, > > > F?bio Cristiano dos Anjos > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/5306c4b1/attachment-0007.html From nick.circelli at infrasafe.com Fri Nov 2 07:01:17 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Fri, 2 Nov 2007 08:01:17 -0500 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com><29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com><90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca><29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Message-ID: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> I'm pretty sure that not blocking has to do with you virtual ports. Cause it should block. Maybe you should try: while ((numBytes = in.available()) > 0) { If (numBytes > buffer.length) { numBytes = buffer.length; // in case you have buffer overflow } numBytes = in.read(buffer, 0 , numBytes)); String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } Also, just for optimization, I'd move that byte[] buffer = new byte[10]; out of the while since you don't need to reallocate it every iteration. ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of F?bio Cristiano dos Anjos Sent: Friday, November 02, 2007 8:35 AM To: RXTX Developers and Users Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream (); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas < ajmas at sympatico.ca > wrote: Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info ("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Atenciosamente, F?bio Cristiano dos Anjos -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/4de7f6a3/attachment-0007.html From fabioanjos at gmail.com Fri Nov 2 07:36:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 10:36:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> Message-ID: <29788b250711020636q1588c88fgaa5e27f5504164fb@mail.gmail.com> Hi Nick, Actually, it doesnt block for physical ports too. And, the method avaiable does not block either, so when there's nothing avaiable the loop ends and the thread stops lintening to the port. But I did some more test with serialEventListener, and now its working. I realy dont know what I've done to get it working. I just start woking as soon as I decided to test it again. It was said here that serialEventListener is not reliable for virtual serial ports. Is there another way to read it, without compromising performance? Tanks again!! F?bio ------- On 11/2/07, Nick Circelli wrote: > > I'm pretty sure that not blocking has to do with you virtual ports. > Cause it should block. > > Maybe you should try: > > > > while ((numBytes = in.available()) > 0) > > { > > If (numBytes > buffer.length) { > > numBytes = buffer.length; // in case you have buffer overflow > > } > > numBytes = in.read(buffer, 0 , numBytes)); > > String dataValue = new String(buffer,0,numBytes,"ASCII"); > > processInput(dataValue); > > } > > > > Also, just for optimization, I'd move that byte[] buffer = new > byte[10]; > > out of the while since you don't need to reallocate it every iteration. > > > ------------------------------ > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On Behalf > Of *F?bio Cristiano dos Anjos > *Sent:* Friday, November 02, 2007 8:35 AM > *To:* RXTX Developers and Users > *Subject:* Re: [Rxtx] serialEvent(SerialPortEvent event) never be > triggered > > > > Hi, > > I think i missunderstand something here. > The code you post here was meant to be used inside serialEvent method, > right? > > The think is, that i cannot user SerialEventListener to read serial ports, > because i need to read virual serial ports and id does not behaves well, as > said here before. serialEvent is never triggered. > > So what I quit using SerialEventListener and created a thread to listen to > the port: > > public void run(){ > try{ > in = port.getInputStream(); > out = port.getOutputStream (); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new > String(buffer,0,numBytes,"ASCII"); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ getReceptor().getPort() > ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > } > > > So, the problem is that in.read(buffer) always returns 0 when there is > nothing to read, instead of blocking the flow, and the thread becames locked > in the loop. > > I hope you can help me solve this. > > Thanks in advance! > > F?bio > -------- > > On 11/2/07, *F?bio Cristiano dos Anjos* wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > > > On 11/1/07, *Andre-John Mas* < ajmas at sympatico.ca> wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info ("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/571df6ea/attachment-0006.html From tjarvi at qbang.org Fri Nov 2 08:32:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Nov 2007 08:32:15 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: References: Message-ID: On Fri, 2 Nov 2007, Greg Johnson wrote: > Hi Trent, folks, > Having a single rxtx that is suitable for commercial uses and hobbyists both > would be a great idea? Perhaps it would be worth submitting rxtx as a > proposal to Codehaus - they not only provide excellent tools (Jira (bug > tracker), Confluence (wiki)) but also support build management ( > maestro, continuum, bamboo). Relying on your personal machine (btw, frii.com > / rxtx.org is down again?) seems like a burden you shouldn't have to shoulder > alone. Hi Greg, There may be a little confusion here. There is no need to have two seperate rxtx releases. What I'm trying to encourage is a discussion between some of the people responsible for making sure rxtx does not break their products each release. Usually these people are interested in testing a set of functionality their product depends upon. They do not work with rxtx code but rather traps to catch when rxtx developers break something. This goes on all the time in isolated labs. There are many services that offer to do various pieces of a project for you if you... Anyone is free to do the 'if you' portion with rxtx and see how it goes. I'm actually interested in doing less of that than more. The rxtx.org work I do just happens to overlap with other things I do for personal/family use. The reason I suggest the amazon solution is that anyone can take full control of the environment for a day and it costs less than a package of gum without causing harm to what anyone else is doing. I assume the down question was with respect to a mod_security setting that has been resolved. If not, please post a url to the problem. -- Trent Jarvi tjarvi at qbang.org From nsayer at kfu.com Sat Nov 3 20:17:49 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 19:17:49 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? Message-ID: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Has anyone got RXTX working with an app under Leopard? My app hangs on port open (it works fine with Tiger). The relevant thread looks like this in the activity monitor: 1536 JVM_InvokeMethod 1536 0x48ccd0 1536 0x46f8a0 1536 0x4c3ff4 1536 0x4c4284 1536 0x357d160 1536 0x357faac 1536 Java_gnu_io_RXTXPort_open 1536 open $NOCANCEL$UNIX2003 1536 open $NOCANCEL$UNIX2003 From ajmas at sympatico.ca Sat Nov 3 22:02:04 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 00:02:04 -0400 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> RXTX works for me with Leopard. I am currently using it communicate with a Bluetooth GPS. What computer and device are you trying to use? Is the driver for your serial device compatible with MacOS X 10.5? Andre On 3-Nov-07, at 22:17 , Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From nsayer at kfu.com Sat Nov 3 22:17:47 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 21:17:47 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> Message-ID: <1720F723-3643-438C-B3AB-E09A67536977@kfu.com> On Nov 3, 2007, at 9:02 PM, Andre-John Mas wrote: > RXTX works for me with Leopard. I am currently using it communicate > with a Bluetooth GPS. > > What computer and device are you trying to use? Is the driver for > your serial device compatible with MacOS X 10.5? An Intel mac mini The FTDI USB serial driver an XMPCR, which is just a fancy serial controlled radio and an FTDI usb-to-serial chip I've successfully used the FTDI driver with another FTDI device in another context. > > > Andre > > On 3-Nov-07, at 22:17 , Nick Sayer wrote: > >> Has anyone got RXTX working with an app under Leopard? >> >> My app hangs on port open (it works fine with Tiger). The relevant >> thread looks like this in the activity monitor: >> >> 1536 JVM_InvokeMethod >> 1536 0x48ccd0 >> 1536 0x46f8a0 >> 1536 0x4c3ff4 >> 1536 0x4c4284 >> 1536 0x357d160 >> 1536 0x357faac >> 1536 >> Java_gnu_io_RXTXPort_open >> 1536 open >> $NOCANCEL$UNIX2003 >> 1536 open >> $NOCANCEL$UNIX2003 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From racecar at gmail.com Sat Nov 3 22:25:53 2007 From: racecar at gmail.com (Kevin Mateo Lim) Date: Sat, 3 Nov 2007 21:25:53 -0700 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: Message-ID: I am alternating between two errors. After i run the macosx_setup.command, "everyone" is set to Read only in /var/lock. I notice in the terminal that the group for these perms is _uucp, not uucp. In that state, I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 check_group_uucp(): error testing lock file creation Error details:Permission deniedcheck_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException : Error inside Serial.() at processing.serial.Serial.errorMessage(Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.( Serial.java:102) at Temporary_829_3245.setup(Temporary_829_3245.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java :690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) Then, I hand edit the "everyone" permissions for /var/lock/ to Read and Write (note /var/spool/uucp is Read/Write in all cases, and doesn't change). I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX uucp_lock() /var/lock/LK.003.009.000 is there gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException: Error inside Serial.() at processing.serial.Serial.errorMessage (Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.(Serial.java:102) at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java:690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) See here: http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071103/f1a2c467/attachment-0005.html From greg.johnson at manchester.ac.uk Sun Nov 4 02:31:13 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sun, 4 Nov 2007 10:31:13 +0100 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <28B5E0A0-0802-4C74-AC21-87ED35F3B9A2@manchester.ac.uk> Hi Nick, I also had problems initially with Leopard, but it was resolved by reinstalling the serial USB driver (FTDI in my case). The symptoms were a non-detection of any ports (but I twigged when I tried ZTerm and it had the same problem). Good luck! Cheers, greg PS I did a "Archive and install" which may be the reason my FTDI driver had disappeared - I don't think the driver has changed for 10.5 ------------------------------------------------------------------------- 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 4 Nov 2007, at 03:17, Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Sun Nov 4 13:01:12 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 15:01:12 -0500 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: Message-ID: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Hi, You will need to get the 2.1-8 code from CVS. See the FAQ for more information: http://rxtx.qbang.org/wiki/index.php/FAQ Andre On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > I am alternating between two errors. > > After i run the macosx_setup.command, "everyone" is set to Read only > in /var/lock. I notice in the terminal that the group for these > perms is _uucp, not uucp. > > In that state, I get this error: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > check_group_uucp(): error testing lock file creation Error > details:Permission deniedcheck_lock_status: No permission to create > lock file. > please see: How can I use Lock Files with rxtx? in INSTALL > gnu.io.PortInUseException: Unknown Application > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > java.lang.RuntimeException : Error inside Serial.() > > at processing.serial.Serial.errorMessage(Serial.java:583) > > at processing.serial.Serial.(Serial.java:148) > > at processing.serial.Serial.( Serial.java:102) > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > at processing.core.PApplet.run(PApplet.java:1556) > > at java.lang.Thread.run(Thread.java:613) > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > and Write (note /var/spool/uucp is Read/Write in all cases, and > doesn't change). I get this error: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > gnu.io.PortInUseException: Unknown Application > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > java.lang.RuntimeException: Error inside Serial.() > > at processing.serial.Serial.errorMessage (Serial.java:583) > > at processing.serial.Serial.(Serial.java:148) > > at processing.serial.Serial.(Serial.java:102) > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > at processing.core.PApplet.run(PApplet.java:1556) > > at java.lang.Thread.run(Thread.java:613) > > See here: > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From netbeans at gatworks.com Sun Nov 4 14:33:35 2007 From: netbeans at gatworks.com (U. George) Date: Sun, 04 Nov 2007 16:33:35 -0500 Subject: [Rxtx] #ifndef TIOCSERGETLSR Message-ID: <472E3AAF.7050709@gatworks.com> For Linux, it seems that you need the code for both *having* a TIOCSERGETLSR, and *not having* a TIOCSERGETLSR. Maybe the ioctl exists system wide, but not necessarily for the device driver itself ( always returns -1 ) . Are there systems that have a *functioning* TIOCSERGETLSR for all their devices? Then this would be the case where the "#ifndef TIOCSERGETLSR" directive could be useful is eliminating the unnecessary code and tests. And for those systems that dont have a TIOCSERGETLSR, then the code for TIOCSERGETLSR can be eliminated. It would be a simple case to have, as a foundation, all the code to simulate the missing TIOCSERGETLSR ioctl. If the system does have the ioctl, then that code can be ifdef'd in, and co-exist with the functionality of the code that simulates the missing TIOCSERGETLSR ioctl. From racecar at gmail.com Sun Nov 4 17:30:19 2007 From: racecar at gmail.com (Kevin Mateo Lim) Date: Sun, 4 Nov 2007 17:30:19 -0700 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: the README.OSX reads: Put libSerial.jnilib in the directory of the application (the JavaVM will find it there). Add RXTXComm.jar to the application classpath or include the classes in the application jar. (Some applications already include the RXTX classes in their application jar, in which case only the file libSerial.jnilib is required). I can't find libSerial.jnilib I put librxtxSerial.jnilib into my Processing /libraries/serial/library/ directory. Yet it still sees the old version: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 On 11/4/07, Andre-John Mas wrote: > > Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > 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/20071104/c0a83f91/attachment-0004.html From ajmas at sympatico.ca Sun Nov 4 17:41:47 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 19:41:47 -0500 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> If you are wanting it to be available for all applications, - for all users: /Library/Java/Extensions - for your user: ~/Library/Java/Extensions Or just for your application, then it should be in the same directory from which yo are launching your application. If you are getting the 2.1-8 source, then the library built is called: librxtxSerial.jnilib despite what the docs say. Andre On 4-Nov-07, at 19:30 , Kevin Mateo Lim wrote: > > the README.OSX reads: > Put > libSerial.jnilib > in the directory of the application (the JavaVM will find it there). > Add > RXTXComm.jar > to the application classpath or include the classes in the > application jar. > (Some applications already include the RXTX classes in their > application jar, > in which case only the file libSerial.jnilib is required). > > > I can't find libSerial.jnilib > I put librxtxSerial.jnilib into my Processing /libraries/serial/ > library/ directory. > > Yet it still sees the old version: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > On 11/4/07, Andre-John Mas wrote: Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial .(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay (PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > From bschlining at gmail.com Sun Nov 4 19:46:23 2007 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 4 Nov 2007 18:46:23 -0800 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> Message-ID: > > Or just for your application, then it should be in the same directory > from which yo are launching your application. Just wanted to add one more way of specifying the native lib location... If you don't want to define it globally by putting it in /Library/Java/Extensions (and you don't, it's a very very bad practice) you can also specify the location of the native library when starting the JVM by specifying the 'java.library.path' property. For example: java -Djava.library.path=/Path/To/Directory/With/RXTX/Library YourMainClass -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071104/c5af6980/attachment-0004.html From greg.johnson at manchester.ac.uk Mon Nov 5 01:39:02 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Mon, 5 Nov 2007 09:39:02 +0100 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: The 2.1-8 code reports 2.1-7, hence your (and my) confusion. But as long as you've removed all traces of the old library, it really _is_ 2.1-8. And if you specify the library path to the VM, don't make my mistake (on OSX at least) - you need to respecify the entire library path it had by default, as the command line argument replaces the path, rather than appending to it. 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 5 Nov 2007, at 01:30, Kevin Mateo Lim wrote: > > the README.OSX reads: > Put > libSerial.jnilib > in the directory of the application (the JavaVM will find it there). > Add > RXTXComm.jar > to the application classpath or include the classes in the > application jar. > (Some applications already include the RXTX classes in their > application jar, > in which case only the file libSerial.jnilib is required). > > > I can't find libSerial.jnilib > I put librxtxSerial.jnilib into my Processing /libraries/serial/ > library/ directory. > > Yet it still sees the old version: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > On 11/4/07, Andre-John Mas wrote: > Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial .(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay (PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > 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 HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071105/7f50506d/attachment-0004.html From cyrille.dumont at tatexpress.fr Mon Nov 5 05:46:03 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 05 Nov 2007 13:46:03 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: References: <472727F1.1000704@tatexpress.fr> Message-ID: <472F108B.2090101@tatexpress.fr> Thanks a lot for your solution ... but I'm not a expert in JAVA ... (sorry) For the moment I've this function : """ public void serialEvent(SerialPortEvent e) { StringBuffer inputBuffer = new StringBuffer(); int newData = 0; switch (e.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } //-- Manag. Data from Scanner this.MngDataScanner(inputBuffer.toString()); break; case SerialPortEvent.BI:; //-- Break Received } } """ How can I do what you write ? ( maybe a simple ex ? ) PS : I don't know the PDF417 size (could be, for example, 338 char, or 500 ... ; what I know is that it can't be more than 800 char) Thanks in advance. Best regards. Trent Jarvi a ?crit : > 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 Martin.Oberhuber at windriver.com Mon Nov 5 08:47:50 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 5 Nov 2007 16:47:50 +0100 Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> Hi Trent, are the interestes of hobbyists really so different from commercial ones? Both should be interested in high quality and innovation the like. I haven't seen too many Open Source projects from the "inside" but those that I have seen did not have separate mailing lists for quality/testing/qa versus innovation/development. What I have seen with the Open Source projects that one would call "successful" is a good deal of process around automated builds, automated unit tests, predictable release dates and milestones, and policies around commiting/contributing/reviewing changes. I think that all of these benefit commercial users and hobbyists the like. If you were just asking about who's interested in discussing changes to foster more quality, count me in. I'm just not sure whether discussing these on a separate mailing list or other channel is the right thing to do. Cheers, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From toupsz at cs.tamu.edu Tue Nov 6 14:27:04 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 15:27:04 -0600 Subject: [Rxtx] reading TTL level signals from serial? Message-ID: Dear RXTX community- I've been using RXTX to handle communicating with several hardware devices in Java (a GPS and some custom audio circuitry for my dissertation work). I have a new, high-accuracy GPS which only communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there any way to communicate with this device using RXTX, perhaps by modding the native code for Windows? If so, does anyone have any tips on how to do it? Has it perhaps already been done? Another option is for me to invert / amplify the signal in hardware, but this is difficult for me to pull off due to the sensitivity of the electronics involved...I'll likely end up using a much less accurate piece of equipment rather than go that far! If anyone could help out, I'd really appreciate it! Thanks! -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/b6c59c2b/attachment-0002.html From netbeans at gatworks.com Tue Nov 6 14:55:22 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 06 Nov 2007 16:55:22 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: Message-ID: <4730E2CA.3090009@gatworks.com> This is really a hardware issue. Is there any device ( ie the serial port ) on your computer that will accept the voltage signals ( and load ) that your device produces? Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it happen safely ( ie u dont cook the GPS device ) I have a new, high-accuracy GPS which only > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there > any way to communicate with this device using RXTX, From toupsz at cs.tamu.edu Tue Nov 6 15:14:01 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 16:14:01 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4730E2CA.3090009@gatworks.com> References: <4730E2CA.3090009@gatworks.com> Message-ID: Actually, the device runs over USB, but shows up as a virtual serial port and is outputting these signals. The software that comes with the device (a u-blox ANTARIS 4 eval kit) is able to communicate. RXTX is able to detect and properly configure the port, but does not get any of the data from it. :-/ It seems like there must be some way to do it (obviously, ublox knows how)... -Zach On Nov 6, 2007 3:55 PM, U. George wrote: > This is really a hardware issue. > Is there any device ( ie the serial port ) on your computer that will > accept the voltage signals ( and load ) that your device produces? > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it > happen safely ( ie u dont cook the GPS device ) > > > I have a new, high-accuracy GPS which only > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there > > any way to communicate with this device using RXTX, > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/15ae7a0b/attachment-0002.html From keithvz at verizon.net Tue Nov 6 16:16:55 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 06 Nov 2007 18:16:55 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> Message-ID: <4730F5E7.1030704@verizon.net> Zach Toups wrote: > On Nov 6, 2007 3:55 PM, U. George > wrote: > > This is really a hardware issue. > Is there any device ( ie the serial port ) on your computer that will > accept the voltage signals ( and load ) that your device produces? > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it > happen safely ( ie u dont cook the GPS device ) > > > I have a new, high-accuracy GPS which only > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is > there > > any way to communicate with this device using RXTX, > _______________________________________________ As UGeorge intimated, it's a hardware issue. If your device outputs TTL level voltages, and your USB to serial converter is RS-232, then you've got a physical hardware differences. Inverted leads and voltage issues are mainly the problem. MAXIM makes a neat little chip called the MAX233 (better than the 232, no extern caps required) You can't solve this in software. Now, there are TTL level compatible USB to serial converters available, I happen to be using one right now. This unit below is from a UK company (there might be sources in the US) http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm Parallax makes one that does 3.3 and 5v http://www.parallax.com/detail.asp?product_id=32201 (but only supports RX, TX, GND, AND DTR towards device) (i've tested a variant of the unit above, and it works with RXTX) In both cases, you'll need some creative wiring depending on the interface on your GPS. Hope this helps Keith From toupsz at cs.tamu.edu Tue Nov 6 16:53:01 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 17:53:01 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4730F5E7.1030704@verizon.net> References: <4730E2CA.3090009@gatworks.com> <4730F5E7.1030704@verizon.net> Message-ID: Yeah...I used an FTDI chip to handle USB/serial conversion on the audio equipment I built. I'm leery of trying to build a board for this ublox GPS due to all the grounding/shielding issues around it. Anyway, I apreciate the help...just sad that I can't handle the problem in software! Ublox did send me the source code for their USB drivers...but as a Java programmer, it's a bit tough for me to sort out. ;) Thanks again! -Zach On Nov 6, 2007 5:16 PM, Keith Monahan wrote: > Zach Toups wrote: > > > On Nov 6, 2007 3:55 PM, U. George > > wrote: > > > > This is really a hardware issue. > > Is there any device ( ie the serial port ) on your computer that > will > > accept the voltage signals ( and load ) that your device produces? > > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make > it > > happen safely ( ie u dont cook the GPS device ) > > > > > > I have a new, high-accuracy GPS which only > > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is > > there > > > any way to communicate with this device using RXTX, > > _______________________________________________ > > As UGeorge intimated, it's a hardware issue. > > If your device outputs TTL level voltages, and your USB to serial > converter is RS-232, then you've got a physical hardware differences. > Inverted leads and voltage issues are mainly the problem. MAXIM makes a > neat little chip called the MAX233 (better than the 232, no extern caps > required) > > You can't solve this in software. > > Now, there are TTL level compatible USB to serial converters available, > I happen to be using one right now. > > This unit below is from a UK company (there might be sources in the US) > > http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm > > Parallax makes one that does 3.3 and 5v > > http://www.parallax.com/detail.asp?product_id=32201 > (but only supports RX, TX, GND, AND DTR towards device) > > (i've tested a variant of the unit above, and it works with RXTX) > > In both cases, you'll need some creative wiring depending on the > interface on your GPS. > > Hope this helps > > Keith > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/06e88ad4/attachment-0002.html From netbeans at gatworks.com Tue Nov 6 17:14:01 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 06 Nov 2007 19:14:01 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> <4730F5E7.1030704@verizon.net> Message-ID: <47310349.5000406@gatworks.com> what gps chipset do u have? > Ublox did send me the source code for their USB drivers...but as a Java > programmer, it's a bit tough for me to sort out. ;) From Steffen.DETTMER at ingenico.com Wed Nov 7 03:10:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 7 Nov 2007 11:10:01 +0100 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> Message-ID: <20071107101000.GN10978@elberon.bln.de.ingenico.com> * Zach Toups wrote on Tue, Nov 06, 2007 at 16:14 -0600: > Actually, the device runs over USB, but shows up as a virtual > serial port and is outputting these signals. Ahh, so what you want is to use rxtx on the serial port that is created by the driver and mapped maybe as some COM8 or whatever? I this case then IMHO it would be no hardware question but maybe a problem in your application, or some driver or indeed a rxtx issue. > The software that > comes with the device (a u-blox ANTARIS 4 eval kit) is able to > communicate. Is it sure that this software is really using the virtual serial port and only this port? oki, Steffen -- About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Wed Nov 7 04:59:10 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 06:59:10 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <20071107101000.GN10978@elberon.bln.de.ingenico.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> Message-ID: <4731A88E.6080705@gatworks.com> >> The software that >> comes with the device (a u-blox ANTARIS 4 eval kit) is able to >> communicate. > > Is it sure that this software is really using the virtual serial > port and only this port? > I have tried to read the docs. I have yet to find any explanation on a (windoz) device driver for this device ( the usb device ). That magic is not explained. For a developer thats important magic. Maybe a call to their support team is in order? From netbeans at gatworks.com Wed Nov 7 05:01:38 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 07:01:38 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <20071107101000.GN10978@elberon.bln.de.ingenico.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> Message-ID: <4731A922.7@gatworks.com> Steffen DETTMER wrote: > * Zach Toups wrote on Tue, Nov 06, 2007 at 16:14 -0600: >> Actually, the device runs over USB, but shows up as a virtual BTW: it seems that I am not getting all the Rxtx mail. Is there still a problem? From toupsz at cs.tamu.edu Wed Nov 7 07:36:20 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Wed, 7 Nov 2007 08:36:20 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4731A88E.6080705@gatworks.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> <4731A88E.6080705@gatworks.com> Message-ID: When I emailed them about this issue, they sent me their WinCE drivers, which are apparently based on this open source driver: http://www.yetanotherhomepage.com/j7xx/j7xx.html?/j7xx/software/util/usbdriver.html These include srcdll, and x86 subfolders, though it's not 100% clear to me that these are useful. The ublox communication suite appears to only communicate with serial ports...I've communicated with the ublox on two different comm ports (one with the serial adapter plugged into the serial port, one with the main USB connection), as well as a Garmin bluetooth GPS (which comes up as a bluetooth serial device). I'm not well versed in code this close to the hardware, but it seems to me that if you're running a virtual serial port, then you're virtually controlling the "voltages" that come in on this "port"...so why would they be "ttl level"? :-/ Shouldn't the USB driver be able to interpret the signals in whatever way it wants and just supply software with the binary interpretation? Thanks for all the help, guys, it's really appreciated! -Zach On Nov 7, 2007 5:59 AM, U. George wrote: > > >> The software that > >> comes with the device (a u-blox ANTARIS 4 eval kit) is able to > >> communicate. > > > > Is it sure that this software is really using the virtual serial > > port and only this port? > > > > I have tried to read the docs. I have yet to find any explanation on a > (windoz) device driver for this device ( the usb device ). That magic > is not explained. For a developer thats important magic. Maybe a call > to their support team is in order? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071107/18a13314/attachment.html From netbeans at gatworks.com Wed Nov 7 08:55:55 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 10:55:55 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> <4731A88E.6080705@gatworks.com> Message-ID: <4731E00B.9030902@gatworks.com> There are 2 components to talking to hardware. There is the electrical specification, and then there is the software specification. there is the rs232 specification, parallel port specification, and the USB electrical specification. Generally these are used to plug in the various devices, and hook up electrically. Then there is the software side. There is the device driver, a software component that sits somewhere in the kernel that handles the USB ( in your case ) controller. The device driver generally does not care about the electrical component. There are various chips that handle USB signals, and these chips have I/O addresses so that signals and data can be properly routed. There is also the side that communicates to the user via the COM port device-name. The device driver that you mentioned is for the "Support PL2303 serial chip". This device driver, which hopefully works, handles the USB chip, and eventually recognzes the gps device, and hopefully creates an COM port so the user can open up and communicate. These are a lot of "HOPES". Since u have the web address of the device driver, and developer, I would think that the developer, and any docs, might be better able to help u to first determine if the GPS device is recognized, and the COM port ( maybe its called by another name ) is created, as per documentation. > > These include srcdll, and x86 subfolders, though it's not 100% clear to > me that these are useful. From keithvz at verizon.net Thu Nov 1 08:08:58 2007 From: keithvz at verizon.net (Keith) Date: Thu, 01 Nov 2007 10:08:58 -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: <4729DDFA.7080206@verizon.net> Trent Jarvi wrote: > 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? Well, I honestly don't know how all this fits together. I think it's just a matter of enabling the right flow control option within the standard serial framework to tell the device driver, "HEY START USING DTR/DSR FOR FLOW CONTROL." If what UGeorge said,(about that type of nitty-gritty lead control being done within the device driver), is true, then this confirms my suspicion. I tried narrowing down within the Linux drivers what you are looking for, but I can't entirely tell wth I'm looking at. (virtual com port drivers -- they are included compiled by default with Ubuntu, source included) http://www.ftdichip.com/Drivers/VCP/Linux/ftdi_sio.tar.gz Hahahaa, they make a reference to DTR flow control being supported but say (UGH) in parenthesis. You can also use their direct device driver library on Ubuntu -- libftd2xx.so.0.4.13. No source code. http://www.ftdichip.com/Drivers/D2XX/Linux/libftd2xx0.4.13.tar.gz In that case, you make a call to their FT_SetFlowControl() function. FT_STATUS FT_SetFlowControl (FT_HANDLE ftHandle, USHORT usFlowControl, UCHAR uXon,UCHAR uXoff) Parameters ftHandle Handle of the device. usFlowControl Must be one of FT_FLOW_NONE, FT_FLOW_RTS_CTS, ****FT_FLOW_DTR_DSR**** or FT_FLOW_XON_XOFF. uXon Character used to signal Xon. Only used if flow control is FT_FLOW_XON_XOFF. uXoff Character used to signal Xoff. Only used if flow control is FT_FLOW_XON_XOFF. This is from their programming guide http://www.ftdichip.com/Documents/ProgramGuides/D2XXPG34.pdf I actually want to take this a step further and say that I think the flow control is actually handled right on the device itself in hardware/firmware. It's enabled through the device driver, but I think the maintaining of buffers, asserting/deasserting of leads, etc is handled by the device. For the time being, I've switched to jd2xx, https://jd2xx.dev.java.net/ and http://bleyer.org/jd2xx/ These are Java wrappers for the device driver libraries. It allows almost direct access to the well-documented device drivers from Java. I hope this helps Keith From tjarvi at qbang.org Thu Nov 1 11:09:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:09:51 -0600 (MDT) 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: Hi Martin, What I usually have done is allow changes that do not impact working software including changes to methods not documented in CommAPI (which remain undocumented in rxtx) and fixes to known problems in the documented portions. That way if you use the documented API, the releases should only become better with time. If you use the undocumented portions, the behavior is not as predictable but open for improvement. On Wed, 31 Oct 2007, 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 >> > From tjarvi at qbang.org Thu Nov 1 11:15:52 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:15:52 -0600 (MDT) 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: I too use rxtx in commercial products. The problem I've been trying to address while bringing the server back was how to make it possible for hobby folks to build the same software as companies so we can move rxtx along a little faster. Exposing internal tools is not an option at this time, the public rxtx builds have been done on my home machine which has drives hanging out of it all over the place dying one at a time. This isn't maintainable. I'm currently looking at the possibility of making an S3 image available on Amazon's EC. These are machines you can rent for ~10 cents an hour which is more than enough to build rxtx. The S3 image is not changed when people use it so everyone has the same starting point. With this, we could all build rxtx for ~20 platforms for a small price and eliminate tool issues. On Wed, 31 Oct 2007, Greg Johnson wrote: > 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 tjarvi at qbang.org Thu Nov 1 11:19:55 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:19:55 -0600 (MDT) 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: On Wed, 31 Oct 2007, 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. I was helping Dmitry do the Mac OS X port without access to a machine when we put that in. In the archives there is information (easily found with google on Apple's site) that describes how their API (and others) can determine if a port is used and ignore it. I think these changes are in CVS but need to confirm. The bottom line is that rxtx should not have used lock files on Mac. It was just ignorance of the system on my part. -- Trent Jarvi tjarvi at qbang.org From fabioanjos at gmail.com Thu Nov 1 12:35:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Thu, 1 Nov 2007 15:35:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Hi, I was using SerialEventListener in my project. But, as was said here, id doesnt work very well with virtual serial ports. So, I changed the strategy using the code posted here in this thread: try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > 0) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } The thing is that in my tests I could notice that in.read(buffer) never blocks. Even when there's nothing to read. Instead of blocking when there's nothing to read it returns 0. So, my questions are: 1. Am I doing something wrong? 2. If not, wouldnt this decrease performance? (the thread would be locked in a loop that does nothing.) 3. Is there a better way to do the job? Thanks in advance!! F?bio -------- On 10/31/07, Andre-John Mas wrote: > > > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/0aee59d0/attachment-0008.html From ajmas at sympatico.ca Thu Nov 1 16:07:55 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Nov 2007 18:07:55 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Message-ID: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From sarah_662005 at yahoo.com Thu Nov 1 17:10:05 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Thu, 1 Nov 2007 16:10:05 -0700 (PDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Message-ID: <351433.37166.qm@web55814.mail.re3.yahoo.com> Thank you very much for your help. Now the application works fine. the serialEvent gets triggered. Rxtx is cool! ----- Original Message ---- From: Andre-John Mas To: Sara Hugh ; RXTX Developers and Users Sent: Wednesday, October 31, 2007 9:55:45 AM Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered 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 __________________________________________________ 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/20071101/4a86bea6/attachment-0008.html From tjarvi at qbang.org Thu Nov 1 17:58:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 17:58:02 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx Message-ID: The rxtx.org site is primarily interested in the hobby aspects of rxtx. Obviously, there are some companies following the work too. These interests bring larger workflows and concerns about details hobby folks may not care about. They also bring many more users. I know the company I work for has a quality engineering effort going on which includes rxtx. While the server was down, I was contacted by another company that was missing the binaries for their testing. Several people have mentioned concerns about a stable release for like reasons. Would there be interest on the quality side of the coin to get together? It could be just sharing email's with each other or a seperate list for QE/QA. I can not say for sure, but we may be able to share some of our efforts/results that could help keep rxtx releases stable. -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Fri Nov 2 01:42:55 2007 From: scldad at sdc.com.au (Stephen Davies) Date: Fri, 2 Nov 2007 18:12:55 +1030 Subject: [Rxtx] Multiple modems Message-ID: <200711021812.56047.scldad@sdc.com.au> This may or may not be related to the Multiple Ports thread. I have an application which uses rxtx on Linux (via cron jobs) to connect multiple modems to remote sensing devices. The application works fine most of the time but occasionally fails to connect if two (or more) connection attempts happen at about the same time. When it fails, it looks as if it may get confused as to which port it is talking to. The app has a "base" component that looks for an available port, opens it and then creates an input thread and an output thread for the connection and data transfer. The "base" component uses this code: // loop round all known ports until one is available. Give up after three minutes Counter ptimeout = new Counter(); while(!portFound && ptimeout.elapsed() < 180000) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // special case. ttyS0 is not available to us on this server. if (!portId.isCurrentlyOwned() && !portId.getName().equals("/dev/ttyS0")) { gLog.debug(lognm + ": Found port " + portId.getName()); try { serialPort = (RXTXPort) portId.open("AguaModem", 10000); } catch (Exception e) { gLog.error(lognm + ": Port " + portId.getName() + " will not open."); gLog.error(e.getMessage()); continue; } AguaModem aguamodem = new AguaModem(); portFound = true; break; } gLog.debug(lognm + ": Port " + portId.getName() + " is busy"); } } } I am wondering about the isCurrentlyOwned method. Does this actually tell me whether a port is currently being used by another process? TIA, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From fabioanjos at gmail.com Fri Nov 2 04:59:58 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 07:59:58 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Message-ID: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/9009eb1d/attachment-0008.html From netbeans at gatworks.com Fri Nov 2 06:28:13 2007 From: netbeans at gatworks.com (U. George) Date: Fri, 02 Nov 2007 08:28:13 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <472B17DD.1050508@gatworks.com> It should normally block ( unless eof / event ) . so its a :{ whats the device ( to recreate if possible ) and how do u open. > My question is, is there a way to make in.read block the thead until > there's something to read? > From fabioanjos at gmail.com Fri Nov 2 06:34:46 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 09:34:46 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > On 11/1/07, Andre-John Mas wrote: > > > > Fabio, > > > > Turns out there was a small error in my example. The test should be: > > > > (numBytes = in.read(buffer)) > -1 > > > > This is because -1 indicates an end of file (end of data stream) > > > > Andre > > > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > > > Hi, > > > > > > I was using SerialEventListener in my project. But, as was said > > > here, id doesnt work very well with virtual serial ports. > > > So, I changed the strategy using the code posted here in this thread: > > > > > > try{ > > > in = port.getInputStream(); > > > out = port.getOutputStream(); > > > int numBytes = 0; > > > while(active){ > > > > > > byte[] buffer = new byte[10]; > > > > > > while ( (numBytes = in.read(buffer)) > 0) > > > { > > > String dataValue = new String(buffer,0,numBytes); > > > processInput(dataValue); > > > } > > > > > > if(numBytes==-1){ > > > break; > > > } > > > > > > Thread.sleep(50); > > > } > > > > > > }catch(IOException e){ > > > logger.info("falha de comunicacao "+ > > > getReceptor().getPort() ); > > > > > > }catch(InterruptedException e){ > > > logger.info ("Interrompendo leitura da porta "+ > > > getReceptor().getPort() ); > > > } > > > > > > The thing is that in my tests I could notice that in.read(buffer) > > > never blocks. Even when there's nothing to read. Instead of blocking > > > when there's nothing to read it returns 0. > > > > > > So, my questions are: > > > > > > 1. Am I doing something wrong? > > > 2. If not, wouldnt this decrease performance? (the thread would be > > > locked in a loop that does nothing.) > > > 3. Is there a better way to do the job? > > > > > > Thanks in advance!! > > > > > > F?bio > > > -------- > > > > > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > > 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 > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > > > > > -- > > > Atenciosamente, > > > F?bio Cristiano dos Anjos > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/5306c4b1/attachment-0008.html From nick.circelli at infrasafe.com Fri Nov 2 07:01:17 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Fri, 2 Nov 2007 08:01:17 -0500 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com><29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com><90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca><29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Message-ID: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> I'm pretty sure that not blocking has to do with you virtual ports. Cause it should block. Maybe you should try: while ((numBytes = in.available()) > 0) { If (numBytes > buffer.length) { numBytes = buffer.length; // in case you have buffer overflow } numBytes = in.read(buffer, 0 , numBytes)); String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } Also, just for optimization, I'd move that byte[] buffer = new byte[10]; out of the while since you don't need to reallocate it every iteration. ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of F?bio Cristiano dos Anjos Sent: Friday, November 02, 2007 8:35 AM To: RXTX Developers and Users Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream (); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas < ajmas at sympatico.ca > wrote: Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info ("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Atenciosamente, F?bio Cristiano dos Anjos -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/4de7f6a3/attachment-0008.html From fabioanjos at gmail.com Fri Nov 2 07:36:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 10:36:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> Message-ID: <29788b250711020636q1588c88fgaa5e27f5504164fb@mail.gmail.com> Hi Nick, Actually, it doesnt block for physical ports too. And, the method avaiable does not block either, so when there's nothing avaiable the loop ends and the thread stops lintening to the port. But I did some more test with serialEventListener, and now its working. I realy dont know what I've done to get it working. I just start woking as soon as I decided to test it again. It was said here that serialEventListener is not reliable for virtual serial ports. Is there another way to read it, without compromising performance? Tanks again!! F?bio ------- On 11/2/07, Nick Circelli wrote: > > I'm pretty sure that not blocking has to do with you virtual ports. > Cause it should block. > > Maybe you should try: > > > > while ((numBytes = in.available()) > 0) > > { > > If (numBytes > buffer.length) { > > numBytes = buffer.length; // in case you have buffer overflow > > } > > numBytes = in.read(buffer, 0 , numBytes)); > > String dataValue = new String(buffer,0,numBytes,"ASCII"); > > processInput(dataValue); > > } > > > > Also, just for optimization, I'd move that byte[] buffer = new > byte[10]; > > out of the while since you don't need to reallocate it every iteration. > > > ------------------------------ > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On Behalf > Of *F?bio Cristiano dos Anjos > *Sent:* Friday, November 02, 2007 8:35 AM > *To:* RXTX Developers and Users > *Subject:* Re: [Rxtx] serialEvent(SerialPortEvent event) never be > triggered > > > > Hi, > > I think i missunderstand something here. > The code you post here was meant to be used inside serialEvent method, > right? > > The think is, that i cannot user SerialEventListener to read serial ports, > because i need to read virual serial ports and id does not behaves well, as > said here before. serialEvent is never triggered. > > So what I quit using SerialEventListener and created a thread to listen to > the port: > > public void run(){ > try{ > in = port.getInputStream(); > out = port.getOutputStream (); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new > String(buffer,0,numBytes,"ASCII"); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ getReceptor().getPort() > ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > } > > > So, the problem is that in.read(buffer) always returns 0 when there is > nothing to read, instead of blocking the flow, and the thread becames locked > in the loop. > > I hope you can help me solve this. > > Thanks in advance! > > F?bio > -------- > > On 11/2/07, *F?bio Cristiano dos Anjos* wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > > > On 11/1/07, *Andre-John Mas* < ajmas at sympatico.ca> wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info ("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/571df6ea/attachment-0007.html From tjarvi at qbang.org Fri Nov 2 08:32:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Nov 2007 08:32:15 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: References: Message-ID: On Fri, 2 Nov 2007, Greg Johnson wrote: > Hi Trent, folks, > Having a single rxtx that is suitable for commercial uses and hobbyists both > would be a great idea? Perhaps it would be worth submitting rxtx as a > proposal to Codehaus - they not only provide excellent tools (Jira (bug > tracker), Confluence (wiki)) but also support build management ( > maestro, continuum, bamboo). Relying on your personal machine (btw, frii.com > / rxtx.org is down again?) seems like a burden you shouldn't have to shoulder > alone. Hi Greg, There may be a little confusion here. There is no need to have two seperate rxtx releases. What I'm trying to encourage is a discussion between some of the people responsible for making sure rxtx does not break their products each release. Usually these people are interested in testing a set of functionality their product depends upon. They do not work with rxtx code but rather traps to catch when rxtx developers break something. This goes on all the time in isolated labs. There are many services that offer to do various pieces of a project for you if you... Anyone is free to do the 'if you' portion with rxtx and see how it goes. I'm actually interested in doing less of that than more. The rxtx.org work I do just happens to overlap with other things I do for personal/family use. The reason I suggest the amazon solution is that anyone can take full control of the environment for a day and it costs less than a package of gum without causing harm to what anyone else is doing. I assume the down question was with respect to a mod_security setting that has been resolved. If not, please post a url to the problem. -- Trent Jarvi tjarvi at qbang.org From nsayer at kfu.com Sat Nov 3 20:17:49 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 19:17:49 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? Message-ID: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Has anyone got RXTX working with an app under Leopard? My app hangs on port open (it works fine with Tiger). The relevant thread looks like this in the activity monitor: 1536 JVM_InvokeMethod 1536 0x48ccd0 1536 0x46f8a0 1536 0x4c3ff4 1536 0x4c4284 1536 0x357d160 1536 0x357faac 1536 Java_gnu_io_RXTXPort_open 1536 open $NOCANCEL$UNIX2003 1536 open $NOCANCEL$UNIX2003 From ajmas at sympatico.ca Sat Nov 3 22:02:04 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 00:02:04 -0400 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> RXTX works for me with Leopard. I am currently using it communicate with a Bluetooth GPS. What computer and device are you trying to use? Is the driver for your serial device compatible with MacOS X 10.5? Andre On 3-Nov-07, at 22:17 , Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From nsayer at kfu.com Sat Nov 3 22:17:47 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 21:17:47 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> Message-ID: <1720F723-3643-438C-B3AB-E09A67536977@kfu.com> On Nov 3, 2007, at 9:02 PM, Andre-John Mas wrote: > RXTX works for me with Leopard. I am currently using it communicate > with a Bluetooth GPS. > > What computer and device are you trying to use? Is the driver for > your serial device compatible with MacOS X 10.5? An Intel mac mini The FTDI USB serial driver an XMPCR, which is just a fancy serial controlled radio and an FTDI usb-to-serial chip I've successfully used the FTDI driver with another FTDI device in another context. > > > Andre > > On 3-Nov-07, at 22:17 , Nick Sayer wrote: > >> Has anyone got RXTX working with an app under Leopard? >> >> My app hangs on port open (it works fine with Tiger). The relevant >> thread looks like this in the activity monitor: >> >> 1536 JVM_InvokeMethod >> 1536 0x48ccd0 >> 1536 0x46f8a0 >> 1536 0x4c3ff4 >> 1536 0x4c4284 >> 1536 0x357d160 >> 1536 0x357faac >> 1536 >> Java_gnu_io_RXTXPort_open >> 1536 open >> $NOCANCEL$UNIX2003 >> 1536 open >> $NOCANCEL$UNIX2003 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From racecar at gmail.com Sat Nov 3 22:25:53 2007 From: racecar at gmail.com (Kevin Mateo Lim) Date: Sat, 3 Nov 2007 21:25:53 -0700 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: Message-ID: I am alternating between two errors. After i run the macosx_setup.command, "everyone" is set to Read only in /var/lock. I notice in the terminal that the group for these perms is _uucp, not uucp. In that state, I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 check_group_uucp(): error testing lock file creation Error details:Permission deniedcheck_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException : Error inside Serial.() at processing.serial.Serial.errorMessage(Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.( Serial.java:102) at Temporary_829_3245.setup(Temporary_829_3245.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java :690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) Then, I hand edit the "everyone" permissions for /var/lock/ to Read and Write (note /var/spool/uucp is Read/Write in all cases, and doesn't change). I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX uucp_lock() /var/lock/LK.003.009.000 is there gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException: Error inside Serial.() at processing.serial.Serial.errorMessage (Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.(Serial.java:102) at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java:690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) See here: http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071103/f1a2c467/attachment-0006.html From greg.johnson at manchester.ac.uk Sun Nov 4 02:31:13 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sun, 4 Nov 2007 10:31:13 +0100 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <28B5E0A0-0802-4C74-AC21-87ED35F3B9A2@manchester.ac.uk> Hi Nick, I also had problems initially with Leopard, but it was resolved by reinstalling the serial USB driver (FTDI in my case). The symptoms were a non-detection of any ports (but I twigged when I tried ZTerm and it had the same problem). Good luck! Cheers, greg PS I did a "Archive and install" which may be the reason my FTDI driver had disappeared - I don't think the driver has changed for 10.5 ------------------------------------------------------------------------- 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 4 Nov 2007, at 03:17, Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Sun Nov 4 13:01:12 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 15:01:12 -0500 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: Message-ID: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Hi, You will need to get the 2.1-8 code from CVS. See the FAQ for more information: http://rxtx.qbang.org/wiki/index.php/FAQ Andre On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > I am alternating between two errors. > > After i run the macosx_setup.command, "everyone" is set to Read only > in /var/lock. I notice in the terminal that the group for these > perms is _uucp, not uucp. > > In that state, I get this error: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > check_group_uucp(): error testing lock file creation Error > details:Permission deniedcheck_lock_status: No permission to create > lock file. > please see: How can I use Lock Files with rxtx? in INSTALL > gnu.io.PortInUseException: Unknown Application > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > java.lang.RuntimeException : Error inside Serial.() > > at processing.serial.Serial.errorMessage(Serial.java:583) > > at processing.serial.Serial.(Serial.java:148) > > at processing.serial.Serial.( Serial.java:102) > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > at processing.core.PApplet.run(PApplet.java:1556) > > at java.lang.Thread.run(Thread.java:613) > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > and Write (note /var/spool/uucp is Read/Write in all cases, and > doesn't change). I get this error: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > gnu.io.PortInUseException: Unknown Application > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > java.lang.RuntimeException: Error inside Serial.() > > at processing.serial.Serial.errorMessage (Serial.java:583) > > at processing.serial.Serial.(Serial.java:148) > > at processing.serial.Serial.(Serial.java:102) > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > at processing.core.PApplet.run(PApplet.java:1556) > > at java.lang.Thread.run(Thread.java:613) > > See here: > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From netbeans at gatworks.com Sun Nov 4 14:33:35 2007 From: netbeans at gatworks.com (U. George) Date: Sun, 04 Nov 2007 16:33:35 -0500 Subject: [Rxtx] #ifndef TIOCSERGETLSR Message-ID: <472E3AAF.7050709@gatworks.com> For Linux, it seems that you need the code for both *having* a TIOCSERGETLSR, and *not having* a TIOCSERGETLSR. Maybe the ioctl exists system wide, but not necessarily for the device driver itself ( always returns -1 ) . Are there systems that have a *functioning* TIOCSERGETLSR for all their devices? Then this would be the case where the "#ifndef TIOCSERGETLSR" directive could be useful is eliminating the unnecessary code and tests. And for those systems that dont have a TIOCSERGETLSR, then the code for TIOCSERGETLSR can be eliminated. It would be a simple case to have, as a foundation, all the code to simulate the missing TIOCSERGETLSR ioctl. If the system does have the ioctl, then that code can be ifdef'd in, and co-exist with the functionality of the code that simulates the missing TIOCSERGETLSR ioctl. From racecar at gmail.com Sun Nov 4 17:30:19 2007 From: racecar at gmail.com (Kevin Mateo Lim) Date: Sun, 4 Nov 2007 17:30:19 -0700 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: the README.OSX reads: Put libSerial.jnilib in the directory of the application (the JavaVM will find it there). Add RXTXComm.jar to the application classpath or include the classes in the application jar. (Some applications already include the RXTX classes in their application jar, in which case only the file libSerial.jnilib is required). I can't find libSerial.jnilib I put librxtxSerial.jnilib into my Processing /libraries/serial/library/ directory. Yet it still sees the old version: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 On 11/4/07, Andre-John Mas wrote: > > Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > 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/20071104/c0a83f91/attachment-0005.html From ajmas at sympatico.ca Sun Nov 4 17:41:47 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 19:41:47 -0500 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> If you are wanting it to be available for all applications, - for all users: /Library/Java/Extensions - for your user: ~/Library/Java/Extensions Or just for your application, then it should be in the same directory from which yo are launching your application. If you are getting the 2.1-8 source, then the library built is called: librxtxSerial.jnilib despite what the docs say. Andre On 4-Nov-07, at 19:30 , Kevin Mateo Lim wrote: > > the README.OSX reads: > Put > libSerial.jnilib > in the directory of the application (the JavaVM will find it there). > Add > RXTXComm.jar > to the application classpath or include the classes in the > application jar. > (Some applications already include the RXTX classes in their > application jar, > in which case only the file libSerial.jnilib is required). > > > I can't find libSerial.jnilib > I put librxtxSerial.jnilib into my Processing /libraries/serial/ > library/ directory. > > Yet it still sees the old version: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > On 11/4/07, Andre-John Mas wrote: Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial .(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay (PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > From bschlining at gmail.com Sun Nov 4 19:46:23 2007 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 4 Nov 2007 18:46:23 -0800 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> Message-ID: > > Or just for your application, then it should be in the same directory > from which yo are launching your application. Just wanted to add one more way of specifying the native lib location... If you don't want to define it globally by putting it in /Library/Java/Extensions (and you don't, it's a very very bad practice) you can also specify the location of the native library when starting the JVM by specifying the 'java.library.path' property. For example: java -Djava.library.path=/Path/To/Directory/With/RXTX/Library YourMainClass -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071104/c5af6980/attachment-0005.html From greg.johnson at manchester.ac.uk Mon Nov 5 01:39:02 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Mon, 5 Nov 2007 09:39:02 +0100 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: The 2.1-8 code reports 2.1-7, hence your (and my) confusion. But as long as you've removed all traces of the old library, it really _is_ 2.1-8. And if you specify the library path to the VM, don't make my mistake (on OSX at least) - you need to respecify the entire library path it had by default, as the command line argument replaces the path, rather than appending to it. 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 5 Nov 2007, at 01:30, Kevin Mateo Lim wrote: > > the README.OSX reads: > Put > libSerial.jnilib > in the directory of the application (the JavaVM will find it there). > Add > RXTXComm.jar > to the application classpath or include the classes in the > application jar. > (Some applications already include the RXTX classes in their > application jar, > in which case only the file libSerial.jnilib is required). > > > I can't find libSerial.jnilib > I put librxtxSerial.jnilib into my Processing /libraries/serial/ > library/ directory. > > Yet it still sees the old version: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > On 11/4/07, Andre-John Mas wrote: > Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial .(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay (PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > 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 HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071105/7f50506d/attachment-0005.html From cyrille.dumont at tatexpress.fr Mon Nov 5 05:46:03 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 05 Nov 2007 13:46:03 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: References: <472727F1.1000704@tatexpress.fr> Message-ID: <472F108B.2090101@tatexpress.fr> Thanks a lot for your solution ... but I'm not a expert in JAVA ... (sorry) For the moment I've this function : """ public void serialEvent(SerialPortEvent e) { StringBuffer inputBuffer = new StringBuffer(); int newData = 0; switch (e.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } //-- Manag. Data from Scanner this.MngDataScanner(inputBuffer.toString()); break; case SerialPortEvent.BI:; //-- Break Received } } """ How can I do what you write ? ( maybe a simple ex ? ) PS : I don't know the PDF417 size (could be, for example, 338 char, or 500 ... ; what I know is that it can't be more than 800 char) Thanks in advance. Best regards. Trent Jarvi a ?crit : > 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 Martin.Oberhuber at windriver.com Mon Nov 5 08:47:50 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 5 Nov 2007 16:47:50 +0100 Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> Hi Trent, are the interestes of hobbyists really so different from commercial ones? Both should be interested in high quality and innovation the like. I haven't seen too many Open Source projects from the "inside" but those that I have seen did not have separate mailing lists for quality/testing/qa versus innovation/development. What I have seen with the Open Source projects that one would call "successful" is a good deal of process around automated builds, automated unit tests, predictable release dates and milestones, and policies around commiting/contributing/reviewing changes. I think that all of these benefit commercial users and hobbyists the like. If you were just asking about who's interested in discussing changes to foster more quality, count me in. I'm just not sure whether discussing these on a separate mailing list or other channel is the right thing to do. Cheers, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From toupsz at cs.tamu.edu Tue Nov 6 14:27:04 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 15:27:04 -0600 Subject: [Rxtx] reading TTL level signals from serial? Message-ID: Dear RXTX community- I've been using RXTX to handle communicating with several hardware devices in Java (a GPS and some custom audio circuitry for my dissertation work). I have a new, high-accuracy GPS which only communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there any way to communicate with this device using RXTX, perhaps by modding the native code for Windows? If so, does anyone have any tips on how to do it? Has it perhaps already been done? Another option is for me to invert / amplify the signal in hardware, but this is difficult for me to pull off due to the sensitivity of the electronics involved...I'll likely end up using a much less accurate piece of equipment rather than go that far! If anyone could help out, I'd really appreciate it! Thanks! -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/b6c59c2b/attachment-0003.html From netbeans at gatworks.com Tue Nov 6 14:55:22 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 06 Nov 2007 16:55:22 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: Message-ID: <4730E2CA.3090009@gatworks.com> This is really a hardware issue. Is there any device ( ie the serial port ) on your computer that will accept the voltage signals ( and load ) that your device produces? Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it happen safely ( ie u dont cook the GPS device ) I have a new, high-accuracy GPS which only > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there > any way to communicate with this device using RXTX, From toupsz at cs.tamu.edu Tue Nov 6 15:14:01 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 16:14:01 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4730E2CA.3090009@gatworks.com> References: <4730E2CA.3090009@gatworks.com> Message-ID: Actually, the device runs over USB, but shows up as a virtual serial port and is outputting these signals. The software that comes with the device (a u-blox ANTARIS 4 eval kit) is able to communicate. RXTX is able to detect and properly configure the port, but does not get any of the data from it. :-/ It seems like there must be some way to do it (obviously, ublox knows how)... -Zach On Nov 6, 2007 3:55 PM, U. George wrote: > This is really a hardware issue. > Is there any device ( ie the serial port ) on your computer that will > accept the voltage signals ( and load ) that your device produces? > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it > happen safely ( ie u dont cook the GPS device ) > > > I have a new, high-accuracy GPS which only > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there > > any way to communicate with this device using RXTX, > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/15ae7a0b/attachment-0003.html From keithvz at verizon.net Tue Nov 6 16:16:55 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 06 Nov 2007 18:16:55 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> Message-ID: <4730F5E7.1030704@verizon.net> Zach Toups wrote: > On Nov 6, 2007 3:55 PM, U. George > wrote: > > This is really a hardware issue. > Is there any device ( ie the serial port ) on your computer that will > accept the voltage signals ( and load ) that your device produces? > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it > happen safely ( ie u dont cook the GPS device ) > > > I have a new, high-accuracy GPS which only > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is > there > > any way to communicate with this device using RXTX, > _______________________________________________ As UGeorge intimated, it's a hardware issue. If your device outputs TTL level voltages, and your USB to serial converter is RS-232, then you've got a physical hardware differences. Inverted leads and voltage issues are mainly the problem. MAXIM makes a neat little chip called the MAX233 (better than the 232, no extern caps required) You can't solve this in software. Now, there are TTL level compatible USB to serial converters available, I happen to be using one right now. This unit below is from a UK company (there might be sources in the US) http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm Parallax makes one that does 3.3 and 5v http://www.parallax.com/detail.asp?product_id=32201 (but only supports RX, TX, GND, AND DTR towards device) (i've tested a variant of the unit above, and it works with RXTX) In both cases, you'll need some creative wiring depending on the interface on your GPS. Hope this helps Keith From toupsz at cs.tamu.edu Tue Nov 6 16:53:01 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 17:53:01 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4730F5E7.1030704@verizon.net> References: <4730E2CA.3090009@gatworks.com> <4730F5E7.1030704@verizon.net> Message-ID: Yeah...I used an FTDI chip to handle USB/serial conversion on the audio equipment I built. I'm leery of trying to build a board for this ublox GPS due to all the grounding/shielding issues around it. Anyway, I apreciate the help...just sad that I can't handle the problem in software! Ublox did send me the source code for their USB drivers...but as a Java programmer, it's a bit tough for me to sort out. ;) Thanks again! -Zach On Nov 6, 2007 5:16 PM, Keith Monahan wrote: > Zach Toups wrote: > > > On Nov 6, 2007 3:55 PM, U. George > > wrote: > > > > This is really a hardware issue. > > Is there any device ( ie the serial port ) on your computer that > will > > accept the voltage signals ( and load ) that your device produces? > > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make > it > > happen safely ( ie u dont cook the GPS device ) > > > > > > I have a new, high-accuracy GPS which only > > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is > > there > > > any way to communicate with this device using RXTX, > > _______________________________________________ > > As UGeorge intimated, it's a hardware issue. > > If your device outputs TTL level voltages, and your USB to serial > converter is RS-232, then you've got a physical hardware differences. > Inverted leads and voltage issues are mainly the problem. MAXIM makes a > neat little chip called the MAX233 (better than the 232, no extern caps > required) > > You can't solve this in software. > > Now, there are TTL level compatible USB to serial converters available, > I happen to be using one right now. > > This unit below is from a UK company (there might be sources in the US) > > http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm > > Parallax makes one that does 3.3 and 5v > > http://www.parallax.com/detail.asp?product_id=32201 > (but only supports RX, TX, GND, AND DTR towards device) > > (i've tested a variant of the unit above, and it works with RXTX) > > In both cases, you'll need some creative wiring depending on the > interface on your GPS. > > Hope this helps > > Keith > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/06e88ad4/attachment-0003.html From netbeans at gatworks.com Tue Nov 6 17:14:01 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 06 Nov 2007 19:14:01 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> <4730F5E7.1030704@verizon.net> Message-ID: <47310349.5000406@gatworks.com> what gps chipset do u have? > Ublox did send me the source code for their USB drivers...but as a Java > programmer, it's a bit tough for me to sort out. ;) From Steffen.DETTMER at ingenico.com Wed Nov 7 03:10:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 7 Nov 2007 11:10:01 +0100 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> Message-ID: <20071107101000.GN10978@elberon.bln.de.ingenico.com> * Zach Toups wrote on Tue, Nov 06, 2007 at 16:14 -0600: > Actually, the device runs over USB, but shows up as a virtual > serial port and is outputting these signals. Ahh, so what you want is to use rxtx on the serial port that is created by the driver and mapped maybe as some COM8 or whatever? I this case then IMHO it would be no hardware question but maybe a problem in your application, or some driver or indeed a rxtx issue. > The software that > comes with the device (a u-blox ANTARIS 4 eval kit) is able to > communicate. Is it sure that this software is really using the virtual serial port and only this port? oki, Steffen -- About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Wed Nov 7 04:59:10 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 06:59:10 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <20071107101000.GN10978@elberon.bln.de.ingenico.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> Message-ID: <4731A88E.6080705@gatworks.com> >> The software that >> comes with the device (a u-blox ANTARIS 4 eval kit) is able to >> communicate. > > Is it sure that this software is really using the virtual serial > port and only this port? > I have tried to read the docs. I have yet to find any explanation on a (windoz) device driver for this device ( the usb device ). That magic is not explained. For a developer thats important magic. Maybe a call to their support team is in order? From netbeans at gatworks.com Wed Nov 7 05:01:38 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 07:01:38 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <20071107101000.GN10978@elberon.bln.de.ingenico.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> Message-ID: <4731A922.7@gatworks.com> Steffen DETTMER wrote: > * Zach Toups wrote on Tue, Nov 06, 2007 at 16:14 -0600: >> Actually, the device runs over USB, but shows up as a virtual BTW: it seems that I am not getting all the Rxtx mail. Is there still a problem? From toupsz at cs.tamu.edu Wed Nov 7 07:36:20 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Wed, 7 Nov 2007 08:36:20 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4731A88E.6080705@gatworks.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> <4731A88E.6080705@gatworks.com> Message-ID: When I emailed them about this issue, they sent me their WinCE drivers, which are apparently based on this open source driver: http://www.yetanotherhomepage.com/j7xx/j7xx.html?/j7xx/software/util/usbdriver.html These include srcdll, and x86 subfolders, though it's not 100% clear to me that these are useful. The ublox communication suite appears to only communicate with serial ports...I've communicated with the ublox on two different comm ports (one with the serial adapter plugged into the serial port, one with the main USB connection), as well as a Garmin bluetooth GPS (which comes up as a bluetooth serial device). I'm not well versed in code this close to the hardware, but it seems to me that if you're running a virtual serial port, then you're virtually controlling the "voltages" that come in on this "port"...so why would they be "ttl level"? :-/ Shouldn't the USB driver be able to interpret the signals in whatever way it wants and just supply software with the binary interpretation? Thanks for all the help, guys, it's really appreciated! -Zach On Nov 7, 2007 5:59 AM, U. George wrote: > > >> The software that > >> comes with the device (a u-blox ANTARIS 4 eval kit) is able to > >> communicate. > > > > Is it sure that this software is really using the virtual serial > > port and only this port? > > > > I have tried to read the docs. I have yet to find any explanation on a > (windoz) device driver for this device ( the usb device ). That magic > is not explained. For a developer thats important magic. Maybe a call > to their support team is in order? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071107/18a13314/attachment-0001.html From netbeans at gatworks.com Wed Nov 7 08:55:55 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 10:55:55 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> <4731A88E.6080705@gatworks.com> Message-ID: <4731E00B.9030902@gatworks.com> There are 2 components to talking to hardware. There is the electrical specification, and then there is the software specification. there is the rs232 specification, parallel port specification, and the USB electrical specification. Generally these are used to plug in the various devices, and hook up electrically. Then there is the software side. There is the device driver, a software component that sits somewhere in the kernel that handles the USB ( in your case ) controller. The device driver generally does not care about the electrical component. There are various chips that handle USB signals, and these chips have I/O addresses so that signals and data can be properly routed. There is also the side that communicates to the user via the COM port device-name. The device driver that you mentioned is for the "Support PL2303 serial chip". This device driver, which hopefully works, handles the USB chip, and eventually recognzes the gps device, and hopefully creates an COM port so the user can open up and communicate. These are a lot of "HOPES". Since u have the web address of the device driver, and developer, I would think that the developer, and any docs, might be better able to help u to first determine if the GPS device is recognized, and the COM port ( maybe its called by another name ) is created, as per documentation. > > These include srcdll, and x86 subfolders, though it's not 100% clear to > me that these are useful. From keithvz at verizon.net Thu Nov 1 08:08:58 2007 From: keithvz at verizon.net (Keith) Date: Thu, 01 Nov 2007 10:08:58 -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: <4729DDFA.7080206@verizon.net> Trent Jarvi wrote: > 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? Well, I honestly don't know how all this fits together. I think it's just a matter of enabling the right flow control option within the standard serial framework to tell the device driver, "HEY START USING DTR/DSR FOR FLOW CONTROL." If what UGeorge said,(about that type of nitty-gritty lead control being done within the device driver), is true, then this confirms my suspicion. I tried narrowing down within the Linux drivers what you are looking for, but I can't entirely tell wth I'm looking at. (virtual com port drivers -- they are included compiled by default with Ubuntu, source included) http://www.ftdichip.com/Drivers/VCP/Linux/ftdi_sio.tar.gz Hahahaa, they make a reference to DTR flow control being supported but say (UGH) in parenthesis. You can also use their direct device driver library on Ubuntu -- libftd2xx.so.0.4.13. No source code. http://www.ftdichip.com/Drivers/D2XX/Linux/libftd2xx0.4.13.tar.gz In that case, you make a call to their FT_SetFlowControl() function. FT_STATUS FT_SetFlowControl (FT_HANDLE ftHandle, USHORT usFlowControl, UCHAR uXon,UCHAR uXoff) Parameters ftHandle Handle of the device. usFlowControl Must be one of FT_FLOW_NONE, FT_FLOW_RTS_CTS, ****FT_FLOW_DTR_DSR**** or FT_FLOW_XON_XOFF. uXon Character used to signal Xon. Only used if flow control is FT_FLOW_XON_XOFF. uXoff Character used to signal Xoff. Only used if flow control is FT_FLOW_XON_XOFF. This is from their programming guide http://www.ftdichip.com/Documents/ProgramGuides/D2XXPG34.pdf I actually want to take this a step further and say that I think the flow control is actually handled right on the device itself in hardware/firmware. It's enabled through the device driver, but I think the maintaining of buffers, asserting/deasserting of leads, etc is handled by the device. For the time being, I've switched to jd2xx, https://jd2xx.dev.java.net/ and http://bleyer.org/jd2xx/ These are Java wrappers for the device driver libraries. It allows almost direct access to the well-documented device drivers from Java. I hope this helps Keith From tjarvi at qbang.org Thu Nov 1 11:09:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:09:51 -0600 (MDT) 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: Hi Martin, What I usually have done is allow changes that do not impact working software including changes to methods not documented in CommAPI (which remain undocumented in rxtx) and fixes to known problems in the documented portions. That way if you use the documented API, the releases should only become better with time. If you use the undocumented portions, the behavior is not as predictable but open for improvement. On Wed, 31 Oct 2007, 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 >> > From tjarvi at qbang.org Thu Nov 1 11:15:52 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:15:52 -0600 (MDT) 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: I too use rxtx in commercial products. The problem I've been trying to address while bringing the server back was how to make it possible for hobby folks to build the same software as companies so we can move rxtx along a little faster. Exposing internal tools is not an option at this time, the public rxtx builds have been done on my home machine which has drives hanging out of it all over the place dying one at a time. This isn't maintainable. I'm currently looking at the possibility of making an S3 image available on Amazon's EC. These are machines you can rent for ~10 cents an hour which is more than enough to build rxtx. The S3 image is not changed when people use it so everyone has the same starting point. With this, we could all build rxtx for ~20 platforms for a small price and eliminate tool issues. On Wed, 31 Oct 2007, Greg Johnson wrote: > 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 tjarvi at qbang.org Thu Nov 1 11:19:55 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:19:55 -0600 (MDT) 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: On Wed, 31 Oct 2007, 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. I was helping Dmitry do the Mac OS X port without access to a machine when we put that in. In the archives there is information (easily found with google on Apple's site) that describes how their API (and others) can determine if a port is used and ignore it. I think these changes are in CVS but need to confirm. The bottom line is that rxtx should not have used lock files on Mac. It was just ignorance of the system on my part. -- Trent Jarvi tjarvi at qbang.org From fabioanjos at gmail.com Thu Nov 1 12:35:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Thu, 1 Nov 2007 15:35:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Hi, I was using SerialEventListener in my project. But, as was said here, id doesnt work very well with virtual serial ports. So, I changed the strategy using the code posted here in this thread: try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > 0) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } The thing is that in my tests I could notice that in.read(buffer) never blocks. Even when there's nothing to read. Instead of blocking when there's nothing to read it returns 0. So, my questions are: 1. Am I doing something wrong? 2. If not, wouldnt this decrease performance? (the thread would be locked in a loop that does nothing.) 3. Is there a better way to do the job? Thanks in advance!! F?bio -------- On 10/31/07, Andre-John Mas wrote: > > > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/0aee59d0/attachment-0009.html From ajmas at sympatico.ca Thu Nov 1 16:07:55 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Nov 2007 18:07:55 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Message-ID: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From sarah_662005 at yahoo.com Thu Nov 1 17:10:05 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Thu, 1 Nov 2007 16:10:05 -0700 (PDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Message-ID: <351433.37166.qm@web55814.mail.re3.yahoo.com> Thank you very much for your help. Now the application works fine. the serialEvent gets triggered. Rxtx is cool! ----- Original Message ---- From: Andre-John Mas To: Sara Hugh ; RXTX Developers and Users Sent: Wednesday, October 31, 2007 9:55:45 AM Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered 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 __________________________________________________ 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/20071101/4a86bea6/attachment-0009.html From tjarvi at qbang.org Thu Nov 1 17:58:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 17:58:02 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx Message-ID: The rxtx.org site is primarily interested in the hobby aspects of rxtx. Obviously, there are some companies following the work too. These interests bring larger workflows and concerns about details hobby folks may not care about. They also bring many more users. I know the company I work for has a quality engineering effort going on which includes rxtx. While the server was down, I was contacted by another company that was missing the binaries for their testing. Several people have mentioned concerns about a stable release for like reasons. Would there be interest on the quality side of the coin to get together? It could be just sharing email's with each other or a seperate list for QE/QA. I can not say for sure, but we may be able to share some of our efforts/results that could help keep rxtx releases stable. -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Fri Nov 2 01:42:55 2007 From: scldad at sdc.com.au (Stephen Davies) Date: Fri, 2 Nov 2007 18:12:55 +1030 Subject: [Rxtx] Multiple modems Message-ID: <200711021812.56047.scldad@sdc.com.au> This may or may not be related to the Multiple Ports thread. I have an application which uses rxtx on Linux (via cron jobs) to connect multiple modems to remote sensing devices. The application works fine most of the time but occasionally fails to connect if two (or more) connection attempts happen at about the same time. When it fails, it looks as if it may get confused as to which port it is talking to. The app has a "base" component that looks for an available port, opens it and then creates an input thread and an output thread for the connection and data transfer. The "base" component uses this code: // loop round all known ports until one is available. Give up after three minutes Counter ptimeout = new Counter(); while(!portFound && ptimeout.elapsed() < 180000) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // special case. ttyS0 is not available to us on this server. if (!portId.isCurrentlyOwned() && !portId.getName().equals("/dev/ttyS0")) { gLog.debug(lognm + ": Found port " + portId.getName()); try { serialPort = (RXTXPort) portId.open("AguaModem", 10000); } catch (Exception e) { gLog.error(lognm + ": Port " + portId.getName() + " will not open."); gLog.error(e.getMessage()); continue; } AguaModem aguamodem = new AguaModem(); portFound = true; break; } gLog.debug(lognm + ": Port " + portId.getName() + " is busy"); } } } I am wondering about the isCurrentlyOwned method. Does this actually tell me whether a port is currently being used by another process? TIA, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From fabioanjos at gmail.com Fri Nov 2 04:59:58 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 07:59:58 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Message-ID: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/9009eb1d/attachment-0009.html From netbeans at gatworks.com Fri Nov 2 06:28:13 2007 From: netbeans at gatworks.com (U. George) Date: Fri, 02 Nov 2007 08:28:13 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <472B17DD.1050508@gatworks.com> It should normally block ( unless eof / event ) . so its a :{ whats the device ( to recreate if possible ) and how do u open. > My question is, is there a way to make in.read block the thead until > there's something to read? > From fabioanjos at gmail.com Fri Nov 2 06:34:46 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 09:34:46 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > On 11/1/07, Andre-John Mas wrote: > > > > Fabio, > > > > Turns out there was a small error in my example. The test should be: > > > > (numBytes = in.read(buffer)) > -1 > > > > This is because -1 indicates an end of file (end of data stream) > > > > Andre > > > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > > > Hi, > > > > > > I was using SerialEventListener in my project. But, as was said > > > here, id doesnt work very well with virtual serial ports. > > > So, I changed the strategy using the code posted here in this thread: > > > > > > try{ > > > in = port.getInputStream(); > > > out = port.getOutputStream(); > > > int numBytes = 0; > > > while(active){ > > > > > > byte[] buffer = new byte[10]; > > > > > > while ( (numBytes = in.read(buffer)) > 0) > > > { > > > String dataValue = new String(buffer,0,numBytes); > > > processInput(dataValue); > > > } > > > > > > if(numBytes==-1){ > > > break; > > > } > > > > > > Thread.sleep(50); > > > } > > > > > > }catch(IOException e){ > > > logger.info("falha de comunicacao "+ > > > getReceptor().getPort() ); > > > > > > }catch(InterruptedException e){ > > > logger.info ("Interrompendo leitura da porta "+ > > > getReceptor().getPort() ); > > > } > > > > > > The thing is that in my tests I could notice that in.read(buffer) > > > never blocks. Even when there's nothing to read. Instead of blocking > > > when there's nothing to read it returns 0. > > > > > > So, my questions are: > > > > > > 1. Am I doing something wrong? > > > 2. If not, wouldnt this decrease performance? (the thread would be > > > locked in a loop that does nothing.) > > > 3. Is there a better way to do the job? > > > > > > Thanks in advance!! > > > > > > F?bio > > > -------- > > > > > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > > 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 > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > > > > > -- > > > Atenciosamente, > > > F?bio Cristiano dos Anjos > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/5306c4b1/attachment-0009.html From nick.circelli at infrasafe.com Fri Nov 2 07:01:17 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Fri, 2 Nov 2007 08:01:17 -0500 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com><29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com><90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca><29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Message-ID: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> I'm pretty sure that not blocking has to do with you virtual ports. Cause it should block. Maybe you should try: while ((numBytes = in.available()) > 0) { If (numBytes > buffer.length) { numBytes = buffer.length; // in case you have buffer overflow } numBytes = in.read(buffer, 0 , numBytes)); String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } Also, just for optimization, I'd move that byte[] buffer = new byte[10]; out of the while since you don't need to reallocate it every iteration. ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of F?bio Cristiano dos Anjos Sent: Friday, November 02, 2007 8:35 AM To: RXTX Developers and Users Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream (); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas < ajmas at sympatico.ca > wrote: Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info ("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Atenciosamente, F?bio Cristiano dos Anjos -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/4de7f6a3/attachment-0009.html From fabioanjos at gmail.com Fri Nov 2 07:36:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 10:36:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> Message-ID: <29788b250711020636q1588c88fgaa5e27f5504164fb@mail.gmail.com> Hi Nick, Actually, it doesnt block for physical ports too. And, the method avaiable does not block either, so when there's nothing avaiable the loop ends and the thread stops lintening to the port. But I did some more test with serialEventListener, and now its working. I realy dont know what I've done to get it working. I just start woking as soon as I decided to test it again. It was said here that serialEventListener is not reliable for virtual serial ports. Is there another way to read it, without compromising performance? Tanks again!! F?bio ------- On 11/2/07, Nick Circelli wrote: > > I'm pretty sure that not blocking has to do with you virtual ports. > Cause it should block. > > Maybe you should try: > > > > while ((numBytes = in.available()) > 0) > > { > > If (numBytes > buffer.length) { > > numBytes = buffer.length; // in case you have buffer overflow > > } > > numBytes = in.read(buffer, 0 , numBytes)); > > String dataValue = new String(buffer,0,numBytes,"ASCII"); > > processInput(dataValue); > > } > > > > Also, just for optimization, I'd move that byte[] buffer = new > byte[10]; > > out of the while since you don't need to reallocate it every iteration. > > > ------------------------------ > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On Behalf > Of *F?bio Cristiano dos Anjos > *Sent:* Friday, November 02, 2007 8:35 AM > *To:* RXTX Developers and Users > *Subject:* Re: [Rxtx] serialEvent(SerialPortEvent event) never be > triggered > > > > Hi, > > I think i missunderstand something here. > The code you post here was meant to be used inside serialEvent method, > right? > > The think is, that i cannot user SerialEventListener to read serial ports, > because i need to read virual serial ports and id does not behaves well, as > said here before. serialEvent is never triggered. > > So what I quit using SerialEventListener and created a thread to listen to > the port: > > public void run(){ > try{ > in = port.getInputStream(); > out = port.getOutputStream (); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new > String(buffer,0,numBytes,"ASCII"); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ getReceptor().getPort() > ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > } > > > So, the problem is that in.read(buffer) always returns 0 when there is > nothing to read, instead of blocking the flow, and the thread becames locked > in the loop. > > I hope you can help me solve this. > > Thanks in advance! > > F?bio > -------- > > On 11/2/07, *F?bio Cristiano dos Anjos* wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > > > On 11/1/07, *Andre-John Mas* < ajmas at sympatico.ca> wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info ("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/571df6ea/attachment-0008.html From tjarvi at qbang.org Fri Nov 2 08:32:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Nov 2007 08:32:15 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: References: Message-ID: On Fri, 2 Nov 2007, Greg Johnson wrote: > Hi Trent, folks, > Having a single rxtx that is suitable for commercial uses and hobbyists both > would be a great idea? Perhaps it would be worth submitting rxtx as a > proposal to Codehaus - they not only provide excellent tools (Jira (bug > tracker), Confluence (wiki)) but also support build management ( > maestro, continuum, bamboo). Relying on your personal machine (btw, frii.com > / rxtx.org is down again?) seems like a burden you shouldn't have to shoulder > alone. Hi Greg, There may be a little confusion here. There is no need to have two seperate rxtx releases. What I'm trying to encourage is a discussion between some of the people responsible for making sure rxtx does not break their products each release. Usually these people are interested in testing a set of functionality their product depends upon. They do not work with rxtx code but rather traps to catch when rxtx developers break something. This goes on all the time in isolated labs. There are many services that offer to do various pieces of a project for you if you... Anyone is free to do the 'if you' portion with rxtx and see how it goes. I'm actually interested in doing less of that than more. The rxtx.org work I do just happens to overlap with other things I do for personal/family use. The reason I suggest the amazon solution is that anyone can take full control of the environment for a day and it costs less than a package of gum without causing harm to what anyone else is doing. I assume the down question was with respect to a mod_security setting that has been resolved. If not, please post a url to the problem. -- Trent Jarvi tjarvi at qbang.org From nsayer at kfu.com Sat Nov 3 20:17:49 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 19:17:49 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? Message-ID: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Has anyone got RXTX working with an app under Leopard? My app hangs on port open (it works fine with Tiger). The relevant thread looks like this in the activity monitor: 1536 JVM_InvokeMethod 1536 0x48ccd0 1536 0x46f8a0 1536 0x4c3ff4 1536 0x4c4284 1536 0x357d160 1536 0x357faac 1536 Java_gnu_io_RXTXPort_open 1536 open $NOCANCEL$UNIX2003 1536 open $NOCANCEL$UNIX2003 From ajmas at sympatico.ca Sat Nov 3 22:02:04 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 00:02:04 -0400 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> RXTX works for me with Leopard. I am currently using it communicate with a Bluetooth GPS. What computer and device are you trying to use? Is the driver for your serial device compatible with MacOS X 10.5? Andre On 3-Nov-07, at 22:17 , Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From nsayer at kfu.com Sat Nov 3 22:17:47 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 21:17:47 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> Message-ID: <1720F723-3643-438C-B3AB-E09A67536977@kfu.com> On Nov 3, 2007, at 9:02 PM, Andre-John Mas wrote: > RXTX works for me with Leopard. I am currently using it communicate > with a Bluetooth GPS. > > What computer and device are you trying to use? Is the driver for > your serial device compatible with MacOS X 10.5? An Intel mac mini The FTDI USB serial driver an XMPCR, which is just a fancy serial controlled radio and an FTDI usb-to-serial chip I've successfully used the FTDI driver with another FTDI device in another context. > > > Andre > > On 3-Nov-07, at 22:17 , Nick Sayer wrote: > >> Has anyone got RXTX working with an app under Leopard? >> >> My app hangs on port open (it works fine with Tiger). The relevant >> thread looks like this in the activity monitor: >> >> 1536 JVM_InvokeMethod >> 1536 0x48ccd0 >> 1536 0x46f8a0 >> 1536 0x4c3ff4 >> 1536 0x4c4284 >> 1536 0x357d160 >> 1536 0x357faac >> 1536 >> Java_gnu_io_RXTXPort_open >> 1536 open >> $NOCANCEL$UNIX2003 >> 1536 open >> $NOCANCEL$UNIX2003 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From racecar at gmail.com Sat Nov 3 22:25:53 2007 From: racecar at gmail.com (Kevin Mateo Lim) Date: Sat, 3 Nov 2007 21:25:53 -0700 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: Message-ID: I am alternating between two errors. After i run the macosx_setup.command, "everyone" is set to Read only in /var/lock. I notice in the terminal that the group for these perms is _uucp, not uucp. In that state, I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 check_group_uucp(): error testing lock file creation Error details:Permission deniedcheck_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException : Error inside Serial.() at processing.serial.Serial.errorMessage(Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.( Serial.java:102) at Temporary_829_3245.setup(Temporary_829_3245.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java :690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) Then, I hand edit the "everyone" permissions for /var/lock/ to Read and Write (note /var/spool/uucp is Read/Write in all cases, and doesn't change). I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX uucp_lock() /var/lock/LK.003.009.000 is there gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException: Error inside Serial.() at processing.serial.Serial.errorMessage (Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.(Serial.java:102) at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java:690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) See here: http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071103/f1a2c467/attachment-0007.html From greg.johnson at manchester.ac.uk Sun Nov 4 02:31:13 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sun, 4 Nov 2007 10:31:13 +0100 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <28B5E0A0-0802-4C74-AC21-87ED35F3B9A2@manchester.ac.uk> Hi Nick, I also had problems initially with Leopard, but it was resolved by reinstalling the serial USB driver (FTDI in my case). The symptoms were a non-detection of any ports (but I twigged when I tried ZTerm and it had the same problem). Good luck! Cheers, greg PS I did a "Archive and install" which may be the reason my FTDI driver had disappeared - I don't think the driver has changed for 10.5 ------------------------------------------------------------------------- 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 4 Nov 2007, at 03:17, Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Sun Nov 4 13:01:12 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 15:01:12 -0500 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: Message-ID: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Hi, You will need to get the 2.1-8 code from CVS. See the FAQ for more information: http://rxtx.qbang.org/wiki/index.php/FAQ Andre On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > I am alternating between two errors. > > After i run the macosx_setup.command, "everyone" is set to Read only > in /var/lock. I notice in the terminal that the group for these > perms is _uucp, not uucp. > > In that state, I get this error: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > check_group_uucp(): error testing lock file creation Error > details:Permission deniedcheck_lock_status: No permission to create > lock file. > please see: How can I use Lock Files with rxtx? in INSTALL > gnu.io.PortInUseException: Unknown Application > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > java.lang.RuntimeException : Error inside Serial.() > > at processing.serial.Serial.errorMessage(Serial.java:583) > > at processing.serial.Serial.(Serial.java:148) > > at processing.serial.Serial.( Serial.java:102) > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > at processing.core.PApplet.run(PApplet.java:1556) > > at java.lang.Thread.run(Thread.java:613) > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > and Write (note /var/spool/uucp is Read/Write in all cases, and > doesn't change). I get this error: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > gnu.io.PortInUseException: Unknown Application > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > java.lang.RuntimeException: Error inside Serial.() > > at processing.serial.Serial.errorMessage (Serial.java:583) > > at processing.serial.Serial.(Serial.java:148) > > at processing.serial.Serial.(Serial.java:102) > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > at processing.core.PApplet.run(PApplet.java:1556) > > at java.lang.Thread.run(Thread.java:613) > > See here: > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From netbeans at gatworks.com Sun Nov 4 14:33:35 2007 From: netbeans at gatworks.com (U. George) Date: Sun, 04 Nov 2007 16:33:35 -0500 Subject: [Rxtx] #ifndef TIOCSERGETLSR Message-ID: <472E3AAF.7050709@gatworks.com> For Linux, it seems that you need the code for both *having* a TIOCSERGETLSR, and *not having* a TIOCSERGETLSR. Maybe the ioctl exists system wide, but not necessarily for the device driver itself ( always returns -1 ) . Are there systems that have a *functioning* TIOCSERGETLSR for all their devices? Then this would be the case where the "#ifndef TIOCSERGETLSR" directive could be useful is eliminating the unnecessary code and tests. And for those systems that dont have a TIOCSERGETLSR, then the code for TIOCSERGETLSR can be eliminated. It would be a simple case to have, as a foundation, all the code to simulate the missing TIOCSERGETLSR ioctl. If the system does have the ioctl, then that code can be ifdef'd in, and co-exist with the functionality of the code that simulates the missing TIOCSERGETLSR ioctl. From racecar at gmail.com Sun Nov 4 17:30:19 2007 From: racecar at gmail.com (Kevin Mateo Lim) Date: Sun, 4 Nov 2007 17:30:19 -0700 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: the README.OSX reads: Put libSerial.jnilib in the directory of the application (the JavaVM will find it there). Add RXTXComm.jar to the application classpath or include the classes in the application jar. (Some applications already include the RXTX classes in their application jar, in which case only the file libSerial.jnilib is required). I can't find libSerial.jnilib I put librxtxSerial.jnilib into my Processing /libraries/serial/library/ directory. Yet it still sees the old version: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 On 11/4/07, Andre-John Mas wrote: > > Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > 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/20071104/c0a83f91/attachment-0006.html From ajmas at sympatico.ca Sun Nov 4 17:41:47 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 19:41:47 -0500 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> If you are wanting it to be available for all applications, - for all users: /Library/Java/Extensions - for your user: ~/Library/Java/Extensions Or just for your application, then it should be in the same directory from which yo are launching your application. If you are getting the 2.1-8 source, then the library built is called: librxtxSerial.jnilib despite what the docs say. Andre On 4-Nov-07, at 19:30 , Kevin Mateo Lim wrote: > > the README.OSX reads: > Put > libSerial.jnilib > in the directory of the application (the JavaVM will find it there). > Add > RXTXComm.jar > to the application classpath or include the classes in the > application jar. > (Some applications already include the RXTX classes in their > application jar, > in which case only the file libSerial.jnilib is required). > > > I can't find libSerial.jnilib > I put librxtxSerial.jnilib into my Processing /libraries/serial/ > library/ directory. > > Yet it still sees the old version: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > On 11/4/07, Andre-John Mas wrote: Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial .(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay (PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > From bschlining at gmail.com Sun Nov 4 19:46:23 2007 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 4 Nov 2007 18:46:23 -0800 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> Message-ID: > > Or just for your application, then it should be in the same directory > from which yo are launching your application. Just wanted to add one more way of specifying the native lib location... If you don't want to define it globally by putting it in /Library/Java/Extensions (and you don't, it's a very very bad practice) you can also specify the location of the native library when starting the JVM by specifying the 'java.library.path' property. For example: java -Djava.library.path=/Path/To/Directory/With/RXTX/Library YourMainClass -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071104/c5af6980/attachment-0006.html From greg.johnson at manchester.ac.uk Mon Nov 5 01:39:02 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Mon, 5 Nov 2007 09:39:02 +0100 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: The 2.1-8 code reports 2.1-7, hence your (and my) confusion. But as long as you've removed all traces of the old library, it really _is_ 2.1-8. And if you specify the library path to the VM, don't make my mistake (on OSX at least) - you need to respecify the entire library path it had by default, as the command line argument replaces the path, rather than appending to it. 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 5 Nov 2007, at 01:30, Kevin Mateo Lim wrote: > > the README.OSX reads: > Put > libSerial.jnilib > in the directory of the application (the JavaVM will find it there). > Add > RXTXComm.jar > to the application classpath or include the classes in the > application jar. > (Some applications already include the RXTX classes in their > application jar, > in which case only the file libSerial.jnilib is required). > > > I can't find libSerial.jnilib > I put librxtxSerial.jnilib into my Processing /libraries/serial/ > library/ directory. > > Yet it still sees the old version: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > On 11/4/07, Andre-John Mas wrote: > Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial .(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay (PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > 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 HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071105/7f50506d/attachment-0006.html From cyrille.dumont at tatexpress.fr Mon Nov 5 05:46:03 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 05 Nov 2007 13:46:03 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: References: <472727F1.1000704@tatexpress.fr> Message-ID: <472F108B.2090101@tatexpress.fr> Thanks a lot for your solution ... but I'm not a expert in JAVA ... (sorry) For the moment I've this function : """ public void serialEvent(SerialPortEvent e) { StringBuffer inputBuffer = new StringBuffer(); int newData = 0; switch (e.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } //-- Manag. Data from Scanner this.MngDataScanner(inputBuffer.toString()); break; case SerialPortEvent.BI:; //-- Break Received } } """ How can I do what you write ? ( maybe a simple ex ? ) PS : I don't know the PDF417 size (could be, for example, 338 char, or 500 ... ; what I know is that it can't be more than 800 char) Thanks in advance. Best regards. Trent Jarvi a ?crit : > 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 Martin.Oberhuber at windriver.com Mon Nov 5 08:47:50 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 5 Nov 2007 16:47:50 +0100 Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> Hi Trent, are the interestes of hobbyists really so different from commercial ones? Both should be interested in high quality and innovation the like. I haven't seen too many Open Source projects from the "inside" but those that I have seen did not have separate mailing lists for quality/testing/qa versus innovation/development. What I have seen with the Open Source projects that one would call "successful" is a good deal of process around automated builds, automated unit tests, predictable release dates and milestones, and policies around commiting/contributing/reviewing changes. I think that all of these benefit commercial users and hobbyists the like. If you were just asking about who's interested in discussing changes to foster more quality, count me in. I'm just not sure whether discussing these on a separate mailing list or other channel is the right thing to do. Cheers, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From toupsz at cs.tamu.edu Tue Nov 6 14:27:04 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 15:27:04 -0600 Subject: [Rxtx] reading TTL level signals from serial? Message-ID: Dear RXTX community- I've been using RXTX to handle communicating with several hardware devices in Java (a GPS and some custom audio circuitry for my dissertation work). I have a new, high-accuracy GPS which only communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there any way to communicate with this device using RXTX, perhaps by modding the native code for Windows? If so, does anyone have any tips on how to do it? Has it perhaps already been done? Another option is for me to invert / amplify the signal in hardware, but this is difficult for me to pull off due to the sensitivity of the electronics involved...I'll likely end up using a much less accurate piece of equipment rather than go that far! If anyone could help out, I'd really appreciate it! Thanks! -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/b6c59c2b/attachment-0004.html From netbeans at gatworks.com Tue Nov 6 14:55:22 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 06 Nov 2007 16:55:22 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: Message-ID: <4730E2CA.3090009@gatworks.com> This is really a hardware issue. Is there any device ( ie the serial port ) on your computer that will accept the voltage signals ( and load ) that your device produces? Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it happen safely ( ie u dont cook the GPS device ) I have a new, high-accuracy GPS which only > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there > any way to communicate with this device using RXTX, From toupsz at cs.tamu.edu Tue Nov 6 15:14:01 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 16:14:01 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4730E2CA.3090009@gatworks.com> References: <4730E2CA.3090009@gatworks.com> Message-ID: Actually, the device runs over USB, but shows up as a virtual serial port and is outputting these signals. The software that comes with the device (a u-blox ANTARIS 4 eval kit) is able to communicate. RXTX is able to detect and properly configure the port, but does not get any of the data from it. :-/ It seems like there must be some way to do it (obviously, ublox knows how)... -Zach On Nov 6, 2007 3:55 PM, U. George wrote: > This is really a hardware issue. > Is there any device ( ie the serial port ) on your computer that will > accept the voltage signals ( and load ) that your device produces? > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it > happen safely ( ie u dont cook the GPS device ) > > > I have a new, high-accuracy GPS which only > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there > > any way to communicate with this device using RXTX, > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/15ae7a0b/attachment-0004.html From keithvz at verizon.net Tue Nov 6 16:16:55 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 06 Nov 2007 18:16:55 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> Message-ID: <4730F5E7.1030704@verizon.net> Zach Toups wrote: > On Nov 6, 2007 3:55 PM, U. George > wrote: > > This is really a hardware issue. > Is there any device ( ie the serial port ) on your computer that will > accept the voltage signals ( and load ) that your device produces? > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it > happen safely ( ie u dont cook the GPS device ) > > > I have a new, high-accuracy GPS which only > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is > there > > any way to communicate with this device using RXTX, > _______________________________________________ As UGeorge intimated, it's a hardware issue. If your device outputs TTL level voltages, and your USB to serial converter is RS-232, then you've got a physical hardware differences. Inverted leads and voltage issues are mainly the problem. MAXIM makes a neat little chip called the MAX233 (better than the 232, no extern caps required) You can't solve this in software. Now, there are TTL level compatible USB to serial converters available, I happen to be using one right now. This unit below is from a UK company (there might be sources in the US) http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm Parallax makes one that does 3.3 and 5v http://www.parallax.com/detail.asp?product_id=32201 (but only supports RX, TX, GND, AND DTR towards device) (i've tested a variant of the unit above, and it works with RXTX) In both cases, you'll need some creative wiring depending on the interface on your GPS. Hope this helps Keith From toupsz at cs.tamu.edu Tue Nov 6 16:53:01 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 17:53:01 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4730F5E7.1030704@verizon.net> References: <4730E2CA.3090009@gatworks.com> <4730F5E7.1030704@verizon.net> Message-ID: Yeah...I used an FTDI chip to handle USB/serial conversion on the audio equipment I built. I'm leery of trying to build a board for this ublox GPS due to all the grounding/shielding issues around it. Anyway, I apreciate the help...just sad that I can't handle the problem in software! Ublox did send me the source code for their USB drivers...but as a Java programmer, it's a bit tough for me to sort out. ;) Thanks again! -Zach On Nov 6, 2007 5:16 PM, Keith Monahan wrote: > Zach Toups wrote: > > > On Nov 6, 2007 3:55 PM, U. George > > wrote: > > > > This is really a hardware issue. > > Is there any device ( ie the serial port ) on your computer that > will > > accept the voltage signals ( and load ) that your device produces? > > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make > it > > happen safely ( ie u dont cook the GPS device ) > > > > > > I have a new, high-accuracy GPS which only > > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is > > there > > > any way to communicate with this device using RXTX, > > _______________________________________________ > > As UGeorge intimated, it's a hardware issue. > > If your device outputs TTL level voltages, and your USB to serial > converter is RS-232, then you've got a physical hardware differences. > Inverted leads and voltage issues are mainly the problem. MAXIM makes a > neat little chip called the MAX233 (better than the 232, no extern caps > required) > > You can't solve this in software. > > Now, there are TTL level compatible USB to serial converters available, > I happen to be using one right now. > > This unit below is from a UK company (there might be sources in the US) > > http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm > > Parallax makes one that does 3.3 and 5v > > http://www.parallax.com/detail.asp?product_id=32201 > (but only supports RX, TX, GND, AND DTR towards device) > > (i've tested a variant of the unit above, and it works with RXTX) > > In both cases, you'll need some creative wiring depending on the > interface on your GPS. > > Hope this helps > > Keith > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/06e88ad4/attachment-0004.html From netbeans at gatworks.com Tue Nov 6 17:14:01 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 06 Nov 2007 19:14:01 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> <4730F5E7.1030704@verizon.net> Message-ID: <47310349.5000406@gatworks.com> what gps chipset do u have? > Ublox did send me the source code for their USB drivers...but as a Java > programmer, it's a bit tough for me to sort out. ;) From Steffen.DETTMER at ingenico.com Wed Nov 7 03:10:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 7 Nov 2007 11:10:01 +0100 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> Message-ID: <20071107101000.GN10978@elberon.bln.de.ingenico.com> * Zach Toups wrote on Tue, Nov 06, 2007 at 16:14 -0600: > Actually, the device runs over USB, but shows up as a virtual > serial port and is outputting these signals. Ahh, so what you want is to use rxtx on the serial port that is created by the driver and mapped maybe as some COM8 or whatever? I this case then IMHO it would be no hardware question but maybe a problem in your application, or some driver or indeed a rxtx issue. > The software that > comes with the device (a u-blox ANTARIS 4 eval kit) is able to > communicate. Is it sure that this software is really using the virtual serial port and only this port? oki, Steffen -- About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Wed Nov 7 04:59:10 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 06:59:10 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <20071107101000.GN10978@elberon.bln.de.ingenico.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> Message-ID: <4731A88E.6080705@gatworks.com> >> The software that >> comes with the device (a u-blox ANTARIS 4 eval kit) is able to >> communicate. > > Is it sure that this software is really using the virtual serial > port and only this port? > I have tried to read the docs. I have yet to find any explanation on a (windoz) device driver for this device ( the usb device ). That magic is not explained. For a developer thats important magic. Maybe a call to their support team is in order? From netbeans at gatworks.com Wed Nov 7 05:01:38 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 07:01:38 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <20071107101000.GN10978@elberon.bln.de.ingenico.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> Message-ID: <4731A922.7@gatworks.com> Steffen DETTMER wrote: > * Zach Toups wrote on Tue, Nov 06, 2007 at 16:14 -0600: >> Actually, the device runs over USB, but shows up as a virtual BTW: it seems that I am not getting all the Rxtx mail. Is there still a problem? From toupsz at cs.tamu.edu Wed Nov 7 07:36:20 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Wed, 7 Nov 2007 08:36:20 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4731A88E.6080705@gatworks.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> <4731A88E.6080705@gatworks.com> Message-ID: When I emailed them about this issue, they sent me their WinCE drivers, which are apparently based on this open source driver: http://www.yetanotherhomepage.com/j7xx/j7xx.html?/j7xx/software/util/usbdriver.html These include srcdll, and x86 subfolders, though it's not 100% clear to me that these are useful. The ublox communication suite appears to only communicate with serial ports...I've communicated with the ublox on two different comm ports (one with the serial adapter plugged into the serial port, one with the main USB connection), as well as a Garmin bluetooth GPS (which comes up as a bluetooth serial device). I'm not well versed in code this close to the hardware, but it seems to me that if you're running a virtual serial port, then you're virtually controlling the "voltages" that come in on this "port"...so why would they be "ttl level"? :-/ Shouldn't the USB driver be able to interpret the signals in whatever way it wants and just supply software with the binary interpretation? Thanks for all the help, guys, it's really appreciated! -Zach On Nov 7, 2007 5:59 AM, U. George wrote: > > >> The software that > >> comes with the device (a u-blox ANTARIS 4 eval kit) is able to > >> communicate. > > > > Is it sure that this software is really using the virtual serial > > port and only this port? > > > > I have tried to read the docs. I have yet to find any explanation on a > (windoz) device driver for this device ( the usb device ). That magic > is not explained. For a developer thats important magic. Maybe a call > to their support team is in order? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071107/18a13314/attachment-0002.html From netbeans at gatworks.com Wed Nov 7 08:55:55 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 10:55:55 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> <4731A88E.6080705@gatworks.com> Message-ID: <4731E00B.9030902@gatworks.com> There are 2 components to talking to hardware. There is the electrical specification, and then there is the software specification. there is the rs232 specification, parallel port specification, and the USB electrical specification. Generally these are used to plug in the various devices, and hook up electrically. Then there is the software side. There is the device driver, a software component that sits somewhere in the kernel that handles the USB ( in your case ) controller. The device driver generally does not care about the electrical component. There are various chips that handle USB signals, and these chips have I/O addresses so that signals and data can be properly routed. There is also the side that communicates to the user via the COM port device-name. The device driver that you mentioned is for the "Support PL2303 serial chip". This device driver, which hopefully works, handles the USB chip, and eventually recognzes the gps device, and hopefully creates an COM port so the user can open up and communicate. These are a lot of "HOPES". Since u have the web address of the device driver, and developer, I would think that the developer, and any docs, might be better able to help u to first determine if the GPS device is recognized, and the COM port ( maybe its called by another name ) is created, as per documentation. > > These include srcdll, and x86 subfolders, though it's not 100% clear to > me that these are useful. From keithvz at verizon.net Thu Nov 1 08:08:58 2007 From: keithvz at verizon.net (Keith) Date: Thu, 01 Nov 2007 10:08:58 -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: <4729DDFA.7080206@verizon.net> Trent Jarvi wrote: > 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? Well, I honestly don't know how all this fits together. I think it's just a matter of enabling the right flow control option within the standard serial framework to tell the device driver, "HEY START USING DTR/DSR FOR FLOW CONTROL." If what UGeorge said,(about that type of nitty-gritty lead control being done within the device driver), is true, then this confirms my suspicion. I tried narrowing down within the Linux drivers what you are looking for, but I can't entirely tell wth I'm looking at. (virtual com port drivers -- they are included compiled by default with Ubuntu, source included) http://www.ftdichip.com/Drivers/VCP/Linux/ftdi_sio.tar.gz Hahahaa, they make a reference to DTR flow control being supported but say (UGH) in parenthesis. You can also use their direct device driver library on Ubuntu -- libftd2xx.so.0.4.13. No source code. http://www.ftdichip.com/Drivers/D2XX/Linux/libftd2xx0.4.13.tar.gz In that case, you make a call to their FT_SetFlowControl() function. FT_STATUS FT_SetFlowControl (FT_HANDLE ftHandle, USHORT usFlowControl, UCHAR uXon,UCHAR uXoff) Parameters ftHandle Handle of the device. usFlowControl Must be one of FT_FLOW_NONE, FT_FLOW_RTS_CTS, ****FT_FLOW_DTR_DSR**** or FT_FLOW_XON_XOFF. uXon Character used to signal Xon. Only used if flow control is FT_FLOW_XON_XOFF. uXoff Character used to signal Xoff. Only used if flow control is FT_FLOW_XON_XOFF. This is from their programming guide http://www.ftdichip.com/Documents/ProgramGuides/D2XXPG34.pdf I actually want to take this a step further and say that I think the flow control is actually handled right on the device itself in hardware/firmware. It's enabled through the device driver, but I think the maintaining of buffers, asserting/deasserting of leads, etc is handled by the device. For the time being, I've switched to jd2xx, https://jd2xx.dev.java.net/ and http://bleyer.org/jd2xx/ These are Java wrappers for the device driver libraries. It allows almost direct access to the well-documented device drivers from Java. I hope this helps Keith From tjarvi at qbang.org Thu Nov 1 11:09:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:09:51 -0600 (MDT) 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: Hi Martin, What I usually have done is allow changes that do not impact working software including changes to methods not documented in CommAPI (which remain undocumented in rxtx) and fixes to known problems in the documented portions. That way if you use the documented API, the releases should only become better with time. If you use the undocumented portions, the behavior is not as predictable but open for improvement. On Wed, 31 Oct 2007, 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 >> > From tjarvi at qbang.org Thu Nov 1 11:15:52 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:15:52 -0600 (MDT) 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: I too use rxtx in commercial products. The problem I've been trying to address while bringing the server back was how to make it possible for hobby folks to build the same software as companies so we can move rxtx along a little faster. Exposing internal tools is not an option at this time, the public rxtx builds have been done on my home machine which has drives hanging out of it all over the place dying one at a time. This isn't maintainable. I'm currently looking at the possibility of making an S3 image available on Amazon's EC. These are machines you can rent for ~10 cents an hour which is more than enough to build rxtx. The S3 image is not changed when people use it so everyone has the same starting point. With this, we could all build rxtx for ~20 platforms for a small price and eliminate tool issues. On Wed, 31 Oct 2007, Greg Johnson wrote: > 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 tjarvi at qbang.org Thu Nov 1 11:19:55 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:19:55 -0600 (MDT) 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: On Wed, 31 Oct 2007, 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. I was helping Dmitry do the Mac OS X port without access to a machine when we put that in. In the archives there is information (easily found with google on Apple's site) that describes how their API (and others) can determine if a port is used and ignore it. I think these changes are in CVS but need to confirm. The bottom line is that rxtx should not have used lock files on Mac. It was just ignorance of the system on my part. -- Trent Jarvi tjarvi at qbang.org From fabioanjos at gmail.com Thu Nov 1 12:35:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Thu, 1 Nov 2007 15:35:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Hi, I was using SerialEventListener in my project. But, as was said here, id doesnt work very well with virtual serial ports. So, I changed the strategy using the code posted here in this thread: try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > 0) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } The thing is that in my tests I could notice that in.read(buffer) never blocks. Even when there's nothing to read. Instead of blocking when there's nothing to read it returns 0. So, my questions are: 1. Am I doing something wrong? 2. If not, wouldnt this decrease performance? (the thread would be locked in a loop that does nothing.) 3. Is there a better way to do the job? Thanks in advance!! F?bio -------- On 10/31/07, Andre-John Mas wrote: > > > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/0aee59d0/attachment-0010.html From ajmas at sympatico.ca Thu Nov 1 16:07:55 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Nov 2007 18:07:55 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Message-ID: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From sarah_662005 at yahoo.com Thu Nov 1 17:10:05 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Thu, 1 Nov 2007 16:10:05 -0700 (PDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Message-ID: <351433.37166.qm@web55814.mail.re3.yahoo.com> Thank you very much for your help. Now the application works fine. the serialEvent gets triggered. Rxtx is cool! ----- Original Message ---- From: Andre-John Mas To: Sara Hugh ; RXTX Developers and Users Sent: Wednesday, October 31, 2007 9:55:45 AM Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered 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 __________________________________________________ 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/20071101/4a86bea6/attachment-0010.html From tjarvi at qbang.org Thu Nov 1 17:58:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 17:58:02 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx Message-ID: The rxtx.org site is primarily interested in the hobby aspects of rxtx. Obviously, there are some companies following the work too. These interests bring larger workflows and concerns about details hobby folks may not care about. They also bring many more users. I know the company I work for has a quality engineering effort going on which includes rxtx. While the server was down, I was contacted by another company that was missing the binaries for their testing. Several people have mentioned concerns about a stable release for like reasons. Would there be interest on the quality side of the coin to get together? It could be just sharing email's with each other or a seperate list for QE/QA. I can not say for sure, but we may be able to share some of our efforts/results that could help keep rxtx releases stable. -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Fri Nov 2 01:42:55 2007 From: scldad at sdc.com.au (Stephen Davies) Date: Fri, 2 Nov 2007 18:12:55 +1030 Subject: [Rxtx] Multiple modems Message-ID: <200711021812.56047.scldad@sdc.com.au> This may or may not be related to the Multiple Ports thread. I have an application which uses rxtx on Linux (via cron jobs) to connect multiple modems to remote sensing devices. The application works fine most of the time but occasionally fails to connect if two (or more) connection attempts happen at about the same time. When it fails, it looks as if it may get confused as to which port it is talking to. The app has a "base" component that looks for an available port, opens it and then creates an input thread and an output thread for the connection and data transfer. The "base" component uses this code: // loop round all known ports until one is available. Give up after three minutes Counter ptimeout = new Counter(); while(!portFound && ptimeout.elapsed() < 180000) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // special case. ttyS0 is not available to us on this server. if (!portId.isCurrentlyOwned() && !portId.getName().equals("/dev/ttyS0")) { gLog.debug(lognm + ": Found port " + portId.getName()); try { serialPort = (RXTXPort) portId.open("AguaModem", 10000); } catch (Exception e) { gLog.error(lognm + ": Port " + portId.getName() + " will not open."); gLog.error(e.getMessage()); continue; } AguaModem aguamodem = new AguaModem(); portFound = true; break; } gLog.debug(lognm + ": Port " + portId.getName() + " is busy"); } } } I am wondering about the isCurrentlyOwned method. Does this actually tell me whether a port is currently being used by another process? TIA, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From fabioanjos at gmail.com Fri Nov 2 04:59:58 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 07:59:58 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Message-ID: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/9009eb1d/attachment-0010.html From netbeans at gatworks.com Fri Nov 2 06:28:13 2007 From: netbeans at gatworks.com (U. George) Date: Fri, 02 Nov 2007 08:28:13 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <472B17DD.1050508@gatworks.com> It should normally block ( unless eof / event ) . so its a :{ whats the device ( to recreate if possible ) and how do u open. > My question is, is there a way to make in.read block the thead until > there's something to read? > From fabioanjos at gmail.com Fri Nov 2 06:34:46 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 09:34:46 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > On 11/1/07, Andre-John Mas wrote: > > > > Fabio, > > > > Turns out there was a small error in my example. The test should be: > > > > (numBytes = in.read(buffer)) > -1 > > > > This is because -1 indicates an end of file (end of data stream) > > > > Andre > > > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > > > Hi, > > > > > > I was using SerialEventListener in my project. But, as was said > > > here, id doesnt work very well with virtual serial ports. > > > So, I changed the strategy using the code posted here in this thread: > > > > > > try{ > > > in = port.getInputStream(); > > > out = port.getOutputStream(); > > > int numBytes = 0; > > > while(active){ > > > > > > byte[] buffer = new byte[10]; > > > > > > while ( (numBytes = in.read(buffer)) > 0) > > > { > > > String dataValue = new String(buffer,0,numBytes); > > > processInput(dataValue); > > > } > > > > > > if(numBytes==-1){ > > > break; > > > } > > > > > > Thread.sleep(50); > > > } > > > > > > }catch(IOException e){ > > > logger.info("falha de comunicacao "+ > > > getReceptor().getPort() ); > > > > > > }catch(InterruptedException e){ > > > logger.info ("Interrompendo leitura da porta "+ > > > getReceptor().getPort() ); > > > } > > > > > > The thing is that in my tests I could notice that in.read(buffer) > > > never blocks. Even when there's nothing to read. Instead of blocking > > > when there's nothing to read it returns 0. > > > > > > So, my questions are: > > > > > > 1. Am I doing something wrong? > > > 2. If not, wouldnt this decrease performance? (the thread would be > > > locked in a loop that does nothing.) > > > 3. Is there a better way to do the job? > > > > > > Thanks in advance!! > > > > > > F?bio > > > -------- > > > > > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > > 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 > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > > > > > -- > > > Atenciosamente, > > > F?bio Cristiano dos Anjos > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/5306c4b1/attachment-0010.html From nick.circelli at infrasafe.com Fri Nov 2 07:01:17 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Fri, 2 Nov 2007 08:01:17 -0500 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com><29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com><90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca><29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Message-ID: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> I'm pretty sure that not blocking has to do with you virtual ports. Cause it should block. Maybe you should try: while ((numBytes = in.available()) > 0) { If (numBytes > buffer.length) { numBytes = buffer.length; // in case you have buffer overflow } numBytes = in.read(buffer, 0 , numBytes)); String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } Also, just for optimization, I'd move that byte[] buffer = new byte[10]; out of the while since you don't need to reallocate it every iteration. ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of F?bio Cristiano dos Anjos Sent: Friday, November 02, 2007 8:35 AM To: RXTX Developers and Users Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream (); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas < ajmas at sympatico.ca > wrote: Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info ("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Atenciosamente, F?bio Cristiano dos Anjos -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/4de7f6a3/attachment-0010.html From fabioanjos at gmail.com Fri Nov 2 07:36:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 10:36:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> Message-ID: <29788b250711020636q1588c88fgaa5e27f5504164fb@mail.gmail.com> Hi Nick, Actually, it doesnt block for physical ports too. And, the method avaiable does not block either, so when there's nothing avaiable the loop ends and the thread stops lintening to the port. But I did some more test with serialEventListener, and now its working. I realy dont know what I've done to get it working. I just start woking as soon as I decided to test it again. It was said here that serialEventListener is not reliable for virtual serial ports. Is there another way to read it, without compromising performance? Tanks again!! F?bio ------- On 11/2/07, Nick Circelli wrote: > > I'm pretty sure that not blocking has to do with you virtual ports. > Cause it should block. > > Maybe you should try: > > > > while ((numBytes = in.available()) > 0) > > { > > If (numBytes > buffer.length) { > > numBytes = buffer.length; // in case you have buffer overflow > > } > > numBytes = in.read(buffer, 0 , numBytes)); > > String dataValue = new String(buffer,0,numBytes,"ASCII"); > > processInput(dataValue); > > } > > > > Also, just for optimization, I'd move that byte[] buffer = new > byte[10]; > > out of the while since you don't need to reallocate it every iteration. > > > ------------------------------ > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On Behalf > Of *F?bio Cristiano dos Anjos > *Sent:* Friday, November 02, 2007 8:35 AM > *To:* RXTX Developers and Users > *Subject:* Re: [Rxtx] serialEvent(SerialPortEvent event) never be > triggered > > > > Hi, > > I think i missunderstand something here. > The code you post here was meant to be used inside serialEvent method, > right? > > The think is, that i cannot user SerialEventListener to read serial ports, > because i need to read virual serial ports and id does not behaves well, as > said here before. serialEvent is never triggered. > > So what I quit using SerialEventListener and created a thread to listen to > the port: > > public void run(){ > try{ > in = port.getInputStream(); > out = port.getOutputStream (); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new > String(buffer,0,numBytes,"ASCII"); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ getReceptor().getPort() > ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > } > > > So, the problem is that in.read(buffer) always returns 0 when there is > nothing to read, instead of blocking the flow, and the thread becames locked > in the loop. > > I hope you can help me solve this. > > Thanks in advance! > > F?bio > -------- > > On 11/2/07, *F?bio Cristiano dos Anjos* wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > > > On 11/1/07, *Andre-John Mas* < ajmas at sympatico.ca> wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info ("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/571df6ea/attachment-0009.html From tjarvi at qbang.org Fri Nov 2 08:32:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Nov 2007 08:32:15 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: References: Message-ID: On Fri, 2 Nov 2007, Greg Johnson wrote: > Hi Trent, folks, > Having a single rxtx that is suitable for commercial uses and hobbyists both > would be a great idea? Perhaps it would be worth submitting rxtx as a > proposal to Codehaus - they not only provide excellent tools (Jira (bug > tracker), Confluence (wiki)) but also support build management ( > maestro, continuum, bamboo). Relying on your personal machine (btw, frii.com > / rxtx.org is down again?) seems like a burden you shouldn't have to shoulder > alone. Hi Greg, There may be a little confusion here. There is no need to have two seperate rxtx releases. What I'm trying to encourage is a discussion between some of the people responsible for making sure rxtx does not break their products each release. Usually these people are interested in testing a set of functionality their product depends upon. They do not work with rxtx code but rather traps to catch when rxtx developers break something. This goes on all the time in isolated labs. There are many services that offer to do various pieces of a project for you if you... Anyone is free to do the 'if you' portion with rxtx and see how it goes. I'm actually interested in doing less of that than more. The rxtx.org work I do just happens to overlap with other things I do for personal/family use. The reason I suggest the amazon solution is that anyone can take full control of the environment for a day and it costs less than a package of gum without causing harm to what anyone else is doing. I assume the down question was with respect to a mod_security setting that has been resolved. If not, please post a url to the problem. -- Trent Jarvi tjarvi at qbang.org From nsayer at kfu.com Sat Nov 3 20:17:49 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 19:17:49 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? Message-ID: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Has anyone got RXTX working with an app under Leopard? My app hangs on port open (it works fine with Tiger). The relevant thread looks like this in the activity monitor: 1536 JVM_InvokeMethod 1536 0x48ccd0 1536 0x46f8a0 1536 0x4c3ff4 1536 0x4c4284 1536 0x357d160 1536 0x357faac 1536 Java_gnu_io_RXTXPort_open 1536 open $NOCANCEL$UNIX2003 1536 open $NOCANCEL$UNIX2003 From ajmas at sympatico.ca Sat Nov 3 22:02:04 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 00:02:04 -0400 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> RXTX works for me with Leopard. I am currently using it communicate with a Bluetooth GPS. What computer and device are you trying to use? Is the driver for your serial device compatible with MacOS X 10.5? Andre On 3-Nov-07, at 22:17 , Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From nsayer at kfu.com Sat Nov 3 22:17:47 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 21:17:47 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> Message-ID: <1720F723-3643-438C-B3AB-E09A67536977@kfu.com> On Nov 3, 2007, at 9:02 PM, Andre-John Mas wrote: > RXTX works for me with Leopard. I am currently using it communicate > with a Bluetooth GPS. > > What computer and device are you trying to use? Is the driver for > your serial device compatible with MacOS X 10.5? An Intel mac mini The FTDI USB serial driver an XMPCR, which is just a fancy serial controlled radio and an FTDI usb-to-serial chip I've successfully used the FTDI driver with another FTDI device in another context. > > > Andre > > On 3-Nov-07, at 22:17 , Nick Sayer wrote: > >> Has anyone got RXTX working with an app under Leopard? >> >> My app hangs on port open (it works fine with Tiger). The relevant >> thread looks like this in the activity monitor: >> >> 1536 JVM_InvokeMethod >> 1536 0x48ccd0 >> 1536 0x46f8a0 >> 1536 0x4c3ff4 >> 1536 0x4c4284 >> 1536 0x357d160 >> 1536 0x357faac >> 1536 >> Java_gnu_io_RXTXPort_open >> 1536 open >> $NOCANCEL$UNIX2003 >> 1536 open >> $NOCANCEL$UNIX2003 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From racecar at gmail.com Sat Nov 3 22:25:53 2007 From: racecar at gmail.com (Kevin Mateo Lim) Date: Sat, 3 Nov 2007 21:25:53 -0700 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: Message-ID: I am alternating between two errors. After i run the macosx_setup.command, "everyone" is set to Read only in /var/lock. I notice in the terminal that the group for these perms is _uucp, not uucp. In that state, I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 check_group_uucp(): error testing lock file creation Error details:Permission deniedcheck_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException : Error inside Serial.() at processing.serial.Serial.errorMessage(Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.( Serial.java:102) at Temporary_829_3245.setup(Temporary_829_3245.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java :690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) Then, I hand edit the "everyone" permissions for /var/lock/ to Read and Write (note /var/spool/uucp is Read/Write in all cases, and doesn't change). I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX uucp_lock() /var/lock/LK.003.009.000 is there gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException: Error inside Serial.() at processing.serial.Serial.errorMessage (Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.(Serial.java:102) at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java:690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) See here: http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071103/f1a2c467/attachment-0008.html From greg.johnson at manchester.ac.uk Sun Nov 4 02:31:13 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sun, 4 Nov 2007 10:31:13 +0100 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <28B5E0A0-0802-4C74-AC21-87ED35F3B9A2@manchester.ac.uk> Hi Nick, I also had problems initially with Leopard, but it was resolved by reinstalling the serial USB driver (FTDI in my case). The symptoms were a non-detection of any ports (but I twigged when I tried ZTerm and it had the same problem). Good luck! Cheers, greg PS I did a "Archive and install" which may be the reason my FTDI driver had disappeared - I don't think the driver has changed for 10.5 ------------------------------------------------------------------------- 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 4 Nov 2007, at 03:17, Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Sun Nov 4 13:01:12 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 15:01:12 -0500 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: Message-ID: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Hi, You will need to get the 2.1-8 code from CVS. See the FAQ for more information: http://rxtx.qbang.org/wiki/index.php/FAQ Andre On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > I am alternating between two errors. > > After i run the macosx_setup.command, "everyone" is set to Read only > in /var/lock. I notice in the terminal that the group for these > perms is _uucp, not uucp. > > In that state, I get this error: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > check_group_uucp(): error testing lock file creation Error > details:Permission deniedcheck_lock_status: No permission to create > lock file. > please see: How can I use Lock Files with rxtx? in INSTALL > gnu.io.PortInUseException: Unknown Application > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > java.lang.RuntimeException : Error inside Serial.() > > at processing.serial.Serial.errorMessage(Serial.java:583) > > at processing.serial.Serial.(Serial.java:148) > > at processing.serial.Serial.( Serial.java:102) > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > at processing.core.PApplet.run(PApplet.java:1556) > > at java.lang.Thread.run(Thread.java:613) > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > and Write (note /var/spool/uucp is Read/Write in all cases, and > doesn't change). I get this error: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > gnu.io.PortInUseException: Unknown Application > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > java.lang.RuntimeException: Error inside Serial.() > > at processing.serial.Serial.errorMessage (Serial.java:583) > > at processing.serial.Serial.(Serial.java:148) > > at processing.serial.Serial.(Serial.java:102) > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > at processing.core.PApplet.run(PApplet.java:1556) > > at java.lang.Thread.run(Thread.java:613) > > See here: > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From netbeans at gatworks.com Sun Nov 4 14:33:35 2007 From: netbeans at gatworks.com (U. George) Date: Sun, 04 Nov 2007 16:33:35 -0500 Subject: [Rxtx] #ifndef TIOCSERGETLSR Message-ID: <472E3AAF.7050709@gatworks.com> For Linux, it seems that you need the code for both *having* a TIOCSERGETLSR, and *not having* a TIOCSERGETLSR. Maybe the ioctl exists system wide, but not necessarily for the device driver itself ( always returns -1 ) . Are there systems that have a *functioning* TIOCSERGETLSR for all their devices? Then this would be the case where the "#ifndef TIOCSERGETLSR" directive could be useful is eliminating the unnecessary code and tests. And for those systems that dont have a TIOCSERGETLSR, then the code for TIOCSERGETLSR can be eliminated. It would be a simple case to have, as a foundation, all the code to simulate the missing TIOCSERGETLSR ioctl. If the system does have the ioctl, then that code can be ifdef'd in, and co-exist with the functionality of the code that simulates the missing TIOCSERGETLSR ioctl. From racecar at gmail.com Sun Nov 4 17:30:19 2007 From: racecar at gmail.com (Kevin Mateo Lim) Date: Sun, 4 Nov 2007 17:30:19 -0700 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: the README.OSX reads: Put libSerial.jnilib in the directory of the application (the JavaVM will find it there). Add RXTXComm.jar to the application classpath or include the classes in the application jar. (Some applications already include the RXTX classes in their application jar, in which case only the file libSerial.jnilib is required). I can't find libSerial.jnilib I put librxtxSerial.jnilib into my Processing /libraries/serial/library/ directory. Yet it still sees the old version: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 On 11/4/07, Andre-John Mas wrote: > > Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > 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/20071104/c0a83f91/attachment-0007.html From ajmas at sympatico.ca Sun Nov 4 17:41:47 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 19:41:47 -0500 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> If you are wanting it to be available for all applications, - for all users: /Library/Java/Extensions - for your user: ~/Library/Java/Extensions Or just for your application, then it should be in the same directory from which yo are launching your application. If you are getting the 2.1-8 source, then the library built is called: librxtxSerial.jnilib despite what the docs say. Andre On 4-Nov-07, at 19:30 , Kevin Mateo Lim wrote: > > the README.OSX reads: > Put > libSerial.jnilib > in the directory of the application (the JavaVM will find it there). > Add > RXTXComm.jar > to the application classpath or include the classes in the > application jar. > (Some applications already include the RXTX classes in their > application jar, > in which case only the file libSerial.jnilib is required). > > > I can't find libSerial.jnilib > I put librxtxSerial.jnilib into my Processing /libraries/serial/ > library/ directory. > > Yet it still sees the old version: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > On 11/4/07, Andre-John Mas wrote: Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial .(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay (PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > From bschlining at gmail.com Sun Nov 4 19:46:23 2007 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 4 Nov 2007 18:46:23 -0800 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> Message-ID: > > Or just for your application, then it should be in the same directory > from which yo are launching your application. Just wanted to add one more way of specifying the native lib location... If you don't want to define it globally by putting it in /Library/Java/Extensions (and you don't, it's a very very bad practice) you can also specify the location of the native library when starting the JVM by specifying the 'java.library.path' property. For example: java -Djava.library.path=/Path/To/Directory/With/RXTX/Library YourMainClass -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071104/c5af6980/attachment-0007.html From greg.johnson at manchester.ac.uk Mon Nov 5 01:39:02 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Mon, 5 Nov 2007 09:39:02 +0100 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: The 2.1-8 code reports 2.1-7, hence your (and my) confusion. But as long as you've removed all traces of the old library, it really _is_ 2.1-8. And if you specify the library path to the VM, don't make my mistake (on OSX at least) - you need to respecify the entire library path it had by default, as the command line argument replaces the path, rather than appending to it. 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 5 Nov 2007, at 01:30, Kevin Mateo Lim wrote: > > the README.OSX reads: > Put > libSerial.jnilib > in the directory of the application (the JavaVM will find it there). > Add > RXTXComm.jar > to the application classpath or include the classes in the > application jar. > (Some applications already include the RXTX classes in their > application jar, > in which case only the file libSerial.jnilib is required). > > > I can't find libSerial.jnilib > I put librxtxSerial.jnilib into my Processing /libraries/serial/ > library/ directory. > > Yet it still sees the old version: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > On 11/4/07, Andre-John Mas wrote: > Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial .(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay (PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > 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 HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071105/7f50506d/attachment-0007.html From cyrille.dumont at tatexpress.fr Mon Nov 5 05:46:03 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 05 Nov 2007 13:46:03 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: References: <472727F1.1000704@tatexpress.fr> Message-ID: <472F108B.2090101@tatexpress.fr> Thanks a lot for your solution ... but I'm not a expert in JAVA ... (sorry) For the moment I've this function : """ public void serialEvent(SerialPortEvent e) { StringBuffer inputBuffer = new StringBuffer(); int newData = 0; switch (e.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } //-- Manag. Data from Scanner this.MngDataScanner(inputBuffer.toString()); break; case SerialPortEvent.BI:; //-- Break Received } } """ How can I do what you write ? ( maybe a simple ex ? ) PS : I don't know the PDF417 size (could be, for example, 338 char, or 500 ... ; what I know is that it can't be more than 800 char) Thanks in advance. Best regards. Trent Jarvi a ?crit : > 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 Martin.Oberhuber at windriver.com Mon Nov 5 08:47:50 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 5 Nov 2007 16:47:50 +0100 Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> Hi Trent, are the interestes of hobbyists really so different from commercial ones? Both should be interested in high quality and innovation the like. I haven't seen too many Open Source projects from the "inside" but those that I have seen did not have separate mailing lists for quality/testing/qa versus innovation/development. What I have seen with the Open Source projects that one would call "successful" is a good deal of process around automated builds, automated unit tests, predictable release dates and milestones, and policies around commiting/contributing/reviewing changes. I think that all of these benefit commercial users and hobbyists the like. If you were just asking about who's interested in discussing changes to foster more quality, count me in. I'm just not sure whether discussing these on a separate mailing list or other channel is the right thing to do. Cheers, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From toupsz at cs.tamu.edu Tue Nov 6 14:27:04 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 15:27:04 -0600 Subject: [Rxtx] reading TTL level signals from serial? Message-ID: Dear RXTX community- I've been using RXTX to handle communicating with several hardware devices in Java (a GPS and some custom audio circuitry for my dissertation work). I have a new, high-accuracy GPS which only communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there any way to communicate with this device using RXTX, perhaps by modding the native code for Windows? If so, does anyone have any tips on how to do it? Has it perhaps already been done? Another option is for me to invert / amplify the signal in hardware, but this is difficult for me to pull off due to the sensitivity of the electronics involved...I'll likely end up using a much less accurate piece of equipment rather than go that far! If anyone could help out, I'd really appreciate it! Thanks! -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/b6c59c2b/attachment-0005.html From netbeans at gatworks.com Tue Nov 6 14:55:22 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 06 Nov 2007 16:55:22 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: Message-ID: <4730E2CA.3090009@gatworks.com> This is really a hardware issue. Is there any device ( ie the serial port ) on your computer that will accept the voltage signals ( and load ) that your device produces? Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it happen safely ( ie u dont cook the GPS device ) I have a new, high-accuracy GPS which only > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there > any way to communicate with this device using RXTX, From toupsz at cs.tamu.edu Tue Nov 6 15:14:01 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 16:14:01 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4730E2CA.3090009@gatworks.com> References: <4730E2CA.3090009@gatworks.com> Message-ID: Actually, the device runs over USB, but shows up as a virtual serial port and is outputting these signals. The software that comes with the device (a u-blox ANTARIS 4 eval kit) is able to communicate. RXTX is able to detect and properly configure the port, but does not get any of the data from it. :-/ It seems like there must be some way to do it (obviously, ublox knows how)... -Zach On Nov 6, 2007 3:55 PM, U. George wrote: > This is really a hardware issue. > Is there any device ( ie the serial port ) on your computer that will > accept the voltage signals ( and load ) that your device produces? > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it > happen safely ( ie u dont cook the GPS device ) > > > I have a new, high-accuracy GPS which only > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there > > any way to communicate with this device using RXTX, > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/15ae7a0b/attachment-0005.html From keithvz at verizon.net Tue Nov 6 16:16:55 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 06 Nov 2007 18:16:55 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> Message-ID: <4730F5E7.1030704@verizon.net> Zach Toups wrote: > On Nov 6, 2007 3:55 PM, U. George > wrote: > > This is really a hardware issue. > Is there any device ( ie the serial port ) on your computer that will > accept the voltage signals ( and load ) that your device produces? > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it > happen safely ( ie u dont cook the GPS device ) > > > I have a new, high-accuracy GPS which only > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is > there > > any way to communicate with this device using RXTX, > _______________________________________________ As UGeorge intimated, it's a hardware issue. If your device outputs TTL level voltages, and your USB to serial converter is RS-232, then you've got a physical hardware differences. Inverted leads and voltage issues are mainly the problem. MAXIM makes a neat little chip called the MAX233 (better than the 232, no extern caps required) You can't solve this in software. Now, there are TTL level compatible USB to serial converters available, I happen to be using one right now. This unit below is from a UK company (there might be sources in the US) http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm Parallax makes one that does 3.3 and 5v http://www.parallax.com/detail.asp?product_id=32201 (but only supports RX, TX, GND, AND DTR towards device) (i've tested a variant of the unit above, and it works with RXTX) In both cases, you'll need some creative wiring depending on the interface on your GPS. Hope this helps Keith From toupsz at cs.tamu.edu Tue Nov 6 16:53:01 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 17:53:01 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4730F5E7.1030704@verizon.net> References: <4730E2CA.3090009@gatworks.com> <4730F5E7.1030704@verizon.net> Message-ID: Yeah...I used an FTDI chip to handle USB/serial conversion on the audio equipment I built. I'm leery of trying to build a board for this ublox GPS due to all the grounding/shielding issues around it. Anyway, I apreciate the help...just sad that I can't handle the problem in software! Ublox did send me the source code for their USB drivers...but as a Java programmer, it's a bit tough for me to sort out. ;) Thanks again! -Zach On Nov 6, 2007 5:16 PM, Keith Monahan wrote: > Zach Toups wrote: > > > On Nov 6, 2007 3:55 PM, U. George > > wrote: > > > > This is really a hardware issue. > > Is there any device ( ie the serial port ) on your computer that > will > > accept the voltage signals ( and load ) that your device produces? > > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make > it > > happen safely ( ie u dont cook the GPS device ) > > > > > > I have a new, high-accuracy GPS which only > > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is > > there > > > any way to communicate with this device using RXTX, > > _______________________________________________ > > As UGeorge intimated, it's a hardware issue. > > If your device outputs TTL level voltages, and your USB to serial > converter is RS-232, then you've got a physical hardware differences. > Inverted leads and voltage issues are mainly the problem. MAXIM makes a > neat little chip called the MAX233 (better than the 232, no extern caps > required) > > You can't solve this in software. > > Now, there are TTL level compatible USB to serial converters available, > I happen to be using one right now. > > This unit below is from a UK company (there might be sources in the US) > > http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm > > Parallax makes one that does 3.3 and 5v > > http://www.parallax.com/detail.asp?product_id=32201 > (but only supports RX, TX, GND, AND DTR towards device) > > (i've tested a variant of the unit above, and it works with RXTX) > > In both cases, you'll need some creative wiring depending on the > interface on your GPS. > > Hope this helps > > Keith > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/06e88ad4/attachment-0005.html From netbeans at gatworks.com Tue Nov 6 17:14:01 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 06 Nov 2007 19:14:01 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> <4730F5E7.1030704@verizon.net> Message-ID: <47310349.5000406@gatworks.com> what gps chipset do u have? > Ublox did send me the source code for their USB drivers...but as a Java > programmer, it's a bit tough for me to sort out. ;) From Steffen.DETTMER at ingenico.com Wed Nov 7 03:10:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 7 Nov 2007 11:10:01 +0100 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> Message-ID: <20071107101000.GN10978@elberon.bln.de.ingenico.com> * Zach Toups wrote on Tue, Nov 06, 2007 at 16:14 -0600: > Actually, the device runs over USB, but shows up as a virtual > serial port and is outputting these signals. Ahh, so what you want is to use rxtx on the serial port that is created by the driver and mapped maybe as some COM8 or whatever? I this case then IMHO it would be no hardware question but maybe a problem in your application, or some driver or indeed a rxtx issue. > The software that > comes with the device (a u-blox ANTARIS 4 eval kit) is able to > communicate. Is it sure that this software is really using the virtual serial port and only this port? oki, Steffen -- About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Wed Nov 7 04:59:10 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 06:59:10 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <20071107101000.GN10978@elberon.bln.de.ingenico.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> Message-ID: <4731A88E.6080705@gatworks.com> >> The software that >> comes with the device (a u-blox ANTARIS 4 eval kit) is able to >> communicate. > > Is it sure that this software is really using the virtual serial > port and only this port? > I have tried to read the docs. I have yet to find any explanation on a (windoz) device driver for this device ( the usb device ). That magic is not explained. For a developer thats important magic. Maybe a call to their support team is in order? From netbeans at gatworks.com Wed Nov 7 05:01:38 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 07:01:38 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <20071107101000.GN10978@elberon.bln.de.ingenico.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> Message-ID: <4731A922.7@gatworks.com> Steffen DETTMER wrote: > * Zach Toups wrote on Tue, Nov 06, 2007 at 16:14 -0600: >> Actually, the device runs over USB, but shows up as a virtual BTW: it seems that I am not getting all the Rxtx mail. Is there still a problem? From toupsz at cs.tamu.edu Wed Nov 7 07:36:20 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Wed, 7 Nov 2007 08:36:20 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4731A88E.6080705@gatworks.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> <4731A88E.6080705@gatworks.com> Message-ID: When I emailed them about this issue, they sent me their WinCE drivers, which are apparently based on this open source driver: http://www.yetanotherhomepage.com/j7xx/j7xx.html?/j7xx/software/util/usbdriver.html These include srcdll, and x86 subfolders, though it's not 100% clear to me that these are useful. The ublox communication suite appears to only communicate with serial ports...I've communicated with the ublox on two different comm ports (one with the serial adapter plugged into the serial port, one with the main USB connection), as well as a Garmin bluetooth GPS (which comes up as a bluetooth serial device). I'm not well versed in code this close to the hardware, but it seems to me that if you're running a virtual serial port, then you're virtually controlling the "voltages" that come in on this "port"...so why would they be "ttl level"? :-/ Shouldn't the USB driver be able to interpret the signals in whatever way it wants and just supply software with the binary interpretation? Thanks for all the help, guys, it's really appreciated! -Zach On Nov 7, 2007 5:59 AM, U. George wrote: > > >> The software that > >> comes with the device (a u-blox ANTARIS 4 eval kit) is able to > >> communicate. > > > > Is it sure that this software is really using the virtual serial > > port and only this port? > > > > I have tried to read the docs. I have yet to find any explanation on a > (windoz) device driver for this device ( the usb device ). That magic > is not explained. For a developer thats important magic. Maybe a call > to their support team is in order? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071107/18a13314/attachment-0003.html From netbeans at gatworks.com Wed Nov 7 08:55:55 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 10:55:55 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> <4731A88E.6080705@gatworks.com> Message-ID: <4731E00B.9030902@gatworks.com> There are 2 components to talking to hardware. There is the electrical specification, and then there is the software specification. there is the rs232 specification, parallel port specification, and the USB electrical specification. Generally these are used to plug in the various devices, and hook up electrically. Then there is the software side. There is the device driver, a software component that sits somewhere in the kernel that handles the USB ( in your case ) controller. The device driver generally does not care about the electrical component. There are various chips that handle USB signals, and these chips have I/O addresses so that signals and data can be properly routed. There is also the side that communicates to the user via the COM port device-name. The device driver that you mentioned is for the "Support PL2303 serial chip". This device driver, which hopefully works, handles the USB chip, and eventually recognzes the gps device, and hopefully creates an COM port so the user can open up and communicate. These are a lot of "HOPES". Since u have the web address of the device driver, and developer, I would think that the developer, and any docs, might be better able to help u to first determine if the GPS device is recognized, and the COM port ( maybe its called by another name ) is created, as per documentation. > > These include srcdll, and x86 subfolders, though it's not 100% clear to > me that these are useful. From tjarvi at qbang.org Sat Nov 10 17:46:13 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Nov 2007 17:46:13 -0700 (MST) Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 5 Nov 2007, Oberhuber, Martin wrote: > Hi Trent, > > are the interestes of hobbyists really so different > from commercial ones? Both should be interested in > high quality and innovation the like. > > I haven't seen too many Open Source projects from the > "inside" but those that I have seen did not have > separate mailing lists for quality/testing/qa > versus innovation/development. > > What I have seen with the Open Source projects that > one would call "successful" is a good deal of > process around automated builds, automated unit > tests, predictable release dates and milestones, > and policies around commiting/contributing/reviewing > changes. > > I think that all of these benefit commercial users > and hobbyists the like. > > If you were just asking about who's interested in > discussing changes to foster more quality, count > me in. I'm just not sure whether discussing these > on a separate mailing list or other channel is the > right thing to do. > Hi Martin, There are two issues I'm thinking about. The first is the generic unit testing and quality initiatives required to move rxtx forward. The second is the inevitable fact that rxtx connects to external hardware. The discussion deals with a different set of problems. Here is a simple example of what I'm getting at. We have the capability of setting custom baud rates in rxtx. We may be interested in seeing regressions in rxtx, the C library or the kernel. Some people may be doing some tests with loopback connections. These will always work even if the baud rate is not set to the expected value. Some people may use null modems between two ports. This may be able to catch the problem but not always. Will the build machines be able to test this? (no - for a few reasons) Will people be trying to catch these type of regressions? (yes) What type of coverage does the community have in the end? (?) We could include the discussions in the same list or another equally open list that may be of interest to some folks that deal with these types of problems on a regular basis. -- Trent Jarvi tjarvi at qbang.org From keithvz at verizon.net Thu Nov 1 08:08:58 2007 From: keithvz at verizon.net (Keith) Date: Thu, 01 Nov 2007 10:08:58 -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: <4729DDFA.7080206@verizon.net> Trent Jarvi wrote: > 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? Well, I honestly don't know how all this fits together. I think it's just a matter of enabling the right flow control option within the standard serial framework to tell the device driver, "HEY START USING DTR/DSR FOR FLOW CONTROL." If what UGeorge said,(about that type of nitty-gritty lead control being done within the device driver), is true, then this confirms my suspicion. I tried narrowing down within the Linux drivers what you are looking for, but I can't entirely tell wth I'm looking at. (virtual com port drivers -- they are included compiled by default with Ubuntu, source included) http://www.ftdichip.com/Drivers/VCP/Linux/ftdi_sio.tar.gz Hahahaa, they make a reference to DTR flow control being supported but say (UGH) in parenthesis. You can also use their direct device driver library on Ubuntu -- libftd2xx.so.0.4.13. No source code. http://www.ftdichip.com/Drivers/D2XX/Linux/libftd2xx0.4.13.tar.gz In that case, you make a call to their FT_SetFlowControl() function. FT_STATUS FT_SetFlowControl (FT_HANDLE ftHandle, USHORT usFlowControl, UCHAR uXon,UCHAR uXoff) Parameters ftHandle Handle of the device. usFlowControl Must be one of FT_FLOW_NONE, FT_FLOW_RTS_CTS, ****FT_FLOW_DTR_DSR**** or FT_FLOW_XON_XOFF. uXon Character used to signal Xon. Only used if flow control is FT_FLOW_XON_XOFF. uXoff Character used to signal Xoff. Only used if flow control is FT_FLOW_XON_XOFF. This is from their programming guide http://www.ftdichip.com/Documents/ProgramGuides/D2XXPG34.pdf I actually want to take this a step further and say that I think the flow control is actually handled right on the device itself in hardware/firmware. It's enabled through the device driver, but I think the maintaining of buffers, asserting/deasserting of leads, etc is handled by the device. For the time being, I've switched to jd2xx, https://jd2xx.dev.java.net/ and http://bleyer.org/jd2xx/ These are Java wrappers for the device driver libraries. It allows almost direct access to the well-documented device drivers from Java. I hope this helps Keith From tjarvi at qbang.org Thu Nov 1 11:09:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:09:51 -0600 (MDT) 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: Hi Martin, What I usually have done is allow changes that do not impact working software including changes to methods not documented in CommAPI (which remain undocumented in rxtx) and fixes to known problems in the documented portions. That way if you use the documented API, the releases should only become better with time. If you use the undocumented portions, the behavior is not as predictable but open for improvement. On Wed, 31 Oct 2007, 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 >> > From tjarvi at qbang.org Thu Nov 1 11:15:52 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:15:52 -0600 (MDT) 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: I too use rxtx in commercial products. The problem I've been trying to address while bringing the server back was how to make it possible for hobby folks to build the same software as companies so we can move rxtx along a little faster. Exposing internal tools is not an option at this time, the public rxtx builds have been done on my home machine which has drives hanging out of it all over the place dying one at a time. This isn't maintainable. I'm currently looking at the possibility of making an S3 image available on Amazon's EC. These are machines you can rent for ~10 cents an hour which is more than enough to build rxtx. The S3 image is not changed when people use it so everyone has the same starting point. With this, we could all build rxtx for ~20 platforms for a small price and eliminate tool issues. On Wed, 31 Oct 2007, Greg Johnson wrote: > 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 tjarvi at qbang.org Thu Nov 1 11:19:55 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:19:55 -0600 (MDT) 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: On Wed, 31 Oct 2007, 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. I was helping Dmitry do the Mac OS X port without access to a machine when we put that in. In the archives there is information (easily found with google on Apple's site) that describes how their API (and others) can determine if a port is used and ignore it. I think these changes are in CVS but need to confirm. The bottom line is that rxtx should not have used lock files on Mac. It was just ignorance of the system on my part. -- Trent Jarvi tjarvi at qbang.org From fabioanjos at gmail.com Thu Nov 1 12:35:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Thu, 1 Nov 2007 15:35:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Hi, I was using SerialEventListener in my project. But, as was said here, id doesnt work very well with virtual serial ports. So, I changed the strategy using the code posted here in this thread: try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > 0) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } The thing is that in my tests I could notice that in.read(buffer) never blocks. Even when there's nothing to read. Instead of blocking when there's nothing to read it returns 0. So, my questions are: 1. Am I doing something wrong? 2. If not, wouldnt this decrease performance? (the thread would be locked in a loop that does nothing.) 3. Is there a better way to do the job? Thanks in advance!! F?bio -------- On 10/31/07, Andre-John Mas wrote: > > > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/0aee59d0/attachment-0011.html From ajmas at sympatico.ca Thu Nov 1 16:07:55 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Nov 2007 18:07:55 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Message-ID: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From sarah_662005 at yahoo.com Thu Nov 1 17:10:05 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Thu, 1 Nov 2007 16:10:05 -0700 (PDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Message-ID: <351433.37166.qm@web55814.mail.re3.yahoo.com> Thank you very much for your help. Now the application works fine. the serialEvent gets triggered. Rxtx is cool! ----- Original Message ---- From: Andre-John Mas To: Sara Hugh ; RXTX Developers and Users Sent: Wednesday, October 31, 2007 9:55:45 AM Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered 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 __________________________________________________ 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/20071101/4a86bea6/attachment-0011.html From tjarvi at qbang.org Thu Nov 1 17:58:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 17:58:02 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx Message-ID: The rxtx.org site is primarily interested in the hobby aspects of rxtx. Obviously, there are some companies following the work too. These interests bring larger workflows and concerns about details hobby folks may not care about. They also bring many more users. I know the company I work for has a quality engineering effort going on which includes rxtx. While the server was down, I was contacted by another company that was missing the binaries for their testing. Several people have mentioned concerns about a stable release for like reasons. Would there be interest on the quality side of the coin to get together? It could be just sharing email's with each other or a seperate list for QE/QA. I can not say for sure, but we may be able to share some of our efforts/results that could help keep rxtx releases stable. -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Fri Nov 2 01:42:55 2007 From: scldad at sdc.com.au (Stephen Davies) Date: Fri, 2 Nov 2007 18:12:55 +1030 Subject: [Rxtx] Multiple modems Message-ID: <200711021812.56047.scldad@sdc.com.au> This may or may not be related to the Multiple Ports thread. I have an application which uses rxtx on Linux (via cron jobs) to connect multiple modems to remote sensing devices. The application works fine most of the time but occasionally fails to connect if two (or more) connection attempts happen at about the same time. When it fails, it looks as if it may get confused as to which port it is talking to. The app has a "base" component that looks for an available port, opens it and then creates an input thread and an output thread for the connection and data transfer. The "base" component uses this code: // loop round all known ports until one is available. Give up after three minutes Counter ptimeout = new Counter(); while(!portFound && ptimeout.elapsed() < 180000) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // special case. ttyS0 is not available to us on this server. if (!portId.isCurrentlyOwned() && !portId.getName().equals("/dev/ttyS0")) { gLog.debug(lognm + ": Found port " + portId.getName()); try { serialPort = (RXTXPort) portId.open("AguaModem", 10000); } catch (Exception e) { gLog.error(lognm + ": Port " + portId.getName() + " will not open."); gLog.error(e.getMessage()); continue; } AguaModem aguamodem = new AguaModem(); portFound = true; break; } gLog.debug(lognm + ": Port " + portId.getName() + " is busy"); } } } I am wondering about the isCurrentlyOwned method. Does this actually tell me whether a port is currently being used by another process? TIA, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From fabioanjos at gmail.com Fri Nov 2 04:59:58 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 07:59:58 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Message-ID: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/9009eb1d/attachment-0011.html From netbeans at gatworks.com Fri Nov 2 06:28:13 2007 From: netbeans at gatworks.com (U. George) Date: Fri, 02 Nov 2007 08:28:13 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <472B17DD.1050508@gatworks.com> It should normally block ( unless eof / event ) . so its a :{ whats the device ( to recreate if possible ) and how do u open. > My question is, is there a way to make in.read block the thead until > there's something to read? > From fabioanjos at gmail.com Fri Nov 2 06:34:46 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 09:34:46 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > On 11/1/07, Andre-John Mas wrote: > > > > Fabio, > > > > Turns out there was a small error in my example. The test should be: > > > > (numBytes = in.read(buffer)) > -1 > > > > This is because -1 indicates an end of file (end of data stream) > > > > Andre > > > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > > > Hi, > > > > > > I was using SerialEventListener in my project. But, as was said > > > here, id doesnt work very well with virtual serial ports. > > > So, I changed the strategy using the code posted here in this thread: > > > > > > try{ > > > in = port.getInputStream(); > > > out = port.getOutputStream(); > > > int numBytes = 0; > > > while(active){ > > > > > > byte[] buffer = new byte[10]; > > > > > > while ( (numBytes = in.read(buffer)) > 0) > > > { > > > String dataValue = new String(buffer,0,numBytes); > > > processInput(dataValue); > > > } > > > > > > if(numBytes==-1){ > > > break; > > > } > > > > > > Thread.sleep(50); > > > } > > > > > > }catch(IOException e){ > > > logger.info("falha de comunicacao "+ > > > getReceptor().getPort() ); > > > > > > }catch(InterruptedException e){ > > > logger.info ("Interrompendo leitura da porta "+ > > > getReceptor().getPort() ); > > > } > > > > > > The thing is that in my tests I could notice that in.read(buffer) > > > never blocks. Even when there's nothing to read. Instead of blocking > > > when there's nothing to read it returns 0. > > > > > > So, my questions are: > > > > > > 1. Am I doing something wrong? > > > 2. If not, wouldnt this decrease performance? (the thread would be > > > locked in a loop that does nothing.) > > > 3. Is there a better way to do the job? > > > > > > Thanks in advance!! > > > > > > F?bio > > > -------- > > > > > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > > 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 > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > > > > > -- > > > Atenciosamente, > > > F?bio Cristiano dos Anjos > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/5306c4b1/attachment-0011.html From nick.circelli at infrasafe.com Fri Nov 2 07:01:17 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Fri, 2 Nov 2007 08:01:17 -0500 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com><29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com><90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca><29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Message-ID: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> I'm pretty sure that not blocking has to do with you virtual ports. Cause it should block. Maybe you should try: while ((numBytes = in.available()) > 0) { If (numBytes > buffer.length) { numBytes = buffer.length; // in case you have buffer overflow } numBytes = in.read(buffer, 0 , numBytes)); String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } Also, just for optimization, I'd move that byte[] buffer = new byte[10]; out of the while since you don't need to reallocate it every iteration. ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of F?bio Cristiano dos Anjos Sent: Friday, November 02, 2007 8:35 AM To: RXTX Developers and Users Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream (); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas < ajmas at sympatico.ca > wrote: Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info ("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Atenciosamente, F?bio Cristiano dos Anjos -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/4de7f6a3/attachment-0011.html From fabioanjos at gmail.com Fri Nov 2 07:36:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 10:36:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> Message-ID: <29788b250711020636q1588c88fgaa5e27f5504164fb@mail.gmail.com> Hi Nick, Actually, it doesnt block for physical ports too. And, the method avaiable does not block either, so when there's nothing avaiable the loop ends and the thread stops lintening to the port. But I did some more test with serialEventListener, and now its working. I realy dont know what I've done to get it working. I just start woking as soon as I decided to test it again. It was said here that serialEventListener is not reliable for virtual serial ports. Is there another way to read it, without compromising performance? Tanks again!! F?bio ------- On 11/2/07, Nick Circelli wrote: > > I'm pretty sure that not blocking has to do with you virtual ports. > Cause it should block. > > Maybe you should try: > > > > while ((numBytes = in.available()) > 0) > > { > > If (numBytes > buffer.length) { > > numBytes = buffer.length; // in case you have buffer overflow > > } > > numBytes = in.read(buffer, 0 , numBytes)); > > String dataValue = new String(buffer,0,numBytes,"ASCII"); > > processInput(dataValue); > > } > > > > Also, just for optimization, I'd move that byte[] buffer = new > byte[10]; > > out of the while since you don't need to reallocate it every iteration. > > > ------------------------------ > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On Behalf > Of *F?bio Cristiano dos Anjos > *Sent:* Friday, November 02, 2007 8:35 AM > *To:* RXTX Developers and Users > *Subject:* Re: [Rxtx] serialEvent(SerialPortEvent event) never be > triggered > > > > Hi, > > I think i missunderstand something here. > The code you post here was meant to be used inside serialEvent method, > right? > > The think is, that i cannot user SerialEventListener to read serial ports, > because i need to read virual serial ports and id does not behaves well, as > said here before. serialEvent is never triggered. > > So what I quit using SerialEventListener and created a thread to listen to > the port: > > public void run(){ > try{ > in = port.getInputStream(); > out = port.getOutputStream (); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new > String(buffer,0,numBytes,"ASCII"); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ getReceptor().getPort() > ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > } > > > So, the problem is that in.read(buffer) always returns 0 when there is > nothing to read, instead of blocking the flow, and the thread becames locked > in the loop. > > I hope you can help me solve this. > > Thanks in advance! > > F?bio > -------- > > On 11/2/07, *F?bio Cristiano dos Anjos* wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > > > On 11/1/07, *Andre-John Mas* < ajmas at sympatico.ca> wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info ("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/571df6ea/attachment-0010.html From tjarvi at qbang.org Fri Nov 2 08:32:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Nov 2007 08:32:15 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: References: Message-ID: On Fri, 2 Nov 2007, Greg Johnson wrote: > Hi Trent, folks, > Having a single rxtx that is suitable for commercial uses and hobbyists both > would be a great idea? Perhaps it would be worth submitting rxtx as a > proposal to Codehaus - they not only provide excellent tools (Jira (bug > tracker), Confluence (wiki)) but also support build management ( > maestro, continuum, bamboo). Relying on your personal machine (btw, frii.com > / rxtx.org is down again?) seems like a burden you shouldn't have to shoulder > alone. Hi Greg, There may be a little confusion here. There is no need to have two seperate rxtx releases. What I'm trying to encourage is a discussion between some of the people responsible for making sure rxtx does not break their products each release. Usually these people are interested in testing a set of functionality their product depends upon. They do not work with rxtx code but rather traps to catch when rxtx developers break something. This goes on all the time in isolated labs. There are many services that offer to do various pieces of a project for you if you... Anyone is free to do the 'if you' portion with rxtx and see how it goes. I'm actually interested in doing less of that than more. The rxtx.org work I do just happens to overlap with other things I do for personal/family use. The reason I suggest the amazon solution is that anyone can take full control of the environment for a day and it costs less than a package of gum without causing harm to what anyone else is doing. I assume the down question was with respect to a mod_security setting that has been resolved. If not, please post a url to the problem. -- Trent Jarvi tjarvi at qbang.org From nsayer at kfu.com Sat Nov 3 20:17:49 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 19:17:49 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? Message-ID: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Has anyone got RXTX working with an app under Leopard? My app hangs on port open (it works fine with Tiger). The relevant thread looks like this in the activity monitor: 1536 JVM_InvokeMethod 1536 0x48ccd0 1536 0x46f8a0 1536 0x4c3ff4 1536 0x4c4284 1536 0x357d160 1536 0x357faac 1536 Java_gnu_io_RXTXPort_open 1536 open $NOCANCEL$UNIX2003 1536 open $NOCANCEL$UNIX2003 From ajmas at sympatico.ca Sat Nov 3 22:02:04 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 00:02:04 -0400 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> RXTX works for me with Leopard. I am currently using it communicate with a Bluetooth GPS. What computer and device are you trying to use? Is the driver for your serial device compatible with MacOS X 10.5? Andre On 3-Nov-07, at 22:17 , Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From nsayer at kfu.com Sat Nov 3 22:17:47 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 21:17:47 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> Message-ID: <1720F723-3643-438C-B3AB-E09A67536977@kfu.com> On Nov 3, 2007, at 9:02 PM, Andre-John Mas wrote: > RXTX works for me with Leopard. I am currently using it communicate > with a Bluetooth GPS. > > What computer and device are you trying to use? Is the driver for > your serial device compatible with MacOS X 10.5? An Intel mac mini The FTDI USB serial driver an XMPCR, which is just a fancy serial controlled radio and an FTDI usb-to-serial chip I've successfully used the FTDI driver with another FTDI device in another context. > > > Andre > > On 3-Nov-07, at 22:17 , Nick Sayer wrote: > >> Has anyone got RXTX working with an app under Leopard? >> >> My app hangs on port open (it works fine with Tiger). The relevant >> thread looks like this in the activity monitor: >> >> 1536 JVM_InvokeMethod >> 1536 0x48ccd0 >> 1536 0x46f8a0 >> 1536 0x4c3ff4 >> 1536 0x4c4284 >> 1536 0x357d160 >> 1536 0x357faac >> 1536 >> Java_gnu_io_RXTXPort_open >> 1536 open >> $NOCANCEL$UNIX2003 >> 1536 open >> $NOCANCEL$UNIX2003 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From racecar at gmail.com Sat Nov 3 22:25:53 2007 From: racecar at gmail.com (Kevin Mateo Lim) Date: Sat, 3 Nov 2007 21:25:53 -0700 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: Message-ID: I am alternating between two errors. After i run the macosx_setup.command, "everyone" is set to Read only in /var/lock. I notice in the terminal that the group for these perms is _uucp, not uucp. In that state, I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 check_group_uucp(): error testing lock file creation Error details:Permission deniedcheck_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException : Error inside Serial.() at processing.serial.Serial.errorMessage(Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.( Serial.java:102) at Temporary_829_3245.setup(Temporary_829_3245.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java :690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) Then, I hand edit the "everyone" permissions for /var/lock/ to Read and Write (note /var/spool/uucp is Read/Write in all cases, and doesn't change). I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX uucp_lock() /var/lock/LK.003.009.000 is there gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException: Error inside Serial.() at processing.serial.Serial.errorMessage (Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.(Serial.java:102) at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java:690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) See here: http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071103/f1a2c467/attachment-0009.html From greg.johnson at manchester.ac.uk Sun Nov 4 02:31:13 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sun, 4 Nov 2007 10:31:13 +0100 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <28B5E0A0-0802-4C74-AC21-87ED35F3B9A2@manchester.ac.uk> Hi Nick, I also had problems initially with Leopard, but it was resolved by reinstalling the serial USB driver (FTDI in my case). The symptoms were a non-detection of any ports (but I twigged when I tried ZTerm and it had the same problem). Good luck! Cheers, greg PS I did a "Archive and install" which may be the reason my FTDI driver had disappeared - I don't think the driver has changed for 10.5 ------------------------------------------------------------------------- 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 4 Nov 2007, at 03:17, Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Sun Nov 4 13:01:12 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 15:01:12 -0500 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: Message-ID: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Hi, You will need to get the 2.1-8 code from CVS. See the FAQ for more information: http://rxtx.qbang.org/wiki/index.php/FAQ Andre On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > I am alternating between two errors. > > After i run the macosx_setup.command, "everyone" is set to Read only > in /var/lock. I notice in the terminal that the group for these > perms is _uucp, not uucp. > > In that state, I get this error: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > check_group_uucp(): error testing lock file creation Error > details:Permission deniedcheck_lock_status: No permission to create > lock file. > please see: How can I use Lock Files with rxtx? in INSTALL > gnu.io.PortInUseException: Unknown Application > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > java.lang.RuntimeException : Error inside Serial.() > > at processing.serial.Serial.errorMessage(Serial.java:583) > > at processing.serial.Serial.(Serial.java:148) > > at processing.serial.Serial.( Serial.java:102) > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > at processing.core.PApplet.run(PApplet.java:1556) > > at java.lang.Thread.run(Thread.java:613) > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > and Write (note /var/spool/uucp is Read/Write in all cases, and > doesn't change). I get this error: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > gnu.io.PortInUseException: Unknown Application > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > java.lang.RuntimeException: Error inside Serial.() > > at processing.serial.Serial.errorMessage (Serial.java:583) > > at processing.serial.Serial.(Serial.java:148) > > at processing.serial.Serial.(Serial.java:102) > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > at processing.core.PApplet.run(PApplet.java:1556) > > at java.lang.Thread.run(Thread.java:613) > > See here: > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From netbeans at gatworks.com Sun Nov 4 14:33:35 2007 From: netbeans at gatworks.com (U. George) Date: Sun, 04 Nov 2007 16:33:35 -0500 Subject: [Rxtx] #ifndef TIOCSERGETLSR Message-ID: <472E3AAF.7050709@gatworks.com> For Linux, it seems that you need the code for both *having* a TIOCSERGETLSR, and *not having* a TIOCSERGETLSR. Maybe the ioctl exists system wide, but not necessarily for the device driver itself ( always returns -1 ) . Are there systems that have a *functioning* TIOCSERGETLSR for all their devices? Then this would be the case where the "#ifndef TIOCSERGETLSR" directive could be useful is eliminating the unnecessary code and tests. And for those systems that dont have a TIOCSERGETLSR, then the code for TIOCSERGETLSR can be eliminated. It would be a simple case to have, as a foundation, all the code to simulate the missing TIOCSERGETLSR ioctl. If the system does have the ioctl, then that code can be ifdef'd in, and co-exist with the functionality of the code that simulates the missing TIOCSERGETLSR ioctl. From racecar at gmail.com Sun Nov 4 17:30:19 2007 From: racecar at gmail.com (Kevin Mateo Lim) Date: Sun, 4 Nov 2007 17:30:19 -0700 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: the README.OSX reads: Put libSerial.jnilib in the directory of the application (the JavaVM will find it there). Add RXTXComm.jar to the application classpath or include the classes in the application jar. (Some applications already include the RXTX classes in their application jar, in which case only the file libSerial.jnilib is required). I can't find libSerial.jnilib I put librxtxSerial.jnilib into my Processing /libraries/serial/library/ directory. Yet it still sees the old version: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 On 11/4/07, Andre-John Mas wrote: > > Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > 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/20071104/c0a83f91/attachment-0008.html From ajmas at sympatico.ca Sun Nov 4 17:41:47 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 19:41:47 -0500 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> If you are wanting it to be available for all applications, - for all users: /Library/Java/Extensions - for your user: ~/Library/Java/Extensions Or just for your application, then it should be in the same directory from which yo are launching your application. If you are getting the 2.1-8 source, then the library built is called: librxtxSerial.jnilib despite what the docs say. Andre On 4-Nov-07, at 19:30 , Kevin Mateo Lim wrote: > > the README.OSX reads: > Put > libSerial.jnilib > in the directory of the application (the JavaVM will find it there). > Add > RXTXComm.jar > to the application classpath or include the classes in the > application jar. > (Some applications already include the RXTX classes in their > application jar, > in which case only the file libSerial.jnilib is required). > > > I can't find libSerial.jnilib > I put librxtxSerial.jnilib into my Processing /libraries/serial/ > library/ directory. > > Yet it still sees the old version: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > On 11/4/07, Andre-John Mas wrote: Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial .(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay (PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > From bschlining at gmail.com Sun Nov 4 19:46:23 2007 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 4 Nov 2007 18:46:23 -0800 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> Message-ID: > > Or just for your application, then it should be in the same directory > from which yo are launching your application. Just wanted to add one more way of specifying the native lib location... If you don't want to define it globally by putting it in /Library/Java/Extensions (and you don't, it's a very very bad practice) you can also specify the location of the native library when starting the JVM by specifying the 'java.library.path' property. For example: java -Djava.library.path=/Path/To/Directory/With/RXTX/Library YourMainClass -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071104/c5af6980/attachment-0008.html From greg.johnson at manchester.ac.uk Mon Nov 5 01:39:02 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Mon, 5 Nov 2007 09:39:02 +0100 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: The 2.1-8 code reports 2.1-7, hence your (and my) confusion. But as long as you've removed all traces of the old library, it really _is_ 2.1-8. And if you specify the library path to the VM, don't make my mistake (on OSX at least) - you need to respecify the entire library path it had by default, as the command line argument replaces the path, rather than appending to it. 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 5 Nov 2007, at 01:30, Kevin Mateo Lim wrote: > > the README.OSX reads: > Put > libSerial.jnilib > in the directory of the application (the JavaVM will find it there). > Add > RXTXComm.jar > to the application classpath or include the classes in the > application jar. > (Some applications already include the RXTX classes in their > application jar, > in which case only the file libSerial.jnilib is required). > > > I can't find libSerial.jnilib > I put librxtxSerial.jnilib into my Processing /libraries/serial/ > library/ directory. > > Yet it still sees the old version: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > On 11/4/07, Andre-John Mas wrote: > Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial .(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay (PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > 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 HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071105/7f50506d/attachment-0008.html From cyrille.dumont at tatexpress.fr Mon Nov 5 05:46:03 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 05 Nov 2007 13:46:03 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: References: <472727F1.1000704@tatexpress.fr> Message-ID: <472F108B.2090101@tatexpress.fr> Thanks a lot for your solution ... but I'm not a expert in JAVA ... (sorry) For the moment I've this function : """ public void serialEvent(SerialPortEvent e) { StringBuffer inputBuffer = new StringBuffer(); int newData = 0; switch (e.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } //-- Manag. Data from Scanner this.MngDataScanner(inputBuffer.toString()); break; case SerialPortEvent.BI:; //-- Break Received } } """ How can I do what you write ? ( maybe a simple ex ? ) PS : I don't know the PDF417 size (could be, for example, 338 char, or 500 ... ; what I know is that it can't be more than 800 char) Thanks in advance. Best regards. Trent Jarvi a ?crit : > 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 Martin.Oberhuber at windriver.com Mon Nov 5 08:47:50 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 5 Nov 2007 16:47:50 +0100 Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> Hi Trent, are the interestes of hobbyists really so different from commercial ones? Both should be interested in high quality and innovation the like. I haven't seen too many Open Source projects from the "inside" but those that I have seen did not have separate mailing lists for quality/testing/qa versus innovation/development. What I have seen with the Open Source projects that one would call "successful" is a good deal of process around automated builds, automated unit tests, predictable release dates and milestones, and policies around commiting/contributing/reviewing changes. I think that all of these benefit commercial users and hobbyists the like. If you were just asking about who's interested in discussing changes to foster more quality, count me in. I'm just not sure whether discussing these on a separate mailing list or other channel is the right thing to do. Cheers, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From toupsz at cs.tamu.edu Tue Nov 6 14:27:04 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 15:27:04 -0600 Subject: [Rxtx] reading TTL level signals from serial? Message-ID: Dear RXTX community- I've been using RXTX to handle communicating with several hardware devices in Java (a GPS and some custom audio circuitry for my dissertation work). I have a new, high-accuracy GPS which only communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there any way to communicate with this device using RXTX, perhaps by modding the native code for Windows? If so, does anyone have any tips on how to do it? Has it perhaps already been done? Another option is for me to invert / amplify the signal in hardware, but this is difficult for me to pull off due to the sensitivity of the electronics involved...I'll likely end up using a much less accurate piece of equipment rather than go that far! If anyone could help out, I'd really appreciate it! Thanks! -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/b6c59c2b/attachment-0006.html From netbeans at gatworks.com Tue Nov 6 14:55:22 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 06 Nov 2007 16:55:22 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: Message-ID: <4730E2CA.3090009@gatworks.com> This is really a hardware issue. Is there any device ( ie the serial port ) on your computer that will accept the voltage signals ( and load ) that your device produces? Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it happen safely ( ie u dont cook the GPS device ) I have a new, high-accuracy GPS which only > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there > any way to communicate with this device using RXTX, From toupsz at cs.tamu.edu Tue Nov 6 15:14:01 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 16:14:01 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4730E2CA.3090009@gatworks.com> References: <4730E2CA.3090009@gatworks.com> Message-ID: Actually, the device runs over USB, but shows up as a virtual serial port and is outputting these signals. The software that comes with the device (a u-blox ANTARIS 4 eval kit) is able to communicate. RXTX is able to detect and properly configure the port, but does not get any of the data from it. :-/ It seems like there must be some way to do it (obviously, ublox knows how)... -Zach On Nov 6, 2007 3:55 PM, U. George wrote: > This is really a hardware issue. > Is there any device ( ie the serial port ) on your computer that will > accept the voltage signals ( and load ) that your device produces? > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it > happen safely ( ie u dont cook the GPS device ) > > > I have a new, high-accuracy GPS which only > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there > > any way to communicate with this device using RXTX, > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/15ae7a0b/attachment-0006.html From keithvz at verizon.net Tue Nov 6 16:16:55 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 06 Nov 2007 18:16:55 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> Message-ID: <4730F5E7.1030704@verizon.net> Zach Toups wrote: > On Nov 6, 2007 3:55 PM, U. George > wrote: > > This is really a hardware issue. > Is there any device ( ie the serial port ) on your computer that will > accept the voltage signals ( and load ) that your device produces? > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it > happen safely ( ie u dont cook the GPS device ) > > > I have a new, high-accuracy GPS which only > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is > there > > any way to communicate with this device using RXTX, > _______________________________________________ As UGeorge intimated, it's a hardware issue. If your device outputs TTL level voltages, and your USB to serial converter is RS-232, then you've got a physical hardware differences. Inverted leads and voltage issues are mainly the problem. MAXIM makes a neat little chip called the MAX233 (better than the 232, no extern caps required) You can't solve this in software. Now, there are TTL level compatible USB to serial converters available, I happen to be using one right now. This unit below is from a UK company (there might be sources in the US) http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm Parallax makes one that does 3.3 and 5v http://www.parallax.com/detail.asp?product_id=32201 (but only supports RX, TX, GND, AND DTR towards device) (i've tested a variant of the unit above, and it works with RXTX) In both cases, you'll need some creative wiring depending on the interface on your GPS. Hope this helps Keith From toupsz at cs.tamu.edu Tue Nov 6 16:53:01 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 17:53:01 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4730F5E7.1030704@verizon.net> References: <4730E2CA.3090009@gatworks.com> <4730F5E7.1030704@verizon.net> Message-ID: Yeah...I used an FTDI chip to handle USB/serial conversion on the audio equipment I built. I'm leery of trying to build a board for this ublox GPS due to all the grounding/shielding issues around it. Anyway, I apreciate the help...just sad that I can't handle the problem in software! Ublox did send me the source code for their USB drivers...but as a Java programmer, it's a bit tough for me to sort out. ;) Thanks again! -Zach On Nov 6, 2007 5:16 PM, Keith Monahan wrote: > Zach Toups wrote: > > > On Nov 6, 2007 3:55 PM, U. George > > wrote: > > > > This is really a hardware issue. > > Is there any device ( ie the serial port ) on your computer that > will > > accept the voltage signals ( and load ) that your device produces? > > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make > it > > happen safely ( ie u dont cook the GPS device ) > > > > > > I have a new, high-accuracy GPS which only > > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is > > there > > > any way to communicate with this device using RXTX, > > _______________________________________________ > > As UGeorge intimated, it's a hardware issue. > > If your device outputs TTL level voltages, and your USB to serial > converter is RS-232, then you've got a physical hardware differences. > Inverted leads and voltage issues are mainly the problem. MAXIM makes a > neat little chip called the MAX233 (better than the 232, no extern caps > required) > > You can't solve this in software. > > Now, there are TTL level compatible USB to serial converters available, > I happen to be using one right now. > > This unit below is from a UK company (there might be sources in the US) > > http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm > > Parallax makes one that does 3.3 and 5v > > http://www.parallax.com/detail.asp?product_id=32201 > (but only supports RX, TX, GND, AND DTR towards device) > > (i've tested a variant of the unit above, and it works with RXTX) > > In both cases, you'll need some creative wiring depending on the > interface on your GPS. > > Hope this helps > > Keith > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/06e88ad4/attachment-0006.html From netbeans at gatworks.com Tue Nov 6 17:14:01 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 06 Nov 2007 19:14:01 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> <4730F5E7.1030704@verizon.net> Message-ID: <47310349.5000406@gatworks.com> what gps chipset do u have? > Ublox did send me the source code for their USB drivers...but as a Java > programmer, it's a bit tough for me to sort out. ;) From Steffen.DETTMER at ingenico.com Wed Nov 7 03:10:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 7 Nov 2007 11:10:01 +0100 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> Message-ID: <20071107101000.GN10978@elberon.bln.de.ingenico.com> * Zach Toups wrote on Tue, Nov 06, 2007 at 16:14 -0600: > Actually, the device runs over USB, but shows up as a virtual > serial port and is outputting these signals. Ahh, so what you want is to use rxtx on the serial port that is created by the driver and mapped maybe as some COM8 or whatever? I this case then IMHO it would be no hardware question but maybe a problem in your application, or some driver or indeed a rxtx issue. > The software that > comes with the device (a u-blox ANTARIS 4 eval kit) is able to > communicate. Is it sure that this software is really using the virtual serial port and only this port? oki, Steffen -- About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Wed Nov 7 04:59:10 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 06:59:10 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <20071107101000.GN10978@elberon.bln.de.ingenico.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> Message-ID: <4731A88E.6080705@gatworks.com> >> The software that >> comes with the device (a u-blox ANTARIS 4 eval kit) is able to >> communicate. > > Is it sure that this software is really using the virtual serial > port and only this port? > I have tried to read the docs. I have yet to find any explanation on a (windoz) device driver for this device ( the usb device ). That magic is not explained. For a developer thats important magic. Maybe a call to their support team is in order? From netbeans at gatworks.com Wed Nov 7 05:01:38 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 07:01:38 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <20071107101000.GN10978@elberon.bln.de.ingenico.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> Message-ID: <4731A922.7@gatworks.com> Steffen DETTMER wrote: > * Zach Toups wrote on Tue, Nov 06, 2007 at 16:14 -0600: >> Actually, the device runs over USB, but shows up as a virtual BTW: it seems that I am not getting all the Rxtx mail. Is there still a problem? From toupsz at cs.tamu.edu Wed Nov 7 07:36:20 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Wed, 7 Nov 2007 08:36:20 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4731A88E.6080705@gatworks.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> <4731A88E.6080705@gatworks.com> Message-ID: When I emailed them about this issue, they sent me their WinCE drivers, which are apparently based on this open source driver: http://www.yetanotherhomepage.com/j7xx/j7xx.html?/j7xx/software/util/usbdriver.html These include srcdll, and x86 subfolders, though it's not 100% clear to me that these are useful. The ublox communication suite appears to only communicate with serial ports...I've communicated with the ublox on two different comm ports (one with the serial adapter plugged into the serial port, one with the main USB connection), as well as a Garmin bluetooth GPS (which comes up as a bluetooth serial device). I'm not well versed in code this close to the hardware, but it seems to me that if you're running a virtual serial port, then you're virtually controlling the "voltages" that come in on this "port"...so why would they be "ttl level"? :-/ Shouldn't the USB driver be able to interpret the signals in whatever way it wants and just supply software with the binary interpretation? Thanks for all the help, guys, it's really appreciated! -Zach On Nov 7, 2007 5:59 AM, U. George wrote: > > >> The software that > >> comes with the device (a u-blox ANTARIS 4 eval kit) is able to > >> communicate. > > > > Is it sure that this software is really using the virtual serial > > port and only this port? > > > > I have tried to read the docs. I have yet to find any explanation on a > (windoz) device driver for this device ( the usb device ). That magic > is not explained. For a developer thats important magic. Maybe a call > to their support team is in order? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071107/18a13314/attachment-0004.html From netbeans at gatworks.com Wed Nov 7 08:55:55 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 10:55:55 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> <4731A88E.6080705@gatworks.com> Message-ID: <4731E00B.9030902@gatworks.com> There are 2 components to talking to hardware. There is the electrical specification, and then there is the software specification. there is the rs232 specification, parallel port specification, and the USB electrical specification. Generally these are used to plug in the various devices, and hook up electrically. Then there is the software side. There is the device driver, a software component that sits somewhere in the kernel that handles the USB ( in your case ) controller. The device driver generally does not care about the electrical component. There are various chips that handle USB signals, and these chips have I/O addresses so that signals and data can be properly routed. There is also the side that communicates to the user via the COM port device-name. The device driver that you mentioned is for the "Support PL2303 serial chip". This device driver, which hopefully works, handles the USB chip, and eventually recognzes the gps device, and hopefully creates an COM port so the user can open up and communicate. These are a lot of "HOPES". Since u have the web address of the device driver, and developer, I would think that the developer, and any docs, might be better able to help u to first determine if the GPS device is recognized, and the COM port ( maybe its called by another name ) is created, as per documentation. > > These include srcdll, and x86 subfolders, though it's not 100% clear to > me that these are useful. From tjarvi at qbang.org Sat Nov 10 17:46:13 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Nov 2007 17:46:13 -0700 (MST) Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 5 Nov 2007, Oberhuber, Martin wrote: > Hi Trent, > > are the interestes of hobbyists really so different > from commercial ones? Both should be interested in > high quality and innovation the like. > > I haven't seen too many Open Source projects from the > "inside" but those that I have seen did not have > separate mailing lists for quality/testing/qa > versus innovation/development. > > What I have seen with the Open Source projects that > one would call "successful" is a good deal of > process around automated builds, automated unit > tests, predictable release dates and milestones, > and policies around commiting/contributing/reviewing > changes. > > I think that all of these benefit commercial users > and hobbyists the like. > > If you were just asking about who's interested in > discussing changes to foster more quality, count > me in. I'm just not sure whether discussing these > on a separate mailing list or other channel is the > right thing to do. > Hi Martin, There are two issues I'm thinking about. The first is the generic unit testing and quality initiatives required to move rxtx forward. The second is the inevitable fact that rxtx connects to external hardware. The discussion deals with a different set of problems. Here is a simple example of what I'm getting at. We have the capability of setting custom baud rates in rxtx. We may be interested in seeing regressions in rxtx, the C library or the kernel. Some people may be doing some tests with loopback connections. These will always work even if the baud rate is not set to the expected value. Some people may use null modems between two ports. This may be able to catch the problem but not always. Will the build machines be able to test this? (no - for a few reasons) Will people be trying to catch these type of regressions? (yes) What type of coverage does the community have in the end? (?) We could include the discussions in the same list or another equally open list that may be of interest to some folks that deal with these types of problems on a regular basis. -- Trent Jarvi tjarvi at qbang.org From timlow84 at gmail.com Mon Nov 12 00:31:17 2007 From: timlow84 at gmail.com (Timothy Low) Date: Mon, 12 Nov 2007 15:31:17 +0800 Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> Message-ID: <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> ---------- Forwarded message ---------- From: Timothy Low Date: Nov 12, 2007 3:02 PM Subject: Building RXTX From Source To: taj at www.linux.org.uk Cc: ferdinand.tang at tangs.net, Timothy Low , chweehuat.ng at tangs.net Hi Trent, I tried building RXTX from source, and I got this error. I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm trying to get the necessary ".so" files to use for my serial port communication through java. My linux kernal information is: *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 x86_64 x86_64 x86_64 GNU/Linux* I'll most glad if you can provide me some direction on this. Thanks ! ---------------- [root at smsgateway rxtx-2.0-7pre1]# ./configure checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu configure: WARNING: Trying libtool. If the following fails install libtool checking for gcc... gcc checking for C compiler default output... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking for ld used by GCC... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking for a sed that does not truncate output... /bin/sed checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking command to parse /usr/bin/nm -B output... ok checking how to run the C preprocessor... gcc -E checking for egrep... grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for ranlib... ranlib checking for strip... strip checking for objdir... .libs checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.lo... yes checking if gcc supports -fno-rtti -fno-exceptions... yes checking whether the linker (/usr/bin/ld) supports shared libraries... yes checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking dynamic linker characteristics... GNU/Linux ld.so checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no checking whether -lc should be explicitly linked in... no creating libtool checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking for style of include used by make... GNU checking dependency style of gcc... none checking fcntl.h usability... yes checking fcntl.h presence... yes checking for fcntl.h... yes checking sys/fcntl.h usability... yes checking sys/fcntl.h presence... yes checking for sys/fcntl.h... yes checking sys/file.h usability... yes checking sys/file.h presence... yes checking for sys/file.h... yes checking sys/time.h usability... yes checking sys/time.h presence... yes checking for sys/time.h... yes checking sys/signal.h usability... yes checking sys/signal.h presence... yes checking for sys/signal.h... yes checking signal.h usability... yes checking signal.h presence... yes checking for signal.h.. . yes checking termios.h usability... yes checking termios.h presence... yes checking for termios.h... yes checking asm/termbits.h usability... yes checking asm/termbits.h presence... yes checking for asm/termbits.h... yes checking grp.h usability... yes checking grp.h presence... yes checking for grp.h... yes checking pwd.h usability... yes checking pwd.h presence... yes checking for pwd.h... yes checking whether gcc needs -traditional... no checking whether to enable maintainer-specific portions of Makefiles... no /usr/java/jdk1.5.0_13 configure: WARNING: using JAVA_HOME environmental variable adjusted java.home is /usr/java/jdk1.5.0_13 checking os.name Linux checking os.arch i386 checking java.vendor Sun Microsystems Inc. checking java.version 1.5.0_13 checking os.version 2.6.18-8.el5xen comm.jar appears to be installed already. conftest.c: In function 'main': conftest.c:6: warning: incompatible implicit declaration of built-in function 'printf' conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:6: error: (Each undeclared identifier is reported only once conftest.c:6: error: for each function it appears in.) conftest.c:6: error: expected ')' before string constant conftest.c:7: warning: incompatible implicit declaration of built-in function 'exit' ./configure: line 9649: ./conftest: No such file or directory ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected conftest.c: In function 'main': conftest.c:5: warning: incompatible implicit declaration of built-in function 'printf' conftest.c:10: warning: incompatible implicit declaration of built-in function 'exit' configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status : config.h is unchanged config.status: executing depfiles commands [root at smsgateway rxtx-2.0-7pre1]# make install /usr/java/jdk1.5.0_13/bin/javac -classpath .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d /home/jboss/sources/rxtx- 2.0-7pre1/ -O /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java /home/jboss/sources/rxtx-2.0-7pre1/./src/UnSupportedLoggerException.java /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o /home/jboss/sources/rxtx-2.0-7pre1/x86_64-unknown-linux-gnu/SerialImp.lo /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'init_threads': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: cast from pointer to integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_nativeDrain': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: cast to pointer from integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'read_byte_array': /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: cast to pointer from integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_readArray': /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: comparison is always false due to limited range of data type /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_readTerminatedArray': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: comparison is always false due to limited range of data type mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial- 2.0.7pre1.* gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so -o .libs/librxtxSerial-2.0.7pre1.so (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.0.7pre1.so librxtxSerial.so) creating librxtxSerial.la (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la librxtxSerial.la) gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/ParallelImp.lo /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function 'Java_javax_comm_LPRPort_readArray': /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: comparison is always false due to limited range of data type rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* .libs/librxtxParallel-2.0.7pre1.* gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so -o .libs/librxtxParallel- 2.0.7pre1.so (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.0.7pre1.so librxtxParallel.so) creating librxtxParallel.la (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la librxtxParallel.la) make all-am make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' libtool: install: `x86_64-unknown-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 ------------- Regards, Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071112/27758c3c/attachment-0001.html From tjarvi at qbang.org Mon Nov 12 01:02:09 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Nov 2007 01:02:09 -0700 (MST) Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> Message-ID: On Mon, 12 Nov 2007, Timothy Low wrote: > > Hi Trent, Hi Tim, Comments are inline. As I mentioned off the list, rxtx 2.0 is on the edge of deprecation. We can get it working but this is not the path of least resistance for future work. You will probably need to bounce another round of questions off the list. The following is intended to isolate the problem. > > I tried building RXTX from source, and I got this error. > > > I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm trying > to get the necessary ".so" files to use for my serial port communication > through java. > My linux kernal information is: > > *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 x86_64 > x86_64 x86_64 GNU/Linux* > > I'll most glad if you can provide me some direction on this. Thanks ! > > ---------------- > [root at smsgateway rxtx-2.0-7pre1]# ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > checking for C compiler default output... a.out > checking whether the C compiler works... yes > checking whether we are cross compiling... no > checking for suffix of executables... > checking for suffix of object files... o > checking whether we are using the GNU C compiler... yes > checking whether gcc accepts -g... yes > checking for gcc option to accept ANSI C... none needed > checking for ld used by GCC... /usr/bin/ld > checking if the linker (/usr/bin/ld) is GNU ld... yes > checking for /usr/bin/ld option to reload object files... -r > checking for BSD-compatible nm... /usr/bin/nm -B > checking for a sed that does not truncate output... /bin/sed > checking whether ln -s works... yes > checking how to recognise dependent libraries... pass_all > checking command to parse /usr/bin/nm -B output... ok > checking how to run the C preprocessor... gcc -E > checking for egrep... grep -E > checking for ANSI C header files... yes > checking for sys/types.h... yes > checking for sys/stat.h... yes > checking for stdlib.h... yes > checking for string.h... yes > checking for memory.h... yes > checking for strings.h... yes > checking for inttypes.h... yes > checking for stdint.h... yes > checking for unistd.h... yes > checking dlfcn.h usability... yes > checking dlfcn.h presence... yes > checking for dlfcn.h... yes > checking for ranlib... ranlib > checking for strip... strip > checking for objdir... .libs > checking for gcc option to produce PIC... -fPIC > checking if gcc PIC flag -fPIC works... yes > checking if gcc static flag -static works... yes > checking if gcc supports -c -o file.o... yes > checking if gcc supports -c -o file.lo... yes > checking if gcc supports -fno-rtti -fno-exceptions... yes > checking whether the linker (/usr/bin/ld) supports shared libraries... yes > checking how to hardcode library paths into programs... immediate > checking whether stripping libraries is possible... yes > checking dynamic linker characteristics... GNU/Linux ld.so > checking if libtool supports shared libraries... yes > checking whether to build shared libraries... yes > checking whether to build static libraries... no > checking whether -lc should be explicitly linked in... no > creating libtool > checking for a BSD-compatible install... /usr/bin/install -c > checking whether build environment is sane... yes > checking for gawk... gawk > checking whether make sets $(MAKE)... yes > checking for style of include used by make... GNU > checking dependency style of gcc... none > checking fcntl.h usability... yes > checking fcntl.h presence... yes > checking for fcntl.h... yes > checking sys/fcntl.h usability... yes > checking sys/fcntl.h presence... yes > checking for sys/fcntl.h... yes > checking sys/file.h usability... yes > checking sys/file.h presence... yes > checking for sys/file.h... yes > checking sys/time.h usability... yes > checking sys/time.h presence... yes > checking for sys/time.h... yes > checking sys/signal.h usability... yes > checking sys/signal.h presence... yes > checking for sys/signal.h... yes > checking signal.h usability... yes > checking signal.h presence... yes > checking for signal.h.. . yes > checking termios.h usability... yes > checking termios.h presence... yes > checking for termios.h... yes > checking asm/termbits.h usability... yes > checking asm/termbits.h presence... yes > checking for asm/termbits.h... yes > checking grp.h usability... yes > checking grp.h presence... yes > checking for grp.h... yes > checking pwd.h usability... yes > checking pwd.h presence... yes > checking for pwd.h... yes > checking whether gcc needs -traditional... no > checking whether to enable maintainer-specific portions of Makefiles... no > /usr/java/jdk1.5.0_13 > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /usr/java/jdk1.5.0_13 > checking os.name Linux > checking os.arch i386 > checking java.vendor Sun Microsystems Inc. > checking java.version 1.5.0_13 > checking os.version 2.6.18-8.el5xen > comm.jar appears to be installed already. > conftest.c: In function 'main': > conftest.c:6: warning: incompatible implicit declaration of built-in > function 'printf' > conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:6: error: (Each undeclared identifier is reported only once > conftest.c:6: error: for each function it appears in.) > conftest.c:6: error: expected ')' before string constant This is an outdated kernel version check for when headers and kernels could cause problems for rxtx. If we made it past this, then you are OK. > conftest.c:7: warning: incompatible implicit declaration of built-in > function 'exit' > ./configure: line 9649: ./conftest: No such file or directory > ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected It blew up but continues.. > conftest.c: In function 'main': > conftest.c:5: warning: incompatible implicit declaration of built-in > function 'printf' > conftest.c:10: warning: incompatible implicit declaration of built-in > function 'exit' > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status : config.h is unchanged > config.status: executing depfiles commands > [root at smsgateway rxtx-2.0-7pre1]# make install > /usr/java/jdk1.5.0_13/bin/javac -classpath > .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d > /home/jboss/sources/rxtx- 2.0-7pre1/ -O > /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java > /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/UnSupportedLoggerException.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java > Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or > overrides a deprecated API. > Note: Recompile with -Xlint:deprecation for details. > /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* The java jar should be fine now. You may need to change the source files as mentioned below. > gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. > -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g > -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o > /home/jboss/sources/rxtx-2.0-7pre1/x86_64-unknown-linux-gnu/SerialImp.lo > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'init_threads': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: cast > from pointer to integer of different size > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_nativeDrain': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: cast to > pointer from integer of different size > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'read_byte_array': > /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: cast to > pointer from integer of different size As I recall, this was caused by pointers (now 64 bit rather than 32 bit) being stored in java ints (jints). I would look at the diff between the CVS 2.1 SerialImp.c and RXTXPort.java files against 2.0. We did fix those issues. You have a .so file but the different pointer sizes will cause runtime errors. > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_readArray': > /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: > comparison is always false due to limited range of data type > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_readTerminatedArray': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: > comparison is always false due to limited range of data type > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial- > 2.0.7pre1.* > gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so -o > .libs/librxtxSerial-2.0.7pre1.so > (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.0.7pre1.so > librxtxSerial.so) > creating librxtxSerial.la > (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la > librxtxSerial.la) > gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. > -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g > -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o > /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/ParallelImp.lo > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function > 'Java_javax_comm_LPRPort_readArray': > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: > comparison is always false due to limited range of data type > rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* > .libs/librxtxParallel-2.0.7pre1.* > gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so -o > .libs/librxtxParallel- 2.0.7pre1.so > (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.0.7pre1.so > librxtxParallel.so) > creating librxtxParallel.la > (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la > librxtxParallel.la) > make all-am > make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' > make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' > libtool: install: `x86_64-unknown-linux-gnu' must be an absolute directory > name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 A libtool change? Assuming you ran configure && make install in /home/jboss/sources/rxtx- 2.0-7pre1, libtool is looking for /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/.libs/librxtxSerial-2.0.7pre1.so. I think you have this? The file is just being copied to ~JAVA/jre/lib/$(JAVA_ARCH). -- Trent Jarvi tjarvi at qbang.org From keithvz at verizon.net Thu Nov 1 08:08:58 2007 From: keithvz at verizon.net (Keith) Date: Thu, 01 Nov 2007 10:08:58 -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: <4729DDFA.7080206@verizon.net> Trent Jarvi wrote: > 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? Well, I honestly don't know how all this fits together. I think it's just a matter of enabling the right flow control option within the standard serial framework to tell the device driver, "HEY START USING DTR/DSR FOR FLOW CONTROL." If what UGeorge said,(about that type of nitty-gritty lead control being done within the device driver), is true, then this confirms my suspicion. I tried narrowing down within the Linux drivers what you are looking for, but I can't entirely tell wth I'm looking at. (virtual com port drivers -- they are included compiled by default with Ubuntu, source included) http://www.ftdichip.com/Drivers/VCP/Linux/ftdi_sio.tar.gz Hahahaa, they make a reference to DTR flow control being supported but say (UGH) in parenthesis. You can also use their direct device driver library on Ubuntu -- libftd2xx.so.0.4.13. No source code. http://www.ftdichip.com/Drivers/D2XX/Linux/libftd2xx0.4.13.tar.gz In that case, you make a call to their FT_SetFlowControl() function. FT_STATUS FT_SetFlowControl (FT_HANDLE ftHandle, USHORT usFlowControl, UCHAR uXon,UCHAR uXoff) Parameters ftHandle Handle of the device. usFlowControl Must be one of FT_FLOW_NONE, FT_FLOW_RTS_CTS, ****FT_FLOW_DTR_DSR**** or FT_FLOW_XON_XOFF. uXon Character used to signal Xon. Only used if flow control is FT_FLOW_XON_XOFF. uXoff Character used to signal Xoff. Only used if flow control is FT_FLOW_XON_XOFF. This is from their programming guide http://www.ftdichip.com/Documents/ProgramGuides/D2XXPG34.pdf I actually want to take this a step further and say that I think the flow control is actually handled right on the device itself in hardware/firmware. It's enabled through the device driver, but I think the maintaining of buffers, asserting/deasserting of leads, etc is handled by the device. For the time being, I've switched to jd2xx, https://jd2xx.dev.java.net/ and http://bleyer.org/jd2xx/ These are Java wrappers for the device driver libraries. It allows almost direct access to the well-documented device drivers from Java. I hope this helps Keith From tjarvi at qbang.org Thu Nov 1 11:09:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:09:51 -0600 (MDT) 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: Hi Martin, What I usually have done is allow changes that do not impact working software including changes to methods not documented in CommAPI (which remain undocumented in rxtx) and fixes to known problems in the documented portions. That way if you use the documented API, the releases should only become better with time. If you use the undocumented portions, the behavior is not as predictable but open for improvement. On Wed, 31 Oct 2007, 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 >> > From tjarvi at qbang.org Thu Nov 1 11:15:52 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:15:52 -0600 (MDT) 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: I too use rxtx in commercial products. The problem I've been trying to address while bringing the server back was how to make it possible for hobby folks to build the same software as companies so we can move rxtx along a little faster. Exposing internal tools is not an option at this time, the public rxtx builds have been done on my home machine which has drives hanging out of it all over the place dying one at a time. This isn't maintainable. I'm currently looking at the possibility of making an S3 image available on Amazon's EC. These are machines you can rent for ~10 cents an hour which is more than enough to build rxtx. The S3 image is not changed when people use it so everyone has the same starting point. With this, we could all build rxtx for ~20 platforms for a small price and eliminate tool issues. On Wed, 31 Oct 2007, Greg Johnson wrote: > 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 tjarvi at qbang.org Thu Nov 1 11:19:55 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:19:55 -0600 (MDT) 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: On Wed, 31 Oct 2007, 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. I was helping Dmitry do the Mac OS X port without access to a machine when we put that in. In the archives there is information (easily found with google on Apple's site) that describes how their API (and others) can determine if a port is used and ignore it. I think these changes are in CVS but need to confirm. The bottom line is that rxtx should not have used lock files on Mac. It was just ignorance of the system on my part. -- Trent Jarvi tjarvi at qbang.org From fabioanjos at gmail.com Thu Nov 1 12:35:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Thu, 1 Nov 2007 15:35:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Hi, I was using SerialEventListener in my project. But, as was said here, id doesnt work very well with virtual serial ports. So, I changed the strategy using the code posted here in this thread: try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > 0) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } The thing is that in my tests I could notice that in.read(buffer) never blocks. Even when there's nothing to read. Instead of blocking when there's nothing to read it returns 0. So, my questions are: 1. Am I doing something wrong? 2. If not, wouldnt this decrease performance? (the thread would be locked in a loop that does nothing.) 3. Is there a better way to do the job? Thanks in advance!! F?bio -------- On 10/31/07, Andre-John Mas wrote: > > > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/0aee59d0/attachment-0012.html From ajmas at sympatico.ca Thu Nov 1 16:07:55 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Nov 2007 18:07:55 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Message-ID: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From sarah_662005 at yahoo.com Thu Nov 1 17:10:05 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Thu, 1 Nov 2007 16:10:05 -0700 (PDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Message-ID: <351433.37166.qm@web55814.mail.re3.yahoo.com> Thank you very much for your help. Now the application works fine. the serialEvent gets triggered. Rxtx is cool! ----- Original Message ---- From: Andre-John Mas To: Sara Hugh ; RXTX Developers and Users Sent: Wednesday, October 31, 2007 9:55:45 AM Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered 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 __________________________________________________ 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/20071101/4a86bea6/attachment-0012.html From tjarvi at qbang.org Thu Nov 1 17:58:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 17:58:02 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx Message-ID: The rxtx.org site is primarily interested in the hobby aspects of rxtx. Obviously, there are some companies following the work too. These interests bring larger workflows and concerns about details hobby folks may not care about. They also bring many more users. I know the company I work for has a quality engineering effort going on which includes rxtx. While the server was down, I was contacted by another company that was missing the binaries for their testing. Several people have mentioned concerns about a stable release for like reasons. Would there be interest on the quality side of the coin to get together? It could be just sharing email's with each other or a seperate list for QE/QA. I can not say for sure, but we may be able to share some of our efforts/results that could help keep rxtx releases stable. -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Fri Nov 2 01:42:55 2007 From: scldad at sdc.com.au (Stephen Davies) Date: Fri, 2 Nov 2007 18:12:55 +1030 Subject: [Rxtx] Multiple modems Message-ID: <200711021812.56047.scldad@sdc.com.au> This may or may not be related to the Multiple Ports thread. I have an application which uses rxtx on Linux (via cron jobs) to connect multiple modems to remote sensing devices. The application works fine most of the time but occasionally fails to connect if two (or more) connection attempts happen at about the same time. When it fails, it looks as if it may get confused as to which port it is talking to. The app has a "base" component that looks for an available port, opens it and then creates an input thread and an output thread for the connection and data transfer. The "base" component uses this code: // loop round all known ports until one is available. Give up after three minutes Counter ptimeout = new Counter(); while(!portFound && ptimeout.elapsed() < 180000) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // special case. ttyS0 is not available to us on this server. if (!portId.isCurrentlyOwned() && !portId.getName().equals("/dev/ttyS0")) { gLog.debug(lognm + ": Found port " + portId.getName()); try { serialPort = (RXTXPort) portId.open("AguaModem", 10000); } catch (Exception e) { gLog.error(lognm + ": Port " + portId.getName() + " will not open."); gLog.error(e.getMessage()); continue; } AguaModem aguamodem = new AguaModem(); portFound = true; break; } gLog.debug(lognm + ": Port " + portId.getName() + " is busy"); } } } I am wondering about the isCurrentlyOwned method. Does this actually tell me whether a port is currently being used by another process? TIA, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From fabioanjos at gmail.com Fri Nov 2 04:59:58 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 07:59:58 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Message-ID: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/9009eb1d/attachment-0012.html From netbeans at gatworks.com Fri Nov 2 06:28:13 2007 From: netbeans at gatworks.com (U. George) Date: Fri, 02 Nov 2007 08:28:13 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <472B17DD.1050508@gatworks.com> It should normally block ( unless eof / event ) . so its a :{ whats the device ( to recreate if possible ) and how do u open. > My question is, is there a way to make in.read block the thead until > there's something to read? > From fabioanjos at gmail.com Fri Nov 2 06:34:46 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 09:34:46 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > On 11/1/07, Andre-John Mas wrote: > > > > Fabio, > > > > Turns out there was a small error in my example. The test should be: > > > > (numBytes = in.read(buffer)) > -1 > > > > This is because -1 indicates an end of file (end of data stream) > > > > Andre > > > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > > > Hi, > > > > > > I was using SerialEventListener in my project. But, as was said > > > here, id doesnt work very well with virtual serial ports. > > > So, I changed the strategy using the code posted here in this thread: > > > > > > try{ > > > in = port.getInputStream(); > > > out = port.getOutputStream(); > > > int numBytes = 0; > > > while(active){ > > > > > > byte[] buffer = new byte[10]; > > > > > > while ( (numBytes = in.read(buffer)) > 0) > > > { > > > String dataValue = new String(buffer,0,numBytes); > > > processInput(dataValue); > > > } > > > > > > if(numBytes==-1){ > > > break; > > > } > > > > > > Thread.sleep(50); > > > } > > > > > > }catch(IOException e){ > > > logger.info("falha de comunicacao "+ > > > getReceptor().getPort() ); > > > > > > }catch(InterruptedException e){ > > > logger.info ("Interrompendo leitura da porta "+ > > > getReceptor().getPort() ); > > > } > > > > > > The thing is that in my tests I could notice that in.read(buffer) > > > never blocks. Even when there's nothing to read. Instead of blocking > > > when there's nothing to read it returns 0. > > > > > > So, my questions are: > > > > > > 1. Am I doing something wrong? > > > 2. If not, wouldnt this decrease performance? (the thread would be > > > locked in a loop that does nothing.) > > > 3. Is there a better way to do the job? > > > > > > Thanks in advance!! > > > > > > F?bio > > > -------- > > > > > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > > 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 > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > > > > > -- > > > Atenciosamente, > > > F?bio Cristiano dos Anjos > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/5306c4b1/attachment-0012.html From nick.circelli at infrasafe.com Fri Nov 2 07:01:17 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Fri, 2 Nov 2007 08:01:17 -0500 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com><29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com><90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca><29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Message-ID: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> I'm pretty sure that not blocking has to do with you virtual ports. Cause it should block. Maybe you should try: while ((numBytes = in.available()) > 0) { If (numBytes > buffer.length) { numBytes = buffer.length; // in case you have buffer overflow } numBytes = in.read(buffer, 0 , numBytes)); String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } Also, just for optimization, I'd move that byte[] buffer = new byte[10]; out of the while since you don't need to reallocate it every iteration. ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of F?bio Cristiano dos Anjos Sent: Friday, November 02, 2007 8:35 AM To: RXTX Developers and Users Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream (); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas < ajmas at sympatico.ca > wrote: Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info ("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Atenciosamente, F?bio Cristiano dos Anjos -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/4de7f6a3/attachment-0012.html From fabioanjos at gmail.com Fri Nov 2 07:36:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 10:36:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> Message-ID: <29788b250711020636q1588c88fgaa5e27f5504164fb@mail.gmail.com> Hi Nick, Actually, it doesnt block for physical ports too. And, the method avaiable does not block either, so when there's nothing avaiable the loop ends and the thread stops lintening to the port. But I did some more test with serialEventListener, and now its working. I realy dont know what I've done to get it working. I just start woking as soon as I decided to test it again. It was said here that serialEventListener is not reliable for virtual serial ports. Is there another way to read it, without compromising performance? Tanks again!! F?bio ------- On 11/2/07, Nick Circelli wrote: > > I'm pretty sure that not blocking has to do with you virtual ports. > Cause it should block. > > Maybe you should try: > > > > while ((numBytes = in.available()) > 0) > > { > > If (numBytes > buffer.length) { > > numBytes = buffer.length; // in case you have buffer overflow > > } > > numBytes = in.read(buffer, 0 , numBytes)); > > String dataValue = new String(buffer,0,numBytes,"ASCII"); > > processInput(dataValue); > > } > > > > Also, just for optimization, I'd move that byte[] buffer = new > byte[10]; > > out of the while since you don't need to reallocate it every iteration. > > > ------------------------------ > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On Behalf > Of *F?bio Cristiano dos Anjos > *Sent:* Friday, November 02, 2007 8:35 AM > *To:* RXTX Developers and Users > *Subject:* Re: [Rxtx] serialEvent(SerialPortEvent event) never be > triggered > > > > Hi, > > I think i missunderstand something here. > The code you post here was meant to be used inside serialEvent method, > right? > > The think is, that i cannot user SerialEventListener to read serial ports, > because i need to read virual serial ports and id does not behaves well, as > said here before. serialEvent is never triggered. > > So what I quit using SerialEventListener and created a thread to listen to > the port: > > public void run(){ > try{ > in = port.getInputStream(); > out = port.getOutputStream (); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new > String(buffer,0,numBytes,"ASCII"); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ getReceptor().getPort() > ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > } > > > So, the problem is that in.read(buffer) always returns 0 when there is > nothing to read, instead of blocking the flow, and the thread becames locked > in the loop. > > I hope you can help me solve this. > > Thanks in advance! > > F?bio > -------- > > On 11/2/07, *F?bio Cristiano dos Anjos* wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > > > On 11/1/07, *Andre-John Mas* < ajmas at sympatico.ca> wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info ("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/571df6ea/attachment-0011.html From tjarvi at qbang.org Fri Nov 2 08:32:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Nov 2007 08:32:15 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: References: Message-ID: On Fri, 2 Nov 2007, Greg Johnson wrote: > Hi Trent, folks, > Having a single rxtx that is suitable for commercial uses and hobbyists both > would be a great idea? Perhaps it would be worth submitting rxtx as a > proposal to Codehaus - they not only provide excellent tools (Jira (bug > tracker), Confluence (wiki)) but also support build management ( > maestro, continuum, bamboo). Relying on your personal machine (btw, frii.com > / rxtx.org is down again?) seems like a burden you shouldn't have to shoulder > alone. Hi Greg, There may be a little confusion here. There is no need to have two seperate rxtx releases. What I'm trying to encourage is a discussion between some of the people responsible for making sure rxtx does not break their products each release. Usually these people are interested in testing a set of functionality their product depends upon. They do not work with rxtx code but rather traps to catch when rxtx developers break something. This goes on all the time in isolated labs. There are many services that offer to do various pieces of a project for you if you... Anyone is free to do the 'if you' portion with rxtx and see how it goes. I'm actually interested in doing less of that than more. The rxtx.org work I do just happens to overlap with other things I do for personal/family use. The reason I suggest the amazon solution is that anyone can take full control of the environment for a day and it costs less than a package of gum without causing harm to what anyone else is doing. I assume the down question was with respect to a mod_security setting that has been resolved. If not, please post a url to the problem. -- Trent Jarvi tjarvi at qbang.org From nsayer at kfu.com Sat Nov 3 20:17:49 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 19:17:49 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? Message-ID: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Has anyone got RXTX working with an app under Leopard? My app hangs on port open (it works fine with Tiger). The relevant thread looks like this in the activity monitor: 1536 JVM_InvokeMethod 1536 0x48ccd0 1536 0x46f8a0 1536 0x4c3ff4 1536 0x4c4284 1536 0x357d160 1536 0x357faac 1536 Java_gnu_io_RXTXPort_open 1536 open $NOCANCEL$UNIX2003 1536 open $NOCANCEL$UNIX2003 From ajmas at sympatico.ca Sat Nov 3 22:02:04 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 00:02:04 -0400 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> RXTX works for me with Leopard. I am currently using it communicate with a Bluetooth GPS. What computer and device are you trying to use? Is the driver for your serial device compatible with MacOS X 10.5? Andre On 3-Nov-07, at 22:17 , Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From nsayer at kfu.com Sat Nov 3 22:17:47 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 21:17:47 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> Message-ID: <1720F723-3643-438C-B3AB-E09A67536977@kfu.com> On Nov 3, 2007, at 9:02 PM, Andre-John Mas wrote: > RXTX works for me with Leopard. I am currently using it communicate > with a Bluetooth GPS. > > What computer and device are you trying to use? Is the driver for > your serial device compatible with MacOS X 10.5? An Intel mac mini The FTDI USB serial driver an XMPCR, which is just a fancy serial controlled radio and an FTDI usb-to-serial chip I've successfully used the FTDI driver with another FTDI device in another context. > > > Andre > > On 3-Nov-07, at 22:17 , Nick Sayer wrote: > >> Has anyone got RXTX working with an app under Leopard? >> >> My app hangs on port open (it works fine with Tiger). The relevant >> thread looks like this in the activity monitor: >> >> 1536 JVM_InvokeMethod >> 1536 0x48ccd0 >> 1536 0x46f8a0 >> 1536 0x4c3ff4 >> 1536 0x4c4284 >> 1536 0x357d160 >> 1536 0x357faac >> 1536 >> Java_gnu_io_RXTXPort_open >> 1536 open >> $NOCANCEL$UNIX2003 >> 1536 open >> $NOCANCEL$UNIX2003 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From racecar at gmail.com Sat Nov 3 22:25:53 2007 From: racecar at gmail.com (Kevin Mateo Lim) Date: Sat, 3 Nov 2007 21:25:53 -0700 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: Message-ID: I am alternating between two errors. After i run the macosx_setup.command, "everyone" is set to Read only in /var/lock. I notice in the terminal that the group for these perms is _uucp, not uucp. In that state, I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 check_group_uucp(): error testing lock file creation Error details:Permission deniedcheck_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException : Error inside Serial.() at processing.serial.Serial.errorMessage(Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.( Serial.java:102) at Temporary_829_3245.setup(Temporary_829_3245.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java :690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) Then, I hand edit the "everyone" permissions for /var/lock/ to Read and Write (note /var/spool/uucp is Read/Write in all cases, and doesn't change). I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX uucp_lock() /var/lock/LK.003.009.000 is there gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException: Error inside Serial.() at processing.serial.Serial.errorMessage (Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.(Serial.java:102) at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java:690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) See here: http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071103/f1a2c467/attachment-0010.html From greg.johnson at manchester.ac.uk Sun Nov 4 02:31:13 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sun, 4 Nov 2007 10:31:13 +0100 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <28B5E0A0-0802-4C74-AC21-87ED35F3B9A2@manchester.ac.uk> Hi Nick, I also had problems initially with Leopard, but it was resolved by reinstalling the serial USB driver (FTDI in my case). The symptoms were a non-detection of any ports (but I twigged when I tried ZTerm and it had the same problem). Good luck! Cheers, greg PS I did a "Archive and install" which may be the reason my FTDI driver had disappeared - I don't think the driver has changed for 10.5 ------------------------------------------------------------------------- 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 4 Nov 2007, at 03:17, Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Sun Nov 4 13:01:12 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 15:01:12 -0500 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: Message-ID: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Hi, You will need to get the 2.1-8 code from CVS. See the FAQ for more information: http://rxtx.qbang.org/wiki/index.php/FAQ Andre On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > I am alternating between two errors. > > After i run the macosx_setup.command, "everyone" is set to Read only > in /var/lock. I notice in the terminal that the group for these > perms is _uucp, not uucp. > > In that state, I get this error: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > check_group_uucp(): error testing lock file creation Error > details:Permission deniedcheck_lock_status: No permission to create > lock file. > please see: How can I use Lock Files with rxtx? in INSTALL > gnu.io.PortInUseException: Unknown Application > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > java.lang.RuntimeException : Error inside Serial.() > > at processing.serial.Serial.errorMessage(Serial.java:583) > > at processing.serial.Serial.(Serial.java:148) > > at processing.serial.Serial.( Serial.java:102) > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > at processing.core.PApplet.run(PApplet.java:1556) > > at java.lang.Thread.run(Thread.java:613) > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > and Write (note /var/spool/uucp is Read/Write in all cases, and > doesn't change). I get this error: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > gnu.io.PortInUseException: Unknown Application > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > java.lang.RuntimeException: Error inside Serial.() > > at processing.serial.Serial.errorMessage (Serial.java:583) > > at processing.serial.Serial.(Serial.java:148) > > at processing.serial.Serial.(Serial.java:102) > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > at processing.core.PApplet.run(PApplet.java:1556) > > at java.lang.Thread.run(Thread.java:613) > > See here: > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From netbeans at gatworks.com Sun Nov 4 14:33:35 2007 From: netbeans at gatworks.com (U. George) Date: Sun, 04 Nov 2007 16:33:35 -0500 Subject: [Rxtx] #ifndef TIOCSERGETLSR Message-ID: <472E3AAF.7050709@gatworks.com> For Linux, it seems that you need the code for both *having* a TIOCSERGETLSR, and *not having* a TIOCSERGETLSR. Maybe the ioctl exists system wide, but not necessarily for the device driver itself ( always returns -1 ) . Are there systems that have a *functioning* TIOCSERGETLSR for all their devices? Then this would be the case where the "#ifndef TIOCSERGETLSR" directive could be useful is eliminating the unnecessary code and tests. And for those systems that dont have a TIOCSERGETLSR, then the code for TIOCSERGETLSR can be eliminated. It would be a simple case to have, as a foundation, all the code to simulate the missing TIOCSERGETLSR ioctl. If the system does have the ioctl, then that code can be ifdef'd in, and co-exist with the functionality of the code that simulates the missing TIOCSERGETLSR ioctl. From racecar at gmail.com Sun Nov 4 17:30:19 2007 From: racecar at gmail.com (Kevin Mateo Lim) Date: Sun, 4 Nov 2007 17:30:19 -0700 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: the README.OSX reads: Put libSerial.jnilib in the directory of the application (the JavaVM will find it there). Add RXTXComm.jar to the application classpath or include the classes in the application jar. (Some applications already include the RXTX classes in their application jar, in which case only the file libSerial.jnilib is required). I can't find libSerial.jnilib I put librxtxSerial.jnilib into my Processing /libraries/serial/library/ directory. Yet it still sees the old version: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 On 11/4/07, Andre-John Mas wrote: > > Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > 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/20071104/c0a83f91/attachment-0009.html From ajmas at sympatico.ca Sun Nov 4 17:41:47 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 19:41:47 -0500 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> If you are wanting it to be available for all applications, - for all users: /Library/Java/Extensions - for your user: ~/Library/Java/Extensions Or just for your application, then it should be in the same directory from which yo are launching your application. If you are getting the 2.1-8 source, then the library built is called: librxtxSerial.jnilib despite what the docs say. Andre On 4-Nov-07, at 19:30 , Kevin Mateo Lim wrote: > > the README.OSX reads: > Put > libSerial.jnilib > in the directory of the application (the JavaVM will find it there). > Add > RXTXComm.jar > to the application classpath or include the classes in the > application jar. > (Some applications already include the RXTX classes in their > application jar, > in which case only the file libSerial.jnilib is required). > > > I can't find libSerial.jnilib > I put librxtxSerial.jnilib into my Processing /libraries/serial/ > library/ directory. > > Yet it still sees the old version: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > On 11/4/07, Andre-John Mas wrote: Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial .(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay (PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > From bschlining at gmail.com Sun Nov 4 19:46:23 2007 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 4 Nov 2007 18:46:23 -0800 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> Message-ID: > > Or just for your application, then it should be in the same directory > from which yo are launching your application. Just wanted to add one more way of specifying the native lib location... If you don't want to define it globally by putting it in /Library/Java/Extensions (and you don't, it's a very very bad practice) you can also specify the location of the native library when starting the JVM by specifying the 'java.library.path' property. For example: java -Djava.library.path=/Path/To/Directory/With/RXTX/Library YourMainClass -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071104/c5af6980/attachment-0009.html From greg.johnson at manchester.ac.uk Mon Nov 5 01:39:02 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Mon, 5 Nov 2007 09:39:02 +0100 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: The 2.1-8 code reports 2.1-7, hence your (and my) confusion. But as long as you've removed all traces of the old library, it really _is_ 2.1-8. And if you specify the library path to the VM, don't make my mistake (on OSX at least) - you need to respecify the entire library path it had by default, as the command line argument replaces the path, rather than appending to it. 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 5 Nov 2007, at 01:30, Kevin Mateo Lim wrote: > > the README.OSX reads: > Put > libSerial.jnilib > in the directory of the application (the JavaVM will find it there). > Add > RXTXComm.jar > to the application classpath or include the classes in the > application jar. > (Some applications already include the RXTX classes in their > application jar, > in which case only the file libSerial.jnilib is required). > > > I can't find libSerial.jnilib > I put librxtxSerial.jnilib into my Processing /libraries/serial/ > library/ directory. > > Yet it still sees the old version: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > On 11/4/07, Andre-John Mas wrote: > Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial .(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay (PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > 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 HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071105/7f50506d/attachment-0009.html From cyrille.dumont at tatexpress.fr Mon Nov 5 05:46:03 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 05 Nov 2007 13:46:03 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: References: <472727F1.1000704@tatexpress.fr> Message-ID: <472F108B.2090101@tatexpress.fr> Thanks a lot for your solution ... but I'm not a expert in JAVA ... (sorry) For the moment I've this function : """ public void serialEvent(SerialPortEvent e) { StringBuffer inputBuffer = new StringBuffer(); int newData = 0; switch (e.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } //-- Manag. Data from Scanner this.MngDataScanner(inputBuffer.toString()); break; case SerialPortEvent.BI:; //-- Break Received } } """ How can I do what you write ? ( maybe a simple ex ? ) PS : I don't know the PDF417 size (could be, for example, 338 char, or 500 ... ; what I know is that it can't be more than 800 char) Thanks in advance. Best regards. Trent Jarvi a ?crit : > 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 Martin.Oberhuber at windriver.com Mon Nov 5 08:47:50 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 5 Nov 2007 16:47:50 +0100 Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> Hi Trent, are the interestes of hobbyists really so different from commercial ones? Both should be interested in high quality and innovation the like. I haven't seen too many Open Source projects from the "inside" but those that I have seen did not have separate mailing lists for quality/testing/qa versus innovation/development. What I have seen with the Open Source projects that one would call "successful" is a good deal of process around automated builds, automated unit tests, predictable release dates and milestones, and policies around commiting/contributing/reviewing changes. I think that all of these benefit commercial users and hobbyists the like. If you were just asking about who's interested in discussing changes to foster more quality, count me in. I'm just not sure whether discussing these on a separate mailing list or other channel is the right thing to do. Cheers, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From toupsz at cs.tamu.edu Tue Nov 6 14:27:04 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 15:27:04 -0600 Subject: [Rxtx] reading TTL level signals from serial? Message-ID: Dear RXTX community- I've been using RXTX to handle communicating with several hardware devices in Java (a GPS and some custom audio circuitry for my dissertation work). I have a new, high-accuracy GPS which only communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there any way to communicate with this device using RXTX, perhaps by modding the native code for Windows? If so, does anyone have any tips on how to do it? Has it perhaps already been done? Another option is for me to invert / amplify the signal in hardware, but this is difficult for me to pull off due to the sensitivity of the electronics involved...I'll likely end up using a much less accurate piece of equipment rather than go that far! If anyone could help out, I'd really appreciate it! Thanks! -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/b6c59c2b/attachment-0007.html From netbeans at gatworks.com Tue Nov 6 14:55:22 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 06 Nov 2007 16:55:22 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: Message-ID: <4730E2CA.3090009@gatworks.com> This is really a hardware issue. Is there any device ( ie the serial port ) on your computer that will accept the voltage signals ( and load ) that your device produces? Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it happen safely ( ie u dont cook the GPS device ) I have a new, high-accuracy GPS which only > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there > any way to communicate with this device using RXTX, From toupsz at cs.tamu.edu Tue Nov 6 15:14:01 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 16:14:01 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4730E2CA.3090009@gatworks.com> References: <4730E2CA.3090009@gatworks.com> Message-ID: Actually, the device runs over USB, but shows up as a virtual serial port and is outputting these signals. The software that comes with the device (a u-blox ANTARIS 4 eval kit) is able to communicate. RXTX is able to detect and properly configure the port, but does not get any of the data from it. :-/ It seems like there must be some way to do it (obviously, ublox knows how)... -Zach On Nov 6, 2007 3:55 PM, U. George wrote: > This is really a hardware issue. > Is there any device ( ie the serial port ) on your computer that will > accept the voltage signals ( and load ) that your device produces? > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it > happen safely ( ie u dont cook the GPS device ) > > > I have a new, high-accuracy GPS which only > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there > > any way to communicate with this device using RXTX, > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/15ae7a0b/attachment-0007.html From keithvz at verizon.net Tue Nov 6 16:16:55 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 06 Nov 2007 18:16:55 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> Message-ID: <4730F5E7.1030704@verizon.net> Zach Toups wrote: > On Nov 6, 2007 3:55 PM, U. George > wrote: > > This is really a hardware issue. > Is there any device ( ie the serial port ) on your computer that will > accept the voltage signals ( and load ) that your device produces? > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it > happen safely ( ie u dont cook the GPS device ) > > > I have a new, high-accuracy GPS which only > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is > there > > any way to communicate with this device using RXTX, > _______________________________________________ As UGeorge intimated, it's a hardware issue. If your device outputs TTL level voltages, and your USB to serial converter is RS-232, then you've got a physical hardware differences. Inverted leads and voltage issues are mainly the problem. MAXIM makes a neat little chip called the MAX233 (better than the 232, no extern caps required) You can't solve this in software. Now, there are TTL level compatible USB to serial converters available, I happen to be using one right now. This unit below is from a UK company (there might be sources in the US) http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm Parallax makes one that does 3.3 and 5v http://www.parallax.com/detail.asp?product_id=32201 (but only supports RX, TX, GND, AND DTR towards device) (i've tested a variant of the unit above, and it works with RXTX) In both cases, you'll need some creative wiring depending on the interface on your GPS. Hope this helps Keith From toupsz at cs.tamu.edu Tue Nov 6 16:53:01 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 17:53:01 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4730F5E7.1030704@verizon.net> References: <4730E2CA.3090009@gatworks.com> <4730F5E7.1030704@verizon.net> Message-ID: Yeah...I used an FTDI chip to handle USB/serial conversion on the audio equipment I built. I'm leery of trying to build a board for this ublox GPS due to all the grounding/shielding issues around it. Anyway, I apreciate the help...just sad that I can't handle the problem in software! Ublox did send me the source code for their USB drivers...but as a Java programmer, it's a bit tough for me to sort out. ;) Thanks again! -Zach On Nov 6, 2007 5:16 PM, Keith Monahan wrote: > Zach Toups wrote: > > > On Nov 6, 2007 3:55 PM, U. George > > wrote: > > > > This is really a hardware issue. > > Is there any device ( ie the serial port ) on your computer that > will > > accept the voltage signals ( and load ) that your device produces? > > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make > it > > happen safely ( ie u dont cook the GPS device ) > > > > > > I have a new, high-accuracy GPS which only > > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is > > there > > > any way to communicate with this device using RXTX, > > _______________________________________________ > > As UGeorge intimated, it's a hardware issue. > > If your device outputs TTL level voltages, and your USB to serial > converter is RS-232, then you've got a physical hardware differences. > Inverted leads and voltage issues are mainly the problem. MAXIM makes a > neat little chip called the MAX233 (better than the 232, no extern caps > required) > > You can't solve this in software. > > Now, there are TTL level compatible USB to serial converters available, > I happen to be using one right now. > > This unit below is from a UK company (there might be sources in the US) > > http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm > > Parallax makes one that does 3.3 and 5v > > http://www.parallax.com/detail.asp?product_id=32201 > (but only supports RX, TX, GND, AND DTR towards device) > > (i've tested a variant of the unit above, and it works with RXTX) > > In both cases, you'll need some creative wiring depending on the > interface on your GPS. > > Hope this helps > > Keith > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/06e88ad4/attachment-0007.html From netbeans at gatworks.com Tue Nov 6 17:14:01 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 06 Nov 2007 19:14:01 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> <4730F5E7.1030704@verizon.net> Message-ID: <47310349.5000406@gatworks.com> what gps chipset do u have? > Ublox did send me the source code for their USB drivers...but as a Java > programmer, it's a bit tough for me to sort out. ;) From Steffen.DETTMER at ingenico.com Wed Nov 7 03:10:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 7 Nov 2007 11:10:01 +0100 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> Message-ID: <20071107101000.GN10978@elberon.bln.de.ingenico.com> * Zach Toups wrote on Tue, Nov 06, 2007 at 16:14 -0600: > Actually, the device runs over USB, but shows up as a virtual > serial port and is outputting these signals. Ahh, so what you want is to use rxtx on the serial port that is created by the driver and mapped maybe as some COM8 or whatever? I this case then IMHO it would be no hardware question but maybe a problem in your application, or some driver or indeed a rxtx issue. > The software that > comes with the device (a u-blox ANTARIS 4 eval kit) is able to > communicate. Is it sure that this software is really using the virtual serial port and only this port? oki, Steffen -- About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Wed Nov 7 04:59:10 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 06:59:10 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <20071107101000.GN10978@elberon.bln.de.ingenico.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> Message-ID: <4731A88E.6080705@gatworks.com> >> The software that >> comes with the device (a u-blox ANTARIS 4 eval kit) is able to >> communicate. > > Is it sure that this software is really using the virtual serial > port and only this port? > I have tried to read the docs. I have yet to find any explanation on a (windoz) device driver for this device ( the usb device ). That magic is not explained. For a developer thats important magic. Maybe a call to their support team is in order? From netbeans at gatworks.com Wed Nov 7 05:01:38 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 07:01:38 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <20071107101000.GN10978@elberon.bln.de.ingenico.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> Message-ID: <4731A922.7@gatworks.com> Steffen DETTMER wrote: > * Zach Toups wrote on Tue, Nov 06, 2007 at 16:14 -0600: >> Actually, the device runs over USB, but shows up as a virtual BTW: it seems that I am not getting all the Rxtx mail. Is there still a problem? From toupsz at cs.tamu.edu Wed Nov 7 07:36:20 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Wed, 7 Nov 2007 08:36:20 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4731A88E.6080705@gatworks.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> <4731A88E.6080705@gatworks.com> Message-ID: When I emailed them about this issue, they sent me their WinCE drivers, which are apparently based on this open source driver: http://www.yetanotherhomepage.com/j7xx/j7xx.html?/j7xx/software/util/usbdriver.html These include srcdll, and x86 subfolders, though it's not 100% clear to me that these are useful. The ublox communication suite appears to only communicate with serial ports...I've communicated with the ublox on two different comm ports (one with the serial adapter plugged into the serial port, one with the main USB connection), as well as a Garmin bluetooth GPS (which comes up as a bluetooth serial device). I'm not well versed in code this close to the hardware, but it seems to me that if you're running a virtual serial port, then you're virtually controlling the "voltages" that come in on this "port"...so why would they be "ttl level"? :-/ Shouldn't the USB driver be able to interpret the signals in whatever way it wants and just supply software with the binary interpretation? Thanks for all the help, guys, it's really appreciated! -Zach On Nov 7, 2007 5:59 AM, U. George wrote: > > >> The software that > >> comes with the device (a u-blox ANTARIS 4 eval kit) is able to > >> communicate. > > > > Is it sure that this software is really using the virtual serial > > port and only this port? > > > > I have tried to read the docs. I have yet to find any explanation on a > (windoz) device driver for this device ( the usb device ). That magic > is not explained. For a developer thats important magic. Maybe a call > to their support team is in order? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071107/18a13314/attachment-0006.html From netbeans at gatworks.com Wed Nov 7 08:55:55 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 10:55:55 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> <4731A88E.6080705@gatworks.com> Message-ID: <4731E00B.9030902@gatworks.com> There are 2 components to talking to hardware. There is the electrical specification, and then there is the software specification. there is the rs232 specification, parallel port specification, and the USB electrical specification. Generally these are used to plug in the various devices, and hook up electrically. Then there is the software side. There is the device driver, a software component that sits somewhere in the kernel that handles the USB ( in your case ) controller. The device driver generally does not care about the electrical component. There are various chips that handle USB signals, and these chips have I/O addresses so that signals and data can be properly routed. There is also the side that communicates to the user via the COM port device-name. The device driver that you mentioned is for the "Support PL2303 serial chip". This device driver, which hopefully works, handles the USB chip, and eventually recognzes the gps device, and hopefully creates an COM port so the user can open up and communicate. These are a lot of "HOPES". Since u have the web address of the device driver, and developer, I would think that the developer, and any docs, might be better able to help u to first determine if the GPS device is recognized, and the COM port ( maybe its called by another name ) is created, as per documentation. > > These include srcdll, and x86 subfolders, though it's not 100% clear to > me that these are useful. From tjarvi at qbang.org Sat Nov 10 17:46:13 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Nov 2007 17:46:13 -0700 (MST) Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 5 Nov 2007, Oberhuber, Martin wrote: > Hi Trent, > > are the interestes of hobbyists really so different > from commercial ones? Both should be interested in > high quality and innovation the like. > > I haven't seen too many Open Source projects from the > "inside" but those that I have seen did not have > separate mailing lists for quality/testing/qa > versus innovation/development. > > What I have seen with the Open Source projects that > one would call "successful" is a good deal of > process around automated builds, automated unit > tests, predictable release dates and milestones, > and policies around commiting/contributing/reviewing > changes. > > I think that all of these benefit commercial users > and hobbyists the like. > > If you were just asking about who's interested in > discussing changes to foster more quality, count > me in. I'm just not sure whether discussing these > on a separate mailing list or other channel is the > right thing to do. > Hi Martin, There are two issues I'm thinking about. The first is the generic unit testing and quality initiatives required to move rxtx forward. The second is the inevitable fact that rxtx connects to external hardware. The discussion deals with a different set of problems. Here is a simple example of what I'm getting at. We have the capability of setting custom baud rates in rxtx. We may be interested in seeing regressions in rxtx, the C library or the kernel. Some people may be doing some tests with loopback connections. These will always work even if the baud rate is not set to the expected value. Some people may use null modems between two ports. This may be able to catch the problem but not always. Will the build machines be able to test this? (no - for a few reasons) Will people be trying to catch these type of regressions? (yes) What type of coverage does the community have in the end? (?) We could include the discussions in the same list or another equally open list that may be of interest to some folks that deal with these types of problems on a regular basis. -- Trent Jarvi tjarvi at qbang.org From timlow84 at gmail.com Mon Nov 12 00:31:17 2007 From: timlow84 at gmail.com (Timothy Low) Date: Mon, 12 Nov 2007 15:31:17 +0800 Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> Message-ID: <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> ---------- Forwarded message ---------- From: Timothy Low Date: Nov 12, 2007 3:02 PM Subject: Building RXTX From Source To: taj at www.linux.org.uk Cc: ferdinand.tang at tangs.net, Timothy Low , chweehuat.ng at tangs.net Hi Trent, I tried building RXTX from source, and I got this error. I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm trying to get the necessary ".so" files to use for my serial port communication through java. My linux kernal information is: *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 x86_64 x86_64 x86_64 GNU/Linux* I'll most glad if you can provide me some direction on this. Thanks ! ---------------- [root at smsgateway rxtx-2.0-7pre1]# ./configure checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu configure: WARNING: Trying libtool. If the following fails install libtool checking for gcc... gcc checking for C compiler default output... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking for ld used by GCC... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking for a sed that does not truncate output... /bin/sed checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking command to parse /usr/bin/nm -B output... ok checking how to run the C preprocessor... gcc -E checking for egrep... grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for ranlib... ranlib checking for strip... strip checking for objdir... .libs checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.lo... yes checking if gcc supports -fno-rtti -fno-exceptions... yes checking whether the linker (/usr/bin/ld) supports shared libraries... yes checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking dynamic linker characteristics... GNU/Linux ld.so checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no checking whether -lc should be explicitly linked in... no creating libtool checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking for style of include used by make... GNU checking dependency style of gcc... none checking fcntl.h usability... yes checking fcntl.h presence... yes checking for fcntl.h... yes checking sys/fcntl.h usability... yes checking sys/fcntl.h presence... yes checking for sys/fcntl.h... yes checking sys/file.h usability... yes checking sys/file.h presence... yes checking for sys/file.h... yes checking sys/time.h usability... yes checking sys/time.h presence... yes checking for sys/time.h... yes checking sys/signal.h usability... yes checking sys/signal.h presence... yes checking for sys/signal.h... yes checking signal.h usability... yes checking signal.h presence... yes checking for signal.h.. . yes checking termios.h usability... yes checking termios.h presence... yes checking for termios.h... yes checking asm/termbits.h usability... yes checking asm/termbits.h presence... yes checking for asm/termbits.h... yes checking grp.h usability... yes checking grp.h presence... yes checking for grp.h... yes checking pwd.h usability... yes checking pwd.h presence... yes checking for pwd.h... yes checking whether gcc needs -traditional... no checking whether to enable maintainer-specific portions of Makefiles... no /usr/java/jdk1.5.0_13 configure: WARNING: using JAVA_HOME environmental variable adjusted java.home is /usr/java/jdk1.5.0_13 checking os.name Linux checking os.arch i386 checking java.vendor Sun Microsystems Inc. checking java.version 1.5.0_13 checking os.version 2.6.18-8.el5xen comm.jar appears to be installed already. conftest.c: In function 'main': conftest.c:6: warning: incompatible implicit declaration of built-in function 'printf' conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:6: error: (Each undeclared identifier is reported only once conftest.c:6: error: for each function it appears in.) conftest.c:6: error: expected ')' before string constant conftest.c:7: warning: incompatible implicit declaration of built-in function 'exit' ./configure: line 9649: ./conftest: No such file or directory ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected conftest.c: In function 'main': conftest.c:5: warning: incompatible implicit declaration of built-in function 'printf' conftest.c:10: warning: incompatible implicit declaration of built-in function 'exit' configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status : config.h is unchanged config.status: executing depfiles commands [root at smsgateway rxtx-2.0-7pre1]# make install /usr/java/jdk1.5.0_13/bin/javac -classpath .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d /home/jboss/sources/rxtx- 2.0-7pre1/ -O /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java /home/jboss/sources/rxtx-2.0-7pre1/./src/UnSupportedLoggerException.java /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o /home/jboss/sources/rxtx-2.0-7pre1/x86_64-unknown-linux-gnu/SerialImp.lo /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'init_threads': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: cast from pointer to integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_nativeDrain': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: cast to pointer from integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'read_byte_array': /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: cast to pointer from integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_readArray': /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: comparison is always false due to limited range of data type /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_readTerminatedArray': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: comparison is always false due to limited range of data type mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial- 2.0.7pre1.* gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so -o .libs/librxtxSerial-2.0.7pre1.so (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.0.7pre1.so librxtxSerial.so) creating librxtxSerial.la (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la librxtxSerial.la) gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/ParallelImp.lo /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function 'Java_javax_comm_LPRPort_readArray': /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: comparison is always false due to limited range of data type rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* .libs/librxtxParallel-2.0.7pre1.* gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so -o .libs/librxtxParallel- 2.0.7pre1.so (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.0.7pre1.so librxtxParallel.so) creating librxtxParallel.la (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la librxtxParallel.la) make all-am make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' libtool: install: `x86_64-unknown-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 ------------- Regards, Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071112/27758c3c/attachment-0002.html From tjarvi at qbang.org Mon Nov 12 01:02:09 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Nov 2007 01:02:09 -0700 (MST) Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> Message-ID: On Mon, 12 Nov 2007, Timothy Low wrote: > > Hi Trent, Hi Tim, Comments are inline. As I mentioned off the list, rxtx 2.0 is on the edge of deprecation. We can get it working but this is not the path of least resistance for future work. You will probably need to bounce another round of questions off the list. The following is intended to isolate the problem. > > I tried building RXTX from source, and I got this error. > > > I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm trying > to get the necessary ".so" files to use for my serial port communication > through java. > My linux kernal information is: > > *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 x86_64 > x86_64 x86_64 GNU/Linux* > > I'll most glad if you can provide me some direction on this. Thanks ! > > ---------------- > [root at smsgateway rxtx-2.0-7pre1]# ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > checking for C compiler default output... a.out > checking whether the C compiler works... yes > checking whether we are cross compiling... no > checking for suffix of executables... > checking for suffix of object files... o > checking whether we are using the GNU C compiler... yes > checking whether gcc accepts -g... yes > checking for gcc option to accept ANSI C... none needed > checking for ld used by GCC... /usr/bin/ld > checking if the linker (/usr/bin/ld) is GNU ld... yes > checking for /usr/bin/ld option to reload object files... -r > checking for BSD-compatible nm... /usr/bin/nm -B > checking for a sed that does not truncate output... /bin/sed > checking whether ln -s works... yes > checking how to recognise dependent libraries... pass_all > checking command to parse /usr/bin/nm -B output... ok > checking how to run the C preprocessor... gcc -E > checking for egrep... grep -E > checking for ANSI C header files... yes > checking for sys/types.h... yes > checking for sys/stat.h... yes > checking for stdlib.h... yes > checking for string.h... yes > checking for memory.h... yes > checking for strings.h... yes > checking for inttypes.h... yes > checking for stdint.h... yes > checking for unistd.h... yes > checking dlfcn.h usability... yes > checking dlfcn.h presence... yes > checking for dlfcn.h... yes > checking for ranlib... ranlib > checking for strip... strip > checking for objdir... .libs > checking for gcc option to produce PIC... -fPIC > checking if gcc PIC flag -fPIC works... yes > checking if gcc static flag -static works... yes > checking if gcc supports -c -o file.o... yes > checking if gcc supports -c -o file.lo... yes > checking if gcc supports -fno-rtti -fno-exceptions... yes > checking whether the linker (/usr/bin/ld) supports shared libraries... yes > checking how to hardcode library paths into programs... immediate > checking whether stripping libraries is possible... yes > checking dynamic linker characteristics... GNU/Linux ld.so > checking if libtool supports shared libraries... yes > checking whether to build shared libraries... yes > checking whether to build static libraries... no > checking whether -lc should be explicitly linked in... no > creating libtool > checking for a BSD-compatible install... /usr/bin/install -c > checking whether build environment is sane... yes > checking for gawk... gawk > checking whether make sets $(MAKE)... yes > checking for style of include used by make... GNU > checking dependency style of gcc... none > checking fcntl.h usability... yes > checking fcntl.h presence... yes > checking for fcntl.h... yes > checking sys/fcntl.h usability... yes > checking sys/fcntl.h presence... yes > checking for sys/fcntl.h... yes > checking sys/file.h usability... yes > checking sys/file.h presence... yes > checking for sys/file.h... yes > checking sys/time.h usability... yes > checking sys/time.h presence... yes > checking for sys/time.h... yes > checking sys/signal.h usability... yes > checking sys/signal.h presence... yes > checking for sys/signal.h... yes > checking signal.h usability... yes > checking signal.h presence... yes > checking for signal.h.. . yes > checking termios.h usability... yes > checking termios.h presence... yes > checking for termios.h... yes > checking asm/termbits.h usability... yes > checking asm/termbits.h presence... yes > checking for asm/termbits.h... yes > checking grp.h usability... yes > checking grp.h presence... yes > checking for grp.h... yes > checking pwd.h usability... yes > checking pwd.h presence... yes > checking for pwd.h... yes > checking whether gcc needs -traditional... no > checking whether to enable maintainer-specific portions of Makefiles... no > /usr/java/jdk1.5.0_13 > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /usr/java/jdk1.5.0_13 > checking os.name Linux > checking os.arch i386 > checking java.vendor Sun Microsystems Inc. > checking java.version 1.5.0_13 > checking os.version 2.6.18-8.el5xen > comm.jar appears to be installed already. > conftest.c: In function 'main': > conftest.c:6: warning: incompatible implicit declaration of built-in > function 'printf' > conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:6: error: (Each undeclared identifier is reported only once > conftest.c:6: error: for each function it appears in.) > conftest.c:6: error: expected ')' before string constant This is an outdated kernel version check for when headers and kernels could cause problems for rxtx. If we made it past this, then you are OK. > conftest.c:7: warning: incompatible implicit declaration of built-in > function 'exit' > ./configure: line 9649: ./conftest: No such file or directory > ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected It blew up but continues.. > conftest.c: In function 'main': > conftest.c:5: warning: incompatible implicit declaration of built-in > function 'printf' > conftest.c:10: warning: incompatible implicit declaration of built-in > function 'exit' > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status : config.h is unchanged > config.status: executing depfiles commands > [root at smsgateway rxtx-2.0-7pre1]# make install > /usr/java/jdk1.5.0_13/bin/javac -classpath > .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d > /home/jboss/sources/rxtx- 2.0-7pre1/ -O > /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java > /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/UnSupportedLoggerException.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java > Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or > overrides a deprecated API. > Note: Recompile with -Xlint:deprecation for details. > /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* The java jar should be fine now. You may need to change the source files as mentioned below. > gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. > -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g > -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o > /home/jboss/sources/rxtx-2.0-7pre1/x86_64-unknown-linux-gnu/SerialImp.lo > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'init_threads': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: cast > from pointer to integer of different size > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_nativeDrain': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: cast to > pointer from integer of different size > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'read_byte_array': > /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: cast to > pointer from integer of different size As I recall, this was caused by pointers (now 64 bit rather than 32 bit) being stored in java ints (jints). I would look at the diff between the CVS 2.1 SerialImp.c and RXTXPort.java files against 2.0. We did fix those issues. You have a .so file but the different pointer sizes will cause runtime errors. > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_readArray': > /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: > comparison is always false due to limited range of data type > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_readTerminatedArray': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: > comparison is always false due to limited range of data type > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial- > 2.0.7pre1.* > gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so -o > .libs/librxtxSerial-2.0.7pre1.so > (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.0.7pre1.so > librxtxSerial.so) > creating librxtxSerial.la > (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la > librxtxSerial.la) > gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. > -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g > -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o > /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/ParallelImp.lo > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function > 'Java_javax_comm_LPRPort_readArray': > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: > comparison is always false due to limited range of data type > rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* > .libs/librxtxParallel-2.0.7pre1.* > gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so -o > .libs/librxtxParallel- 2.0.7pre1.so > (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.0.7pre1.so > librxtxParallel.so) > creating librxtxParallel.la > (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la > librxtxParallel.la) > make all-am > make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' > make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' > libtool: install: `x86_64-unknown-linux-gnu' must be an absolute directory > name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 A libtool change? Assuming you ran configure && make install in /home/jboss/sources/rxtx- 2.0-7pre1, libtool is looking for /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/.libs/librxtxSerial-2.0.7pre1.so. I think you have this? The file is just being copied to ~JAVA/jre/lib/$(JAVA_ARCH). -- Trent Jarvi tjarvi at qbang.org From sarah_662005 at yahoo.com Mon Nov 12 16:10:28 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Mon, 12 Nov 2007 15:10:28 -0800 (PST) Subject: [Rxtx] [urgent] device's power off detection Message-ID: <766782.10076.qm@web55803.mail.re3.yahoo.com> Hello all, I have a small application built on top of rxtx api. This application can retrieve the incoming data from a device through a port. The device can be powered off after the port get closed from the application. I have been trying a couple of hours to find a way to detect the power switching from device. If anyone knows how to handle it through rxtx, could you please give me a help? Thank you very much. r, Sara ____________________________________________________________________________________ Get easy, one-click access to your favorites. Make Yahoo! your homepage. http://www.yahoo.com/r/hs -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071112/4599f3ec/attachment.html From netbeans at gatworks.com Mon Nov 12 17:52:22 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 12 Nov 2007 19:52:22 -0500 Subject: [Rxtx] [urgent] device's power off detection In-Reply-To: <766782.10076.qm@web55803.mail.re3.yahoo.com> References: <766782.10076.qm@web55803.mail.re3.yahoo.com> Message-ID: <4738F546.5010101@gatworks.com> Not sure what u are asking for. Are u asking for a way to detect if the device is OFF? Are u asking how to power off the device - via software ? Is it a Serial device? is it a parallel device? is it a usb device? Sara Hugh wrote: > Hello all, > I have a small application built on top of rxtx api. This application > can retrieve the incoming data from a device through a port. The device > can be powered off after the port get closed from the application. I > have been trying a couple of hours to find a way to detect the power > switching from device. If anyone knows how to handle it through rxtx, > could you please give me a help? Thank you very much. From tjarvi at qbang.org Mon Nov 12 22:48:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Nov 2007 22:48:11 -0700 (MST) Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711120225x562db8cbxb750767ade3b0d73@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> <900c6ba90711120031p66edc001ted76f7ba24e34b98@mail.gmail.com> <900c6ba90711120225x562db8cbxb750767ade3b0d73@mail.gmail.com> Message-ID: Hi Tim, The gnu.io namespace looks just like the javax.comm 2.0 namespace. There are additional (discouraged) undocumented methods in gnu.io that you need not use. We just used the different namespace to avoid poluting Sun's by mistake and to make sure we stayed off any potential licensing related radar. Usuaully, you just change your imports and make sure you do not use the javax.comm namespace for anything like exception handling. As I mentioned off the list, there are no issues with rxtx going through the JSR process to be more Sun friendly other than time. rxtx has no hidden intentions there; anything that does not work like CommAPI 2.0 documented is a bug. The reason we do not support CommAPI 2.1 is technical in nature and is in the list archives as well as the front page of www.rxtx.org. On Mon, 12 Nov 2007, Timothy Low wrote: > Hi Trent, > > I'll move to use a JDK1.5 64-bit version... but do I need to make any source > code changes to use the package (gnu.io) in the RTXTcomm.jar instead of the > ones from the javacomm api ? > > > Regards, > Tim > > On Nov 12, 2007 5:22 PM, Trent Jarvi wrote: > >> >> Hi Tim, >> >> I see a couple things here. >> >> First your jdk is for i686 yet the library is compiled on a x86_64 >> machine. You may try passing configure the --target=i686-unknown-linux to >> try using the i686 backend to gcc if it is available. Or move to the 64 >> bit jdk. >> >> The other error I see is again the moved UTF_RELEASE define that we need >> to fix. You can probably get around that with: >> >> make -DUTF_RELEASE=`uname -r` >> >> even more simple would be to just specify the serial library which should >> be in configure --help. >> >> You can remove the UTF_RELEASE check from configure by editing >> configure.in, searching for the simple C program check and deleting it. >> Running autoconf after that will regenerate a new configure without the >> check. >> >> Note that you should remove the previous native libraries >> (librxtxSerial.so) when moving from rxtx 2.0 to 2.1. These are compiled >> for different namespaces (javax.comm/gnu.io). >> >> On Mon, 12 Nov 2007, Timothy Low wrote: >> >>> *Hi Trent, >>> >>> I moved on to rxtx 2.1.7r2, and updated my jre to 1.6.0 (64-bit)... I >> tried >>> the following 2 methods: >>> >>> (1) using the rxtx 2.1.7 binaries from the RXTX website* >>> *Are these binaries suitable for a 64-bit OS ? There mentioning of the >>> gnu.io that you've talked about previously...* >>> ------ >>> [root at smsgateway sources]# java -Djava.library.path=/usr/lib PortLister >>> Experimental: JNI_OnLoad called. >>> >>> java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion >>> ()Ljava/lang/String; >>> at gnu.io.RXTXCommDriver.nativeGetVersion(Native Method) >>> at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:85) >>> at java.lang.Class.forName0(Native Method) >>> at java.lang.Class.forName(Unknown Source) >>> at javax.comm.CommPortIdentifier.loadDriver( >> CommPortIdentifier.java >>> :237) >>> at javax.comm.CommPortIdentifier.(CommPortIdentifier.java >>> :109) >>> at PortLister.(PortLister.java:6) >>> at PortLister.main(PortLister.java:25) >>> Exception in thread "main" java.lang.UnsatisfiedLinkError: >>> com.sun.comm.SunrayInfo.isSessionActive()Z >>> at com.sun.comm.SunrayInfo.isSessionActive(Native Method) >>> at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java >> :155) >>> at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java >>> :100) >>> at javax.comm.CommPortIdentifier.(CommPortIdentifier.java >>> :138) >>> at PortLister.(PortLister.java:6) >>> at PortLister.main(PortLister.java:25) >>> >>> ------ >>> >>> (2) compiling the rxtx 2.1.7 from source >>> *but i got the following error while running ./configure and make all* >>> >>> ------ >>> [root at smsgateway rxtx-2.1-7r2]# ./configure >>> checking build system type... x86_64-unknown-linux-gnu >>> checking host system type... x86_64-unknown-linux-gnu >>> checking target system type... x86_64-unknown-linux-gnu >>> configure: WARNING: Trying libtool. If the following fails install >> libtool >>> checking for gcc... gcc >>> checking for C compiler default output file name... a.out >>> checking whether the C compiler works... yes >>> checking whether we are cross compiling... no >>> checking for suffix of executables... >>> checking for suffix of object files... o >>> checking whether we are using the GNU C compiler... yes >>> checking whether gcc accepts -g... yes >>> checking for gcc option to accept ANSI C... none needed >>> checking for a sed that does not truncate output... /bin/sed >>> checking for egrep... grep -E >>> checking for ld used by gcc... /usr/bin/ld >>> checking if the linker (/usr/bin/ld) is GNU ld... yes >>> checking for /usr/bin/ld option to reload object files... -r >>> checking for BSD-compatible nm... /usr/bin/nm -B >>> checking whether ln -s works... yes >>> checking how to recognise dependent libraries... pass_all >>> checking how to run the C preprocessor... gcc -E >>> checking for ANSI C header files... yes >>> checking for sys/types.h... yes >>> checking for sys/stat.h... yes >>> checking for stdlib.h... yes >>> checking for string.h... yes >>> checking for memory.h... yes >>> checking for strings.h... yes >>> checking for inttypes.h... yes >>> checking for stdint.h... yes >>> checking for unistd.h... yes >>> checking dlfcn.h usability... yes >>> checking dlfcn.h presence... yes >>> checking for dlfcn.h... yes >>> checking for g++... g++ >>> checking whether we are using the GNU C++ compiler... yes >>> checking whether g++ accepts -g... yes >>> checking how to run the C++ preprocessor... g++ -E >>> checking for g77... no >>> checking for f77... no >>> checking for xlf... no >>> checking for frt... no >>> checking for pgf77... no >>> checking for fort77... no >>> checking for fl32... no >>> checking for af77... no >>> checking for f90... no >>> checking for xlf90... no >>> checking for pgf90... no >>> checking for epcf90... no >>> checking for f95... f95 >>> checking whether we are using the GNU Fortran 77 compiler... yes >>> checking whether f95 accepts -g... yes >>> checking the maximum length of command line arguments... 32768 >>> checking command to parse /usr/bin/nm -B output from gcc object... ok >>> checking for objdir... .libs >>> checking for ar... ar >>> checking for ranlib... ranlib >>> checking for strip... strip >>> checking if gcc static flag works... yes >>> checking if gcc supports -fno-rtti -fno-exceptions... no >>> checking for gcc option to produce PIC... -fPIC >>> checking if gcc PIC flag -fPIC works... yes >>> checking if gcc supports -c -o file.o... yes >>> checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking whether -lc should be explicitly linked in... no >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> checking if libtool supports shared libraries... yes >>> checking whether to build shared libraries... yes >>> checking whether to build static libraries... no >>> configure: creating libtool >>> appending configuration tag "CXX" to libtool >>> checking for ld used by g++... /usr/bin/ld -m elf_x86_64 >>> checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes >>> checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking for g++ option to produce PIC... -fPIC >>> checking if g++ PIC flag -fPIC works... yes >>> checking if g++ supports -c -o file.o... yes >>> checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> appending configuration tag "F77" to libtool >>> checking if libtool supports shared libraries... yes >>> checking whether to build shared libraries... yes >>> checking whether to build static libraries... no >>> checking for f95 option to produce PIC... -fPIC >>> checking if f95 PIC flag -fPIC works... yes >>> checking if f95 supports -c -o file.o... yes >>> checking whether the f95 linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> checking for a BSD-compatible install... /usr/bin/install -c >>> checking whether build environment is sane... yes >>> checking for gawk... gawk >>> checking whether make sets $(MAKE)... yes >>> checking for style of include used by make... GNU >>> checking dependency style of gcc... none >>> checking dependency style of g++... none >>> checking fcntl.h usability... yes >>> checking fcntl.h presence... yes >>> checking for fcntl.h... yes >>> checking sys/fcntl.h usability... yes >>> checking sys/fcntl.h presence... yes >>> checking for sys/fcntl.h... yes >>> checking sys/file.h usability... yes >>> checking sys/file.h presence... yes >>> checking for sys/file.h... yes >>> checking sys/time.h usability... yes >>> checking sys/time.h presence... yes >>> checking for sys/time.h... yes >>> checking sys/signal.h usability... yes >>> checking sys/signal.h presence... yes >>> checking for sys/signal.h... yes >>> checking signal.h usability... yes >>> checking signal.h presence... yes >>> checking for signal.h... yes >>> checking termios.h usability... yes >>> checking termios.h presence... yes >>> checking for termios.h... yes >>> checking grp.h usability... yes >>> checking grp.h presence... yes >>> checking for grp.h... yes >>> checking pwd.h usability... yes >>> checking pwd.h presence... yes >>> checking for pwd.h... yes >>> checking whether gcc needs -traditional... no >>> checking whether to enable maintainer-specific portions of Makefiles... >> no >>> /usr/java/jdk1.5.0_13 >>> configure: WARNING: using JAVA_HOME environmental variable >>> adjusted java.home is /usr/java/jdk1.5.0_13 >>> checking os.name Linux >>> checking os.arch i386 >>> checking java.vendor Sun Microsystems Inc. >>> checking java.version 1.5.0_13 >>> checking os.version 2.6.18-8.el5xen >>> conftest.c: In function 'main': >>> conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this >> function) >>> conftest.c:8: error: (Each undeclared identifier is reported only once >>> conftest.c:8: error: for each function it appears in.) >>> conftest.c:8: error: expected ')' before string constant >>> ./configure: line 21462: ./conftest: No such file or directory >>> ./configure: line 21462: test: 2.6.18-8.el5xen: unary operator expected >>> configure: creating ./config.status >>> config.status: creating Makefile >>> config.status: creating config.h >>> config.status: executing depfiles commands >>> [root at smsgateway rxtx-2.1-7r2]# make install >>> /usr/java/jdk1.5.0_13/bin/javac -classpath .:/home/jboss/sources/rxtx- >>> >> 2.1-7r2:/home/jboss/sources/rxtx-2.1-7r2/src:/usr/java/jdk1.5.0_13/jre/lib/ext/RXTXcomm.jar-d >>> /home/jboss/sources/rxtx- >>> 2.1-7r2/ -O -source 1.3 -target 1.3 >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommDriver.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortEnumerator.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortIdentifier.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortOwnershipListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Configure.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2C.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/I2CPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/LPRPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/NoSuchPortException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/PortInUseException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Raw.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/RawPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RawPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RawPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/RS485PortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485PortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485Port.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXCommDriver.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXVersion.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPort.java >>> /home/jboss/sources/rxtx-2.1-7r2 >> /./src/UnsupportedCommOperationException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/UnSupportedLoggerException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Zystem.java >>> /usr/java/jdk1.5.0_13/bin/javah -classpath .:/home/jboss/sources/rxtx- >>> >> 2.1-7r2:/home/jboss/sources/rxtx-2.1-7r2/src:/usr/java/jdk1.5.0_13/jre/lib/ext/RXTXcomm.jar-d >>> x86_64-unknown-linux-gnu -jni `(for i in CommDriver CommPortEnumerator >>> CommPortIdentifier CommPort CommPortOwnershipListener Configure I2C >>> I2CPortEvent I2CPortEventListener I2CPort LPRPort NoSuchPortException >>> ParallelPortEvent ParallelPortEventListener ParallelPort >> PortInUseException >>> Raw RawPortEvent RawPortEventListener RawPort RS485 RS485PortEvent >>> RS485PortEventListener RS485Port RXTXCommDriver RXTXPort RXTXVersion >>> SerialPortEvent SerialPortEventListener SerialPort >>> UnsupportedCommOperationException UnSupportedLoggerException Zystem;do \ >>> if grep > /dev/null native.*\( /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/$i.java; then \ >>> echo gnu.io.$i; \ >>> fi; \ >>> done)` >>> /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialImp.c -o >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo; >>> \ >>> if [ "Serial" = "Serial" ]; >>> then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxSerial.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxSerial.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo; >> \ >>> fi; \ >>> ) >>> mkdir /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/.libs >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/SerialImp.o >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/fuserImp.o >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c: In function >> 'show_user': >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c:238: warning: cast >> from >>> pointer to integer of different size >>> gcc -shared /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/SerialImp.o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/fuserImp.o >>> -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7.so -o >> .libs/librxtxSerial- >>> 2.1-7.so >>> (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.1-7.so >>> librxtxSerial.so) >>> creating librxtxSerial.la >>> (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la >>> librxtxSerial.la) >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelImp.c -o >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/ParallelImp.lo; >>> \ >>> if [ "Parallel" = "Serial" ]; >>> then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxParallel.la -rpath >>> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/ParallelImp.lo >>> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxParallel.la -rpath >>> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/ParallelImp.lo; >>> \ >>> fi; \ >>> ) >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >>> /x86_64-unknown-linux-gnu/.libs/ParallelImp.o >>> gcc -shared /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/ParallelImp.o >>> -lpthread -Wl,-soname -Wl,librxtxParallel-2.1-7.so -o >>> .libs/librxtxParallel-2.1-7.so >>> (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.1-7.so >>> librxtxParallel.so) >>> creating librxtxParallel.la >>> (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la >>> librxtxParallel.la) >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo; >>> \ >>> if [ "I2C" = "Serial" ]; then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxI2C.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo >>> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxI2C.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo; >>> \ >>> fi; \ >>> ) >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/.libs/I2CImp.o >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c: In function >>> 'Java_gnu_io_I2CPort_Initialize': >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: 'UTS_RELEASE' >>> undeclared (first use in this function) >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: (Each >> undeclared >>> identifier is reported only once >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: for each >> function >>> it appears in.) >>> libtool: link: `/home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/I2CImp.lo' >>> is not a valid libtool object >>> make: *** [x86_64-unknown-linux-gnu/librxtxI2C.la] Error 1 >>> >>> ------ >>> >>> >>> >>> On Nov 12, 2007 4:02 PM, Trent Jarvi wrote: >>> >>>> On Mon, 12 Nov 2007, Timothy Low wrote: >>>>> >>>>> Hi Trent, >>>> >>>> Hi Tim, >>>> >>>> Comments are inline. As I mentioned off the list, rxtx 2.0 is on the >> edge >>>> of deprecation. We can get it working but this is not the path of >> least >>>> resistance for future work. >>>> >>>> You will probably need to bounce another round of questions off the >> list. >>>> The following is intended to isolate the problem. >>>> >>>>> >>>>> I tried building RXTX from source, and I got this error. >>>>> >>>>> >>>>> I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm >>>> trying >>>>> to get the necessary ".so" files to use for my serial port >> communication >>>>> through java. >>>>> My linux kernal information is: >>>>> >>>>> *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 >>>> x86_64 >>>>> x86_64 x86_64 GNU/Linux* >>>>> >>>>> I'll most glad if you can provide me some direction on this. Thanks ! >>>>> >>>>> ---------------- >>>>> [root at smsgateway rxtx-2.0-7pre1]# ./configure >>>>> checking build system type... x86_64-unknown-linux-gnu >>>>> checking host system type... x86_64-unknown-linux-gnu >>>>> checking target system type... x86_64-unknown-linux-gnu >>>>> configure: WARNING: Trying libtool. If the following fails install >>>> libtool >>>>> checking for gcc... gcc >>>>> checking for C compiler default output... a.out >>>>> checking whether the C compiler works... yes >>>>> checking whether we are cross compiling... no >>>>> checking for suffix of executables... >>>>> checking for suffix of object files... o >>>>> checking whether we are using the GNU C compiler... yes >>>>> checking whether gcc accepts -g... yes >>>>> checking for gcc option to accept ANSI C... none needed >>>>> checking for ld used by GCC... /usr/bin/ld >>>>> checking if the linker (/usr/bin/ld) is GNU ld... yes >>>>> checking for /usr/bin/ld option to reload object files... -r >>>>> checking for BSD-compatible nm... /usr/bin/nm -B >>>>> checking for a sed that does not truncate output... /bin/sed >>>>> checking whether ln -s works... yes >>>>> checking how to recognise dependent libraries... pass_all >>>>> checking command to parse /usr/bin/nm -B output... ok >>>>> checking how to run the C preprocessor... gcc -E >>>>> checking for egrep... grep -E >>>>> checking for ANSI C header files... yes >>>>> checking for sys/types.h... yes >>>>> checking for sys/stat.h... yes >>>>> checking for stdlib.h... yes >>>>> checking for string.h... yes >>>>> checking for memory.h... yes >>>>> checking for strings.h... yes >>>>> checking for inttypes.h... yes >>>>> checking for stdint.h... yes >>>>> checking for unistd.h... yes >>>>> checking dlfcn.h usability... yes >>>>> checking dlfcn.h presence... yes >>>>> checking for dlfcn.h... yes >>>>> checking for ranlib... ranlib >>>>> checking for strip... strip >>>>> checking for objdir... .libs >>>>> checking for gcc option to produce PIC... -fPIC >>>>> checking if gcc PIC flag -fPIC works... yes >>>>> checking if gcc static flag -static works... yes >>>>> checking if gcc supports -c -o file.o... yes >>>>> checking if gcc supports -c -o file.lo... yes >>>>> checking if gcc supports -fno-rtti -fno-exceptions... yes >>>>> checking whether the linker (/usr/bin/ld) supports shared libraries... >>>> yes >>>>> checking how to hardcode library paths into programs... immediate >>>>> checking whether stripping libraries is possible... yes >>>>> checking dynamic linker characteristics... GNU/Linux ld.so >>>>> checking if libtool supports shared libraries... yes >>>>> checking whether to build shared libraries... yes >>>>> checking whether to build static libraries... no >>>>> checking whether -lc should be explicitly linked in... no >>>>> creating libtool >>>>> checking for a BSD-compatible install... /usr/bin/install -c >>>>> checking whether build environment is sane... yes >>>>> checking for gawk... gawk >>>>> checking whether make sets $(MAKE)... yes >>>>> checking for style of include used by make... GNU >>>>> checking dependency style of gcc... none >>>>> checking fcntl.h usability... yes >>>>> checking fcntl.h presence... yes >>>>> checking for fcntl.h... yes >>>>> checking sys/fcntl.h usability... yes >>>>> checking sys/fcntl.h presence... yes >>>>> checking for sys/fcntl.h... yes >>>>> checking sys/file.h usability... yes >>>>> checking sys/file.h presence... yes >>>>> checking for sys/file.h... yes >>>>> checking sys/time.h usability... yes >>>>> checking sys/time.h presence... yes >>>>> checking for sys/time.h... yes >>>>> checking sys/signal.h usability... yes >>>>> checking sys/signal.h presence... yes >>>>> checking for sys/signal.h... yes >>>>> checking signal.h usability... yes >>>>> checking signal.h presence... yes >>>>> checking for signal.h.. . yes >>>>> checking termios.h usability... yes >>>>> checking termios.h presence... yes >>>>> checking for termios.h... yes >>>>> checking asm/termbits.h usability... yes >>>>> checking asm/termbits.h presence... yes >>>>> checking for asm/termbits.h... yes >>>>> checking grp.h usability... yes >>>>> checking grp.h presence... yes >>>>> checking for grp.h... yes >>>>> checking pwd.h usability... yes >>>>> checking pwd.h presence... yes >>>>> checking for pwd.h... yes >>>>> checking whether gcc needs -traditional... no >>>>> checking whether to enable maintainer-specific portions of >> Makefiles... >>>> no >>>>> /usr/java/jdk1.5.0_13 >>>>> configure: WARNING: using JAVA_HOME environmental variable >>>>> adjusted java.home is /usr/java/jdk1.5.0_13 >>>>> checking os.name Linux >>>>> checking os.arch i386 >>>>> checking java.vendor Sun Microsystems Inc. >>>>> checking java.version 1.5.0_13 >>>>> checking os.version 2.6.18-8.el5xen >>>>> comm.jar appears to be installed already. >>>>> conftest.c: In function 'main': >>>>> conftest.c:6: warning: incompatible implicit declaration of built-in >>>>> function 'printf' >>>>> conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this >>>> function) >>>>> conftest.c:6: error: (Each undeclared identifier is reported only once >>>>> conftest.c:6: error: for each function it appears in.) >>>>> conftest.c:6: error: expected ')' before string constant >>>> >>>> >>>> This is an outdated kernel version check for when headers and kernels >>>> could cause problems for rxtx. If we made it past this, then you are >> OK. >>>> >>>> >>>>> conftest.c:7: warning: incompatible implicit declaration of built-in >>>>> function 'exit' >>>>> ./configure: line 9649: ./conftest: No such file or directory >>>>> ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected >>>> >>>> It blew up but continues.. >>>> >>>>> conftest.c: In function 'main': >>>>> conftest.c:5: warning: incompatible implicit declaration of built-in >>>>> function 'printf' >>>>> conftest.c:10: warning: incompatible implicit declaration of built-in >>>>> function 'exit' >>>>> configure: creating ./config.status >>>>> config.status: creating Makefile >>>>> config.status: creating config.h >>>>> config.status : config.h is unchanged >>>>> config.status: executing depfiles commands >>>>> [root at smsgateway rxtx-2.0-7pre1]# make install >>>>> /usr/java/jdk1.5.0_13/bin/javac -classpath >>>>> .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/ -O >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1 >> /./src/UnSupportedLoggerException.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java >>>>> Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or >>>>> overrides a deprecated API. >>>>> Note: Recompile with -Xlint:deprecation for details. >>>>> /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* >>>> >>>> >>>> The java jar should be fine now. You may need to change the source >> files >>>> as mentioned below. >>>> >>>>> gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu >> -I. >>>>> -I/usr/java/jdk1.5.0_13/include >> -I/usr/java/jdk1.5.0_13/include/./linux/ >>>> -g >>>>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o >>>>> /home/jboss/sources/rxtx-2.0-7pre1 >> /x86_64-unknown-linux-gnu/SerialImp.lo >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'init_threads': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: >>>> cast >>>>> from pointer to integer of different size >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_nativeDrain': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: >>>> cast to >>>>> pointer from integer of different size >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'read_byte_array': >>>>> /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: >>>> cast to >>>>> pointer from integer of different size >>>> >>>> >>>> As I recall, this was caused by pointers (now 64 bit rather than 32 >> bit) >>>> being stored in java ints (jints). I would look at the diff between >> the >>>> CVS 2.1 SerialImp.c and RXTXPort.java files against 2.0. We >>>> did fix those issues. >>>> >>>> You have a .so file but the different pointer sizes will cause runtime >>>> errors. >>>> >>>> >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_readArray': >>>>> /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: >>>>> comparison is always false due to limited range of data type >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_readTerminatedArray': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: >>>>> comparison is always false due to limited range of data type >>>>> mkdir .libs >>>>> rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* >> .libs/librxtxSerial- >>>>> 2.0.7pre1.* >>>>> gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so-o >>>>> .libs/librxtxSerial-2.0.7pre1.so >>>>> (cd .libs && rm -f librxtxSerial.so && ln -s >> librxtxSerial-2.0.7pre1.so >>>>> librxtxSerial.so) >>>>> creating librxtxSerial.la >>>>> (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la >>>>> librxtxSerial.la) >>>>> gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu >> -I. >>>>> -I/usr/java/jdk1.5.0_13/include >> -I/usr/java/jdk1.5.0_13/include/./linux/ >>>> -g >>>>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o >>>>> /home/jboss/sources/rxtx- 2.0-7pre1 >>>> /x86_64-unknown-linux-gnu/ParallelImp.lo >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function >>>>> 'Java_javax_comm_LPRPort_readArray': >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: >>>>> comparison is always false due to limited range of data type >>>>> rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* >>>>> .libs/librxtxParallel-2.0.7pre1.* >>>>> gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so-o >>>>> .libs/librxtxParallel- 2.0.7pre1.so >>>>> (cd .libs && rm -f librxtxParallel.so && ln -s >>>> librxtxParallel-2.0.7pre1.so >>>>> librxtxParallel.so) >>>>> creating librxtxParallel.la >>>>> (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la >>>>> librxtxParallel.la) >>>>> make all-am >>>>> make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' >>>>> make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' >>>>> libtool: install: `x86_64-unknown-linux-gnu' must be an absolute >>>> directory >>>>> name >>>>> Try `libtool --help --mode=install' for more information. >>>>> make: *** [install] Error 1 >>>> >>>> A libtool change? Assuming you ran configure && make install in >>>> /home/jboss/sources/rxtx- 2.0-7pre1, libtool is looking for >>>> /home/jboss/sources/rxtx- >>>> 2.0-7pre1/x86_64-unknown-linux-gnu/.libs/librxtxSerial-2.0.7pre1.so. >>>> >>>> I think you have this? The file is just being copied to >>>> ~JAVA/jre/lib/$(JAVA_ARCH). >>>> >>>> -- >>>> Trent Jarvi >>>> tjarvi at qbang.org >>>> >>> >> > From guido.vogt at celsi.ch Tue Nov 13 00:28:01 2007 From: guido.vogt at celsi.ch (Guido Vogt) Date: Tue, 13 Nov 2007 08:28:01 +0100 Subject: [Rxtx] RTS Line can't be set Message-ID: <47395201.1050400@celsi.ch> I'm working on an Windows XP /SP2 System. Version of RXTX: 2.1.7. The serial line is connected to a modem. As I can see, the RTS-Line of the serial Port is inactive, when the port is opened (flowcontrol=none). Obviously, no data is coming from the modem. If I use the setRTS(true) command after open, the comport does not send out my data any more. This behaviour is regardless of flowcontrol. Anybody has an idea what do do? Thanks for help. From keithvz at verizon.net Thu Nov 1 08:08:58 2007 From: keithvz at verizon.net (Keith) Date: Thu, 01 Nov 2007 10:08:58 -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: <4729DDFA.7080206@verizon.net> Trent Jarvi wrote: > 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? Well, I honestly don't know how all this fits together. I think it's just a matter of enabling the right flow control option within the standard serial framework to tell the device driver, "HEY START USING DTR/DSR FOR FLOW CONTROL." If what UGeorge said,(about that type of nitty-gritty lead control being done within the device driver), is true, then this confirms my suspicion. I tried narrowing down within the Linux drivers what you are looking for, but I can't entirely tell wth I'm looking at. (virtual com port drivers -- they are included compiled by default with Ubuntu, source included) http://www.ftdichip.com/Drivers/VCP/Linux/ftdi_sio.tar.gz Hahahaa, they make a reference to DTR flow control being supported but say (UGH) in parenthesis. You can also use their direct device driver library on Ubuntu -- libftd2xx.so.0.4.13. No source code. http://www.ftdichip.com/Drivers/D2XX/Linux/libftd2xx0.4.13.tar.gz In that case, you make a call to their FT_SetFlowControl() function. FT_STATUS FT_SetFlowControl (FT_HANDLE ftHandle, USHORT usFlowControl, UCHAR uXon,UCHAR uXoff) Parameters ftHandle Handle of the device. usFlowControl Must be one of FT_FLOW_NONE, FT_FLOW_RTS_CTS, ****FT_FLOW_DTR_DSR**** or FT_FLOW_XON_XOFF. uXon Character used to signal Xon. Only used if flow control is FT_FLOW_XON_XOFF. uXoff Character used to signal Xoff. Only used if flow control is FT_FLOW_XON_XOFF. This is from their programming guide http://www.ftdichip.com/Documents/ProgramGuides/D2XXPG34.pdf I actually want to take this a step further and say that I think the flow control is actually handled right on the device itself in hardware/firmware. It's enabled through the device driver, but I think the maintaining of buffers, asserting/deasserting of leads, etc is handled by the device. For the time being, I've switched to jd2xx, https://jd2xx.dev.java.net/ and http://bleyer.org/jd2xx/ These are Java wrappers for the device driver libraries. It allows almost direct access to the well-documented device drivers from Java. I hope this helps Keith From tjarvi at qbang.org Thu Nov 1 11:09:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:09:51 -0600 (MDT) 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: Hi Martin, What I usually have done is allow changes that do not impact working software including changes to methods not documented in CommAPI (which remain undocumented in rxtx) and fixes to known problems in the documented portions. That way if you use the documented API, the releases should only become better with time. If you use the undocumented portions, the behavior is not as predictable but open for improvement. On Wed, 31 Oct 2007, 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 >> > From tjarvi at qbang.org Thu Nov 1 11:15:52 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:15:52 -0600 (MDT) 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: I too use rxtx in commercial products. The problem I've been trying to address while bringing the server back was how to make it possible for hobby folks to build the same software as companies so we can move rxtx along a little faster. Exposing internal tools is not an option at this time, the public rxtx builds have been done on my home machine which has drives hanging out of it all over the place dying one at a time. This isn't maintainable. I'm currently looking at the possibility of making an S3 image available on Amazon's EC. These are machines you can rent for ~10 cents an hour which is more than enough to build rxtx. The S3 image is not changed when people use it so everyone has the same starting point. With this, we could all build rxtx for ~20 platforms for a small price and eliminate tool issues. On Wed, 31 Oct 2007, Greg Johnson wrote: > 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 tjarvi at qbang.org Thu Nov 1 11:19:55 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:19:55 -0600 (MDT) 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: On Wed, 31 Oct 2007, 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. I was helping Dmitry do the Mac OS X port without access to a machine when we put that in. In the archives there is information (easily found with google on Apple's site) that describes how their API (and others) can determine if a port is used and ignore it. I think these changes are in CVS but need to confirm. The bottom line is that rxtx should not have used lock files on Mac. It was just ignorance of the system on my part. -- Trent Jarvi tjarvi at qbang.org From fabioanjos at gmail.com Thu Nov 1 12:35:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Thu, 1 Nov 2007 15:35:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Hi, I was using SerialEventListener in my project. But, as was said here, id doesnt work very well with virtual serial ports. So, I changed the strategy using the code posted here in this thread: try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > 0) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } The thing is that in my tests I could notice that in.read(buffer) never blocks. Even when there's nothing to read. Instead of blocking when there's nothing to read it returns 0. So, my questions are: 1. Am I doing something wrong? 2. If not, wouldnt this decrease performance? (the thread would be locked in a loop that does nothing.) 3. Is there a better way to do the job? Thanks in advance!! F?bio -------- On 10/31/07, Andre-John Mas wrote: > > > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/0aee59d0/attachment-0013.html From ajmas at sympatico.ca Thu Nov 1 16:07:55 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Nov 2007 18:07:55 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Message-ID: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From sarah_662005 at yahoo.com Thu Nov 1 17:10:05 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Thu, 1 Nov 2007 16:10:05 -0700 (PDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Message-ID: <351433.37166.qm@web55814.mail.re3.yahoo.com> Thank you very much for your help. Now the application works fine. the serialEvent gets triggered. Rxtx is cool! ----- Original Message ---- From: Andre-John Mas To: Sara Hugh ; RXTX Developers and Users Sent: Wednesday, October 31, 2007 9:55:45 AM Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered 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 __________________________________________________ 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/20071101/4a86bea6/attachment-0013.html From tjarvi at qbang.org Thu Nov 1 17:58:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 17:58:02 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx Message-ID: The rxtx.org site is primarily interested in the hobby aspects of rxtx. Obviously, there are some companies following the work too. These interests bring larger workflows and concerns about details hobby folks may not care about. They also bring many more users. I know the company I work for has a quality engineering effort going on which includes rxtx. While the server was down, I was contacted by another company that was missing the binaries for their testing. Several people have mentioned concerns about a stable release for like reasons. Would there be interest on the quality side of the coin to get together? It could be just sharing email's with each other or a seperate list for QE/QA. I can not say for sure, but we may be able to share some of our efforts/results that could help keep rxtx releases stable. -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Fri Nov 2 01:42:55 2007 From: scldad at sdc.com.au (Stephen Davies) Date: Fri, 2 Nov 2007 18:12:55 +1030 Subject: [Rxtx] Multiple modems Message-ID: <200711021812.56047.scldad@sdc.com.au> This may or may not be related to the Multiple Ports thread. I have an application which uses rxtx on Linux (via cron jobs) to connect multiple modems to remote sensing devices. The application works fine most of the time but occasionally fails to connect if two (or more) connection attempts happen at about the same time. When it fails, it looks as if it may get confused as to which port it is talking to. The app has a "base" component that looks for an available port, opens it and then creates an input thread and an output thread for the connection and data transfer. The "base" component uses this code: // loop round all known ports until one is available. Give up after three minutes Counter ptimeout = new Counter(); while(!portFound && ptimeout.elapsed() < 180000) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // special case. ttyS0 is not available to us on this server. if (!portId.isCurrentlyOwned() && !portId.getName().equals("/dev/ttyS0")) { gLog.debug(lognm + ": Found port " + portId.getName()); try { serialPort = (RXTXPort) portId.open("AguaModem", 10000); } catch (Exception e) { gLog.error(lognm + ": Port " + portId.getName() + " will not open."); gLog.error(e.getMessage()); continue; } AguaModem aguamodem = new AguaModem(); portFound = true; break; } gLog.debug(lognm + ": Port " + portId.getName() + " is busy"); } } } I am wondering about the isCurrentlyOwned method. Does this actually tell me whether a port is currently being used by another process? TIA, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From fabioanjos at gmail.com Fri Nov 2 04:59:58 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 07:59:58 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Message-ID: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/9009eb1d/attachment-0013.html From netbeans at gatworks.com Fri Nov 2 06:28:13 2007 From: netbeans at gatworks.com (U. George) Date: Fri, 02 Nov 2007 08:28:13 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <472B17DD.1050508@gatworks.com> It should normally block ( unless eof / event ) . so its a :{ whats the device ( to recreate if possible ) and how do u open. > My question is, is there a way to make in.read block the thead until > there's something to read? > From fabioanjos at gmail.com Fri Nov 2 06:34:46 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 09:34:46 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > On 11/1/07, Andre-John Mas wrote: > > > > Fabio, > > > > Turns out there was a small error in my example. The test should be: > > > > (numBytes = in.read(buffer)) > -1 > > > > This is because -1 indicates an end of file (end of data stream) > > > > Andre > > > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > > > Hi, > > > > > > I was using SerialEventListener in my project. But, as was said > > > here, id doesnt work very well with virtual serial ports. > > > So, I changed the strategy using the code posted here in this thread: > > > > > > try{ > > > in = port.getInputStream(); > > > out = port.getOutputStream(); > > > int numBytes = 0; > > > while(active){ > > > > > > byte[] buffer = new byte[10]; > > > > > > while ( (numBytes = in.read(buffer)) > 0) > > > { > > > String dataValue = new String(buffer,0,numBytes); > > > processInput(dataValue); > > > } > > > > > > if(numBytes==-1){ > > > break; > > > } > > > > > > Thread.sleep(50); > > > } > > > > > > }catch(IOException e){ > > > logger.info("falha de comunicacao "+ > > > getReceptor().getPort() ); > > > > > > }catch(InterruptedException e){ > > > logger.info ("Interrompendo leitura da porta "+ > > > getReceptor().getPort() ); > > > } > > > > > > The thing is that in my tests I could notice that in.read(buffer) > > > never blocks. Even when there's nothing to read. Instead of blocking > > > when there's nothing to read it returns 0. > > > > > > So, my questions are: > > > > > > 1. Am I doing something wrong? > > > 2. If not, wouldnt this decrease performance? (the thread would be > > > locked in a loop that does nothing.) > > > 3. Is there a better way to do the job? > > > > > > Thanks in advance!! > > > > > > F?bio > > > -------- > > > > > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > > 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 > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > > > > > -- > > > Atenciosamente, > > > F?bio Cristiano dos Anjos > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/5306c4b1/attachment-0013.html From nick.circelli at infrasafe.com Fri Nov 2 07:01:17 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Fri, 2 Nov 2007 08:01:17 -0500 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com><29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com><90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca><29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Message-ID: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> I'm pretty sure that not blocking has to do with you virtual ports. Cause it should block. Maybe you should try: while ((numBytes = in.available()) > 0) { If (numBytes > buffer.length) { numBytes = buffer.length; // in case you have buffer overflow } numBytes = in.read(buffer, 0 , numBytes)); String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } Also, just for optimization, I'd move that byte[] buffer = new byte[10]; out of the while since you don't need to reallocate it every iteration. ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of F?bio Cristiano dos Anjos Sent: Friday, November 02, 2007 8:35 AM To: RXTX Developers and Users Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream (); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas < ajmas at sympatico.ca > wrote: Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info ("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Atenciosamente, F?bio Cristiano dos Anjos -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/4de7f6a3/attachment-0013.html From fabioanjos at gmail.com Fri Nov 2 07:36:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 10:36:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> Message-ID: <29788b250711020636q1588c88fgaa5e27f5504164fb@mail.gmail.com> Hi Nick, Actually, it doesnt block for physical ports too. And, the method avaiable does not block either, so when there's nothing avaiable the loop ends and the thread stops lintening to the port. But I did some more test with serialEventListener, and now its working. I realy dont know what I've done to get it working. I just start woking as soon as I decided to test it again. It was said here that serialEventListener is not reliable for virtual serial ports. Is there another way to read it, without compromising performance? Tanks again!! F?bio ------- On 11/2/07, Nick Circelli wrote: > > I'm pretty sure that not blocking has to do with you virtual ports. > Cause it should block. > > Maybe you should try: > > > > while ((numBytes = in.available()) > 0) > > { > > If (numBytes > buffer.length) { > > numBytes = buffer.length; // in case you have buffer overflow > > } > > numBytes = in.read(buffer, 0 , numBytes)); > > String dataValue = new String(buffer,0,numBytes,"ASCII"); > > processInput(dataValue); > > } > > > > Also, just for optimization, I'd move that byte[] buffer = new > byte[10]; > > out of the while since you don't need to reallocate it every iteration. > > > ------------------------------ > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On Behalf > Of *F?bio Cristiano dos Anjos > *Sent:* Friday, November 02, 2007 8:35 AM > *To:* RXTX Developers and Users > *Subject:* Re: [Rxtx] serialEvent(SerialPortEvent event) never be > triggered > > > > Hi, > > I think i missunderstand something here. > The code you post here was meant to be used inside serialEvent method, > right? > > The think is, that i cannot user SerialEventListener to read serial ports, > because i need to read virual serial ports and id does not behaves well, as > said here before. serialEvent is never triggered. > > So what I quit using SerialEventListener and created a thread to listen to > the port: > > public void run(){ > try{ > in = port.getInputStream(); > out = port.getOutputStream (); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new > String(buffer,0,numBytes,"ASCII"); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ getReceptor().getPort() > ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > } > > > So, the problem is that in.read(buffer) always returns 0 when there is > nothing to read, instead of blocking the flow, and the thread becames locked > in the loop. > > I hope you can help me solve this. > > Thanks in advance! > > F?bio > -------- > > On 11/2/07, *F?bio Cristiano dos Anjos* wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > > > On 11/1/07, *Andre-John Mas* < ajmas at sympatico.ca> wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info ("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/571df6ea/attachment-0012.html From tjarvi at qbang.org Fri Nov 2 08:32:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Nov 2007 08:32:15 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: References: Message-ID: On Fri, 2 Nov 2007, Greg Johnson wrote: > Hi Trent, folks, > Having a single rxtx that is suitable for commercial uses and hobbyists both > would be a great idea? Perhaps it would be worth submitting rxtx as a > proposal to Codehaus - they not only provide excellent tools (Jira (bug > tracker), Confluence (wiki)) but also support build management ( > maestro, continuum, bamboo). Relying on your personal machine (btw, frii.com > / rxtx.org is down again?) seems like a burden you shouldn't have to shoulder > alone. Hi Greg, There may be a little confusion here. There is no need to have two seperate rxtx releases. What I'm trying to encourage is a discussion between some of the people responsible for making sure rxtx does not break their products each release. Usually these people are interested in testing a set of functionality their product depends upon. They do not work with rxtx code but rather traps to catch when rxtx developers break something. This goes on all the time in isolated labs. There are many services that offer to do various pieces of a project for you if you... Anyone is free to do the 'if you' portion with rxtx and see how it goes. I'm actually interested in doing less of that than more. The rxtx.org work I do just happens to overlap with other things I do for personal/family use. The reason I suggest the amazon solution is that anyone can take full control of the environment for a day and it costs less than a package of gum without causing harm to what anyone else is doing. I assume the down question was with respect to a mod_security setting that has been resolved. If not, please post a url to the problem. -- Trent Jarvi tjarvi at qbang.org From nsayer at kfu.com Sat Nov 3 20:17:49 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 19:17:49 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? Message-ID: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Has anyone got RXTX working with an app under Leopard? My app hangs on port open (it works fine with Tiger). The relevant thread looks like this in the activity monitor: 1536 JVM_InvokeMethod 1536 0x48ccd0 1536 0x46f8a0 1536 0x4c3ff4 1536 0x4c4284 1536 0x357d160 1536 0x357faac 1536 Java_gnu_io_RXTXPort_open 1536 open $NOCANCEL$UNIX2003 1536 open $NOCANCEL$UNIX2003 From ajmas at sympatico.ca Sat Nov 3 22:02:04 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 00:02:04 -0400 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> RXTX works for me with Leopard. I am currently using it communicate with a Bluetooth GPS. What computer and device are you trying to use? Is the driver for your serial device compatible with MacOS X 10.5? Andre On 3-Nov-07, at 22:17 , Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From nsayer at kfu.com Sat Nov 3 22:17:47 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 21:17:47 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> Message-ID: <1720F723-3643-438C-B3AB-E09A67536977@kfu.com> On Nov 3, 2007, at 9:02 PM, Andre-John Mas wrote: > RXTX works for me with Leopard. I am currently using it communicate > with a Bluetooth GPS. > > What computer and device are you trying to use? Is the driver for > your serial device compatible with MacOS X 10.5? An Intel mac mini The FTDI USB serial driver an XMPCR, which is just a fancy serial controlled radio and an FTDI usb-to-serial chip I've successfully used the FTDI driver with another FTDI device in another context. > > > Andre > > On 3-Nov-07, at 22:17 , Nick Sayer wrote: > >> Has anyone got RXTX working with an app under Leopard? >> >> My app hangs on port open (it works fine with Tiger). The relevant >> thread looks like this in the activity monitor: >> >> 1536 JVM_InvokeMethod >> 1536 0x48ccd0 >> 1536 0x46f8a0 >> 1536 0x4c3ff4 >> 1536 0x4c4284 >> 1536 0x357d160 >> 1536 0x357faac >> 1536 >> Java_gnu_io_RXTXPort_open >> 1536 open >> $NOCANCEL$UNIX2003 >> 1536 open >> $NOCANCEL$UNIX2003 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From racecar at gmail.com Sat Nov 3 22:25:53 2007 From: racecar at gmail.com (Kevin Mateo Lim) Date: Sat, 3 Nov 2007 21:25:53 -0700 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: Message-ID: I am alternating between two errors. After i run the macosx_setup.command, "everyone" is set to Read only in /var/lock. I notice in the terminal that the group for these perms is _uucp, not uucp. In that state, I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 check_group_uucp(): error testing lock file creation Error details:Permission deniedcheck_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException : Error inside Serial.() at processing.serial.Serial.errorMessage(Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.( Serial.java:102) at Temporary_829_3245.setup(Temporary_829_3245.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java :690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) Then, I hand edit the "everyone" permissions for /var/lock/ to Read and Write (note /var/spool/uucp is Read/Write in all cases, and doesn't change). I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX uucp_lock() /var/lock/LK.003.009.000 is there gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException: Error inside Serial.() at processing.serial.Serial.errorMessage (Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.(Serial.java:102) at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java:690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) See here: http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071103/f1a2c467/attachment-0011.html From greg.johnson at manchester.ac.uk Sun Nov 4 02:31:13 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sun, 4 Nov 2007 10:31:13 +0100 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <28B5E0A0-0802-4C74-AC21-87ED35F3B9A2@manchester.ac.uk> Hi Nick, I also had problems initially with Leopard, but it was resolved by reinstalling the serial USB driver (FTDI in my case). The symptoms were a non-detection of any ports (but I twigged when I tried ZTerm and it had the same problem). Good luck! Cheers, greg PS I did a "Archive and install" which may be the reason my FTDI driver had disappeared - I don't think the driver has changed for 10.5 ------------------------------------------------------------------------- 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 4 Nov 2007, at 03:17, Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Sun Nov 4 13:01:12 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 15:01:12 -0500 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: Message-ID: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Hi, You will need to get the 2.1-8 code from CVS. See the FAQ for more information: http://rxtx.qbang.org/wiki/index.php/FAQ Andre On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > I am alternating between two errors. > > After i run the macosx_setup.command, "everyone" is set to Read only > in /var/lock. I notice in the terminal that the group for these > perms is _uucp, not uucp. > > In that state, I get this error: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > check_group_uucp(): error testing lock file creation Error > details:Permission deniedcheck_lock_status: No permission to create > lock file. > please see: How can I use Lock Files with rxtx? in INSTALL > gnu.io.PortInUseException: Unknown Application > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > java.lang.RuntimeException : Error inside Serial.() > > at processing.serial.Serial.errorMessage(Serial.java:583) > > at processing.serial.Serial.(Serial.java:148) > > at processing.serial.Serial.( Serial.java:102) > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > at processing.core.PApplet.run(PApplet.java:1556) > > at java.lang.Thread.run(Thread.java:613) > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > and Write (note /var/spool/uucp is Read/Write in all cases, and > doesn't change). I get this error: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > gnu.io.PortInUseException: Unknown Application > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > java.lang.RuntimeException: Error inside Serial.() > > at processing.serial.Serial.errorMessage (Serial.java:583) > > at processing.serial.Serial.(Serial.java:148) > > at processing.serial.Serial.(Serial.java:102) > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > at processing.core.PApplet.run(PApplet.java:1556) > > at java.lang.Thread.run(Thread.java:613) > > See here: > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From netbeans at gatworks.com Sun Nov 4 14:33:35 2007 From: netbeans at gatworks.com (U. George) Date: Sun, 04 Nov 2007 16:33:35 -0500 Subject: [Rxtx] #ifndef TIOCSERGETLSR Message-ID: <472E3AAF.7050709@gatworks.com> For Linux, it seems that you need the code for both *having* a TIOCSERGETLSR, and *not having* a TIOCSERGETLSR. Maybe the ioctl exists system wide, but not necessarily for the device driver itself ( always returns -1 ) . Are there systems that have a *functioning* TIOCSERGETLSR for all their devices? Then this would be the case where the "#ifndef TIOCSERGETLSR" directive could be useful is eliminating the unnecessary code and tests. And for those systems that dont have a TIOCSERGETLSR, then the code for TIOCSERGETLSR can be eliminated. It would be a simple case to have, as a foundation, all the code to simulate the missing TIOCSERGETLSR ioctl. If the system does have the ioctl, then that code can be ifdef'd in, and co-exist with the functionality of the code that simulates the missing TIOCSERGETLSR ioctl. From racecar at gmail.com Sun Nov 4 17:30:19 2007 From: racecar at gmail.com (Kevin Mateo Lim) Date: Sun, 4 Nov 2007 17:30:19 -0700 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: the README.OSX reads: Put libSerial.jnilib in the directory of the application (the JavaVM will find it there). Add RXTXComm.jar to the application classpath or include the classes in the application jar. (Some applications already include the RXTX classes in their application jar, in which case only the file libSerial.jnilib is required). I can't find libSerial.jnilib I put librxtxSerial.jnilib into my Processing /libraries/serial/library/ directory. Yet it still sees the old version: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 On 11/4/07, Andre-John Mas wrote: > > Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > 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/20071104/c0a83f91/attachment-0010.html From ajmas at sympatico.ca Sun Nov 4 17:41:47 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 19:41:47 -0500 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> If you are wanting it to be available for all applications, - for all users: /Library/Java/Extensions - for your user: ~/Library/Java/Extensions Or just for your application, then it should be in the same directory from which yo are launching your application. If you are getting the 2.1-8 source, then the library built is called: librxtxSerial.jnilib despite what the docs say. Andre On 4-Nov-07, at 19:30 , Kevin Mateo Lim wrote: > > the README.OSX reads: > Put > libSerial.jnilib > in the directory of the application (the JavaVM will find it there). > Add > RXTXComm.jar > to the application classpath or include the classes in the > application jar. > (Some applications already include the RXTX classes in their > application jar, > in which case only the file libSerial.jnilib is required). > > > I can't find libSerial.jnilib > I put librxtxSerial.jnilib into my Processing /libraries/serial/ > library/ directory. > > Yet it still sees the old version: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > On 11/4/07, Andre-John Mas wrote: Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial .(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay (PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > From bschlining at gmail.com Sun Nov 4 19:46:23 2007 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 4 Nov 2007 18:46:23 -0800 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> Message-ID: > > Or just for your application, then it should be in the same directory > from which yo are launching your application. Just wanted to add one more way of specifying the native lib location... If you don't want to define it globally by putting it in /Library/Java/Extensions (and you don't, it's a very very bad practice) you can also specify the location of the native library when starting the JVM by specifying the 'java.library.path' property. For example: java -Djava.library.path=/Path/To/Directory/With/RXTX/Library YourMainClass -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071104/c5af6980/attachment-0010.html From greg.johnson at manchester.ac.uk Mon Nov 5 01:39:02 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Mon, 5 Nov 2007 09:39:02 +0100 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: The 2.1-8 code reports 2.1-7, hence your (and my) confusion. But as long as you've removed all traces of the old library, it really _is_ 2.1-8. And if you specify the library path to the VM, don't make my mistake (on OSX at least) - you need to respecify the entire library path it had by default, as the command line argument replaces the path, rather than appending to it. 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 5 Nov 2007, at 01:30, Kevin Mateo Lim wrote: > > the README.OSX reads: > Put > libSerial.jnilib > in the directory of the application (the JavaVM will find it there). > Add > RXTXComm.jar > to the application classpath or include the classes in the > application jar. > (Some applications already include the RXTX classes in their > application jar, > in which case only the file libSerial.jnilib is required). > > > I can't find libSerial.jnilib > I put librxtxSerial.jnilib into my Processing /libraries/serial/ > library/ directory. > > Yet it still sees the old version: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > On 11/4/07, Andre-John Mas wrote: > Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial .(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay (PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > 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 HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071105/7f50506d/attachment-0010.html From cyrille.dumont at tatexpress.fr Mon Nov 5 05:46:03 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 05 Nov 2007 13:46:03 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: References: <472727F1.1000704@tatexpress.fr> Message-ID: <472F108B.2090101@tatexpress.fr> Thanks a lot for your solution ... but I'm not a expert in JAVA ... (sorry) For the moment I've this function : """ public void serialEvent(SerialPortEvent e) { StringBuffer inputBuffer = new StringBuffer(); int newData = 0; switch (e.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } //-- Manag. Data from Scanner this.MngDataScanner(inputBuffer.toString()); break; case SerialPortEvent.BI:; //-- Break Received } } """ How can I do what you write ? ( maybe a simple ex ? ) PS : I don't know the PDF417 size (could be, for example, 338 char, or 500 ... ; what I know is that it can't be more than 800 char) Thanks in advance. Best regards. Trent Jarvi a ?crit : > 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 Martin.Oberhuber at windriver.com Mon Nov 5 08:47:50 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 5 Nov 2007 16:47:50 +0100 Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> Hi Trent, are the interestes of hobbyists really so different from commercial ones? Both should be interested in high quality and innovation the like. I haven't seen too many Open Source projects from the "inside" but those that I have seen did not have separate mailing lists for quality/testing/qa versus innovation/development. What I have seen with the Open Source projects that one would call "successful" is a good deal of process around automated builds, automated unit tests, predictable release dates and milestones, and policies around commiting/contributing/reviewing changes. I think that all of these benefit commercial users and hobbyists the like. If you were just asking about who's interested in discussing changes to foster more quality, count me in. I'm just not sure whether discussing these on a separate mailing list or other channel is the right thing to do. Cheers, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From toupsz at cs.tamu.edu Tue Nov 6 14:27:04 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 15:27:04 -0600 Subject: [Rxtx] reading TTL level signals from serial? Message-ID: Dear RXTX community- I've been using RXTX to handle communicating with several hardware devices in Java (a GPS and some custom audio circuitry for my dissertation work). I have a new, high-accuracy GPS which only communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there any way to communicate with this device using RXTX, perhaps by modding the native code for Windows? If so, does anyone have any tips on how to do it? Has it perhaps already been done? Another option is for me to invert / amplify the signal in hardware, but this is difficult for me to pull off due to the sensitivity of the electronics involved...I'll likely end up using a much less accurate piece of equipment rather than go that far! If anyone could help out, I'd really appreciate it! Thanks! -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/b6c59c2b/attachment-0008.html From netbeans at gatworks.com Tue Nov 6 14:55:22 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 06 Nov 2007 16:55:22 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: Message-ID: <4730E2CA.3090009@gatworks.com> This is really a hardware issue. Is there any device ( ie the serial port ) on your computer that will accept the voltage signals ( and load ) that your device produces? Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it happen safely ( ie u dont cook the GPS device ) I have a new, high-accuracy GPS which only > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there > any way to communicate with this device using RXTX, From toupsz at cs.tamu.edu Tue Nov 6 15:14:01 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 16:14:01 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4730E2CA.3090009@gatworks.com> References: <4730E2CA.3090009@gatworks.com> Message-ID: Actually, the device runs over USB, but shows up as a virtual serial port and is outputting these signals. The software that comes with the device (a u-blox ANTARIS 4 eval kit) is able to communicate. RXTX is able to detect and properly configure the port, but does not get any of the data from it. :-/ It seems like there must be some way to do it (obviously, ublox knows how)... -Zach On Nov 6, 2007 3:55 PM, U. George wrote: > This is really a hardware issue. > Is there any device ( ie the serial port ) on your computer that will > accept the voltage signals ( and load ) that your device produces? > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it > happen safely ( ie u dont cook the GPS device ) > > > I have a new, high-accuracy GPS which only > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there > > any way to communicate with this device using RXTX, > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/15ae7a0b/attachment-0008.html From keithvz at verizon.net Tue Nov 6 16:16:55 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 06 Nov 2007 18:16:55 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> Message-ID: <4730F5E7.1030704@verizon.net> Zach Toups wrote: > On Nov 6, 2007 3:55 PM, U. George > wrote: > > This is really a hardware issue. > Is there any device ( ie the serial port ) on your computer that will > accept the voltage signals ( and load ) that your device produces? > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it > happen safely ( ie u dont cook the GPS device ) > > > I have a new, high-accuracy GPS which only > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is > there > > any way to communicate with this device using RXTX, > _______________________________________________ As UGeorge intimated, it's a hardware issue. If your device outputs TTL level voltages, and your USB to serial converter is RS-232, then you've got a physical hardware differences. Inverted leads and voltage issues are mainly the problem. MAXIM makes a neat little chip called the MAX233 (better than the 232, no extern caps required) You can't solve this in software. Now, there are TTL level compatible USB to serial converters available, I happen to be using one right now. This unit below is from a UK company (there might be sources in the US) http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm Parallax makes one that does 3.3 and 5v http://www.parallax.com/detail.asp?product_id=32201 (but only supports RX, TX, GND, AND DTR towards device) (i've tested a variant of the unit above, and it works with RXTX) In both cases, you'll need some creative wiring depending on the interface on your GPS. Hope this helps Keith From toupsz at cs.tamu.edu Tue Nov 6 16:53:01 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 17:53:01 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4730F5E7.1030704@verizon.net> References: <4730E2CA.3090009@gatworks.com> <4730F5E7.1030704@verizon.net> Message-ID: Yeah...I used an FTDI chip to handle USB/serial conversion on the audio equipment I built. I'm leery of trying to build a board for this ublox GPS due to all the grounding/shielding issues around it. Anyway, I apreciate the help...just sad that I can't handle the problem in software! Ublox did send me the source code for their USB drivers...but as a Java programmer, it's a bit tough for me to sort out. ;) Thanks again! -Zach On Nov 6, 2007 5:16 PM, Keith Monahan wrote: > Zach Toups wrote: > > > On Nov 6, 2007 3:55 PM, U. George > > wrote: > > > > This is really a hardware issue. > > Is there any device ( ie the serial port ) on your computer that > will > > accept the voltage signals ( and load ) that your device produces? > > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make > it > > happen safely ( ie u dont cook the GPS device ) > > > > > > I have a new, high-accuracy GPS which only > > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is > > there > > > any way to communicate with this device using RXTX, > > _______________________________________________ > > As UGeorge intimated, it's a hardware issue. > > If your device outputs TTL level voltages, and your USB to serial > converter is RS-232, then you've got a physical hardware differences. > Inverted leads and voltage issues are mainly the problem. MAXIM makes a > neat little chip called the MAX233 (better than the 232, no extern caps > required) > > You can't solve this in software. > > Now, there are TTL level compatible USB to serial converters available, > I happen to be using one right now. > > This unit below is from a UK company (there might be sources in the US) > > http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm > > Parallax makes one that does 3.3 and 5v > > http://www.parallax.com/detail.asp?product_id=32201 > (but only supports RX, TX, GND, AND DTR towards device) > > (i've tested a variant of the unit above, and it works with RXTX) > > In both cases, you'll need some creative wiring depending on the > interface on your GPS. > > Hope this helps > > Keith > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/06e88ad4/attachment-0008.html From netbeans at gatworks.com Tue Nov 6 17:14:01 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 06 Nov 2007 19:14:01 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> <4730F5E7.1030704@verizon.net> Message-ID: <47310349.5000406@gatworks.com> what gps chipset do u have? > Ublox did send me the source code for their USB drivers...but as a Java > programmer, it's a bit tough for me to sort out. ;) From Steffen.DETTMER at ingenico.com Wed Nov 7 03:10:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 7 Nov 2007 11:10:01 +0100 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> Message-ID: <20071107101000.GN10978@elberon.bln.de.ingenico.com> * Zach Toups wrote on Tue, Nov 06, 2007 at 16:14 -0600: > Actually, the device runs over USB, but shows up as a virtual > serial port and is outputting these signals. Ahh, so what you want is to use rxtx on the serial port that is created by the driver and mapped maybe as some COM8 or whatever? I this case then IMHO it would be no hardware question but maybe a problem in your application, or some driver or indeed a rxtx issue. > The software that > comes with the device (a u-blox ANTARIS 4 eval kit) is able to > communicate. Is it sure that this software is really using the virtual serial port and only this port? oki, Steffen -- About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Wed Nov 7 04:59:10 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 06:59:10 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <20071107101000.GN10978@elberon.bln.de.ingenico.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> Message-ID: <4731A88E.6080705@gatworks.com> >> The software that >> comes with the device (a u-blox ANTARIS 4 eval kit) is able to >> communicate. > > Is it sure that this software is really using the virtual serial > port and only this port? > I have tried to read the docs. I have yet to find any explanation on a (windoz) device driver for this device ( the usb device ). That magic is not explained. For a developer thats important magic. Maybe a call to their support team is in order? From netbeans at gatworks.com Wed Nov 7 05:01:38 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 07:01:38 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <20071107101000.GN10978@elberon.bln.de.ingenico.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> Message-ID: <4731A922.7@gatworks.com> Steffen DETTMER wrote: > * Zach Toups wrote on Tue, Nov 06, 2007 at 16:14 -0600: >> Actually, the device runs over USB, but shows up as a virtual BTW: it seems that I am not getting all the Rxtx mail. Is there still a problem? From toupsz at cs.tamu.edu Wed Nov 7 07:36:20 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Wed, 7 Nov 2007 08:36:20 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4731A88E.6080705@gatworks.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> <4731A88E.6080705@gatworks.com> Message-ID: When I emailed them about this issue, they sent me their WinCE drivers, which are apparently based on this open source driver: http://www.yetanotherhomepage.com/j7xx/j7xx.html?/j7xx/software/util/usbdriver.html These include srcdll, and x86 subfolders, though it's not 100% clear to me that these are useful. The ublox communication suite appears to only communicate with serial ports...I've communicated with the ublox on two different comm ports (one with the serial adapter plugged into the serial port, one with the main USB connection), as well as a Garmin bluetooth GPS (which comes up as a bluetooth serial device). I'm not well versed in code this close to the hardware, but it seems to me that if you're running a virtual serial port, then you're virtually controlling the "voltages" that come in on this "port"...so why would they be "ttl level"? :-/ Shouldn't the USB driver be able to interpret the signals in whatever way it wants and just supply software with the binary interpretation? Thanks for all the help, guys, it's really appreciated! -Zach On Nov 7, 2007 5:59 AM, U. George wrote: > > >> The software that > >> comes with the device (a u-blox ANTARIS 4 eval kit) is able to > >> communicate. > > > > Is it sure that this software is really using the virtual serial > > port and only this port? > > > > I have tried to read the docs. I have yet to find any explanation on a > (windoz) device driver for this device ( the usb device ). That magic > is not explained. For a developer thats important magic. Maybe a call > to their support team is in order? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071107/18a13314/attachment-0007.html From netbeans at gatworks.com Wed Nov 7 08:55:55 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 10:55:55 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> <4731A88E.6080705@gatworks.com> Message-ID: <4731E00B.9030902@gatworks.com> There are 2 components to talking to hardware. There is the electrical specification, and then there is the software specification. there is the rs232 specification, parallel port specification, and the USB electrical specification. Generally these are used to plug in the various devices, and hook up electrically. Then there is the software side. There is the device driver, a software component that sits somewhere in the kernel that handles the USB ( in your case ) controller. The device driver generally does not care about the electrical component. There are various chips that handle USB signals, and these chips have I/O addresses so that signals and data can be properly routed. There is also the side that communicates to the user via the COM port device-name. The device driver that you mentioned is for the "Support PL2303 serial chip". This device driver, which hopefully works, handles the USB chip, and eventually recognzes the gps device, and hopefully creates an COM port so the user can open up and communicate. These are a lot of "HOPES". Since u have the web address of the device driver, and developer, I would think that the developer, and any docs, might be better able to help u to first determine if the GPS device is recognized, and the COM port ( maybe its called by another name ) is created, as per documentation. > > These include srcdll, and x86 subfolders, though it's not 100% clear to > me that these are useful. From tjarvi at qbang.org Sat Nov 10 17:46:13 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Nov 2007 17:46:13 -0700 (MST) Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 5 Nov 2007, Oberhuber, Martin wrote: > Hi Trent, > > are the interestes of hobbyists really so different > from commercial ones? Both should be interested in > high quality and innovation the like. > > I haven't seen too many Open Source projects from the > "inside" but those that I have seen did not have > separate mailing lists for quality/testing/qa > versus innovation/development. > > What I have seen with the Open Source projects that > one would call "successful" is a good deal of > process around automated builds, automated unit > tests, predictable release dates and milestones, > and policies around commiting/contributing/reviewing > changes. > > I think that all of these benefit commercial users > and hobbyists the like. > > If you were just asking about who's interested in > discussing changes to foster more quality, count > me in. I'm just not sure whether discussing these > on a separate mailing list or other channel is the > right thing to do. > Hi Martin, There are two issues I'm thinking about. The first is the generic unit testing and quality initiatives required to move rxtx forward. The second is the inevitable fact that rxtx connects to external hardware. The discussion deals with a different set of problems. Here is a simple example of what I'm getting at. We have the capability of setting custom baud rates in rxtx. We may be interested in seeing regressions in rxtx, the C library or the kernel. Some people may be doing some tests with loopback connections. These will always work even if the baud rate is not set to the expected value. Some people may use null modems between two ports. This may be able to catch the problem but not always. Will the build machines be able to test this? (no - for a few reasons) Will people be trying to catch these type of regressions? (yes) What type of coverage does the community have in the end? (?) We could include the discussions in the same list or another equally open list that may be of interest to some folks that deal with these types of problems on a regular basis. -- Trent Jarvi tjarvi at qbang.org From timlow84 at gmail.com Mon Nov 12 00:31:17 2007 From: timlow84 at gmail.com (Timothy Low) Date: Mon, 12 Nov 2007 15:31:17 +0800 Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> Message-ID: <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> ---------- Forwarded message ---------- From: Timothy Low Date: Nov 12, 2007 3:02 PM Subject: Building RXTX From Source To: taj at www.linux.org.uk Cc: ferdinand.tang at tangs.net, Timothy Low , chweehuat.ng at tangs.net Hi Trent, I tried building RXTX from source, and I got this error. I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm trying to get the necessary ".so" files to use for my serial port communication through java. My linux kernal information is: *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 x86_64 x86_64 x86_64 GNU/Linux* I'll most glad if you can provide me some direction on this. Thanks ! ---------------- [root at smsgateway rxtx-2.0-7pre1]# ./configure checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu configure: WARNING: Trying libtool. If the following fails install libtool checking for gcc... gcc checking for C compiler default output... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking for ld used by GCC... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking for a sed that does not truncate output... /bin/sed checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking command to parse /usr/bin/nm -B output... ok checking how to run the C preprocessor... gcc -E checking for egrep... grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for ranlib... ranlib checking for strip... strip checking for objdir... .libs checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.lo... yes checking if gcc supports -fno-rtti -fno-exceptions... yes checking whether the linker (/usr/bin/ld) supports shared libraries... yes checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking dynamic linker characteristics... GNU/Linux ld.so checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no checking whether -lc should be explicitly linked in... no creating libtool checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking for style of include used by make... GNU checking dependency style of gcc... none checking fcntl.h usability... yes checking fcntl.h presence... yes checking for fcntl.h... yes checking sys/fcntl.h usability... yes checking sys/fcntl.h presence... yes checking for sys/fcntl.h... yes checking sys/file.h usability... yes checking sys/file.h presence... yes checking for sys/file.h... yes checking sys/time.h usability... yes checking sys/time.h presence... yes checking for sys/time.h... yes checking sys/signal.h usability... yes checking sys/signal.h presence... yes checking for sys/signal.h... yes checking signal.h usability... yes checking signal.h presence... yes checking for signal.h.. . yes checking termios.h usability... yes checking termios.h presence... yes checking for termios.h... yes checking asm/termbits.h usability... yes checking asm/termbits.h presence... yes checking for asm/termbits.h... yes checking grp.h usability... yes checking grp.h presence... yes checking for grp.h... yes checking pwd.h usability... yes checking pwd.h presence... yes checking for pwd.h... yes checking whether gcc needs -traditional... no checking whether to enable maintainer-specific portions of Makefiles... no /usr/java/jdk1.5.0_13 configure: WARNING: using JAVA_HOME environmental variable adjusted java.home is /usr/java/jdk1.5.0_13 checking os.name Linux checking os.arch i386 checking java.vendor Sun Microsystems Inc. checking java.version 1.5.0_13 checking os.version 2.6.18-8.el5xen comm.jar appears to be installed already. conftest.c: In function 'main': conftest.c:6: warning: incompatible implicit declaration of built-in function 'printf' conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:6: error: (Each undeclared identifier is reported only once conftest.c:6: error: for each function it appears in.) conftest.c:6: error: expected ')' before string constant conftest.c:7: warning: incompatible implicit declaration of built-in function 'exit' ./configure: line 9649: ./conftest: No such file or directory ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected conftest.c: In function 'main': conftest.c:5: warning: incompatible implicit declaration of built-in function 'printf' conftest.c:10: warning: incompatible implicit declaration of built-in function 'exit' configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status : config.h is unchanged config.status: executing depfiles commands [root at smsgateway rxtx-2.0-7pre1]# make install /usr/java/jdk1.5.0_13/bin/javac -classpath .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d /home/jboss/sources/rxtx- 2.0-7pre1/ -O /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java /home/jboss/sources/rxtx-2.0-7pre1/./src/UnSupportedLoggerException.java /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o /home/jboss/sources/rxtx-2.0-7pre1/x86_64-unknown-linux-gnu/SerialImp.lo /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'init_threads': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: cast from pointer to integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_nativeDrain': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: cast to pointer from integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'read_byte_array': /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: cast to pointer from integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_readArray': /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: comparison is always false due to limited range of data type /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_readTerminatedArray': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: comparison is always false due to limited range of data type mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial- 2.0.7pre1.* gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so -o .libs/librxtxSerial-2.0.7pre1.so (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.0.7pre1.so librxtxSerial.so) creating librxtxSerial.la (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la librxtxSerial.la) gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/ParallelImp.lo /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function 'Java_javax_comm_LPRPort_readArray': /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: comparison is always false due to limited range of data type rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* .libs/librxtxParallel-2.0.7pre1.* gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so -o .libs/librxtxParallel- 2.0.7pre1.so (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.0.7pre1.so librxtxParallel.so) creating librxtxParallel.la (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la librxtxParallel.la) make all-am make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' libtool: install: `x86_64-unknown-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 ------------- Regards, Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071112/27758c3c/attachment-0003.html From tjarvi at qbang.org Mon Nov 12 01:02:09 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Nov 2007 01:02:09 -0700 (MST) Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> Message-ID: On Mon, 12 Nov 2007, Timothy Low wrote: > > Hi Trent, Hi Tim, Comments are inline. As I mentioned off the list, rxtx 2.0 is on the edge of deprecation. We can get it working but this is not the path of least resistance for future work. You will probably need to bounce another round of questions off the list. The following is intended to isolate the problem. > > I tried building RXTX from source, and I got this error. > > > I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm trying > to get the necessary ".so" files to use for my serial port communication > through java. > My linux kernal information is: > > *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 x86_64 > x86_64 x86_64 GNU/Linux* > > I'll most glad if you can provide me some direction on this. Thanks ! > > ---------------- > [root at smsgateway rxtx-2.0-7pre1]# ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > checking for C compiler default output... a.out > checking whether the C compiler works... yes > checking whether we are cross compiling... no > checking for suffix of executables... > checking for suffix of object files... o > checking whether we are using the GNU C compiler... yes > checking whether gcc accepts -g... yes > checking for gcc option to accept ANSI C... none needed > checking for ld used by GCC... /usr/bin/ld > checking if the linker (/usr/bin/ld) is GNU ld... yes > checking for /usr/bin/ld option to reload object files... -r > checking for BSD-compatible nm... /usr/bin/nm -B > checking for a sed that does not truncate output... /bin/sed > checking whether ln -s works... yes > checking how to recognise dependent libraries... pass_all > checking command to parse /usr/bin/nm -B output... ok > checking how to run the C preprocessor... gcc -E > checking for egrep... grep -E > checking for ANSI C header files... yes > checking for sys/types.h... yes > checking for sys/stat.h... yes > checking for stdlib.h... yes > checking for string.h... yes > checking for memory.h... yes > checking for strings.h... yes > checking for inttypes.h... yes > checking for stdint.h... yes > checking for unistd.h... yes > checking dlfcn.h usability... yes > checking dlfcn.h presence... yes > checking for dlfcn.h... yes > checking for ranlib... ranlib > checking for strip... strip > checking for objdir... .libs > checking for gcc option to produce PIC... -fPIC > checking if gcc PIC flag -fPIC works... yes > checking if gcc static flag -static works... yes > checking if gcc supports -c -o file.o... yes > checking if gcc supports -c -o file.lo... yes > checking if gcc supports -fno-rtti -fno-exceptions... yes > checking whether the linker (/usr/bin/ld) supports shared libraries... yes > checking how to hardcode library paths into programs... immediate > checking whether stripping libraries is possible... yes > checking dynamic linker characteristics... GNU/Linux ld.so > checking if libtool supports shared libraries... yes > checking whether to build shared libraries... yes > checking whether to build static libraries... no > checking whether -lc should be explicitly linked in... no > creating libtool > checking for a BSD-compatible install... /usr/bin/install -c > checking whether build environment is sane... yes > checking for gawk... gawk > checking whether make sets $(MAKE)... yes > checking for style of include used by make... GNU > checking dependency style of gcc... none > checking fcntl.h usability... yes > checking fcntl.h presence... yes > checking for fcntl.h... yes > checking sys/fcntl.h usability... yes > checking sys/fcntl.h presence... yes > checking for sys/fcntl.h... yes > checking sys/file.h usability... yes > checking sys/file.h presence... yes > checking for sys/file.h... yes > checking sys/time.h usability... yes > checking sys/time.h presence... yes > checking for sys/time.h... yes > checking sys/signal.h usability... yes > checking sys/signal.h presence... yes > checking for sys/signal.h... yes > checking signal.h usability... yes > checking signal.h presence... yes > checking for signal.h.. . yes > checking termios.h usability... yes > checking termios.h presence... yes > checking for termios.h... yes > checking asm/termbits.h usability... yes > checking asm/termbits.h presence... yes > checking for asm/termbits.h... yes > checking grp.h usability... yes > checking grp.h presence... yes > checking for grp.h... yes > checking pwd.h usability... yes > checking pwd.h presence... yes > checking for pwd.h... yes > checking whether gcc needs -traditional... no > checking whether to enable maintainer-specific portions of Makefiles... no > /usr/java/jdk1.5.0_13 > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /usr/java/jdk1.5.0_13 > checking os.name Linux > checking os.arch i386 > checking java.vendor Sun Microsystems Inc. > checking java.version 1.5.0_13 > checking os.version 2.6.18-8.el5xen > comm.jar appears to be installed already. > conftest.c: In function 'main': > conftest.c:6: warning: incompatible implicit declaration of built-in > function 'printf' > conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:6: error: (Each undeclared identifier is reported only once > conftest.c:6: error: for each function it appears in.) > conftest.c:6: error: expected ')' before string constant This is an outdated kernel version check for when headers and kernels could cause problems for rxtx. If we made it past this, then you are OK. > conftest.c:7: warning: incompatible implicit declaration of built-in > function 'exit' > ./configure: line 9649: ./conftest: No such file or directory > ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected It blew up but continues.. > conftest.c: In function 'main': > conftest.c:5: warning: incompatible implicit declaration of built-in > function 'printf' > conftest.c:10: warning: incompatible implicit declaration of built-in > function 'exit' > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status : config.h is unchanged > config.status: executing depfiles commands > [root at smsgateway rxtx-2.0-7pre1]# make install > /usr/java/jdk1.5.0_13/bin/javac -classpath > .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d > /home/jboss/sources/rxtx- 2.0-7pre1/ -O > /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java > /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/UnSupportedLoggerException.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java > Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or > overrides a deprecated API. > Note: Recompile with -Xlint:deprecation for details. > /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* The java jar should be fine now. You may need to change the source files as mentioned below. > gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. > -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g > -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o > /home/jboss/sources/rxtx-2.0-7pre1/x86_64-unknown-linux-gnu/SerialImp.lo > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'init_threads': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: cast > from pointer to integer of different size > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_nativeDrain': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: cast to > pointer from integer of different size > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'read_byte_array': > /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: cast to > pointer from integer of different size As I recall, this was caused by pointers (now 64 bit rather than 32 bit) being stored in java ints (jints). I would look at the diff between the CVS 2.1 SerialImp.c and RXTXPort.java files against 2.0. We did fix those issues. You have a .so file but the different pointer sizes will cause runtime errors. > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_readArray': > /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: > comparison is always false due to limited range of data type > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_readTerminatedArray': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: > comparison is always false due to limited range of data type > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial- > 2.0.7pre1.* > gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so -o > .libs/librxtxSerial-2.0.7pre1.so > (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.0.7pre1.so > librxtxSerial.so) > creating librxtxSerial.la > (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la > librxtxSerial.la) > gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. > -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g > -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o > /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/ParallelImp.lo > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function > 'Java_javax_comm_LPRPort_readArray': > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: > comparison is always false due to limited range of data type > rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* > .libs/librxtxParallel-2.0.7pre1.* > gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so -o > .libs/librxtxParallel- 2.0.7pre1.so > (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.0.7pre1.so > librxtxParallel.so) > creating librxtxParallel.la > (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la > librxtxParallel.la) > make all-am > make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' > make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' > libtool: install: `x86_64-unknown-linux-gnu' must be an absolute directory > name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 A libtool change? Assuming you ran configure && make install in /home/jboss/sources/rxtx- 2.0-7pre1, libtool is looking for /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/.libs/librxtxSerial-2.0.7pre1.so. I think you have this? The file is just being copied to ~JAVA/jre/lib/$(JAVA_ARCH). -- Trent Jarvi tjarvi at qbang.org From sarah_662005 at yahoo.com Mon Nov 12 16:10:28 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Mon, 12 Nov 2007 15:10:28 -0800 (PST) Subject: [Rxtx] [urgent] device's power off detection Message-ID: <766782.10076.qm@web55803.mail.re3.yahoo.com> Hello all, I have a small application built on top of rxtx api. This application can retrieve the incoming data from a device through a port. The device can be powered off after the port get closed from the application. I have been trying a couple of hours to find a way to detect the power switching from device. If anyone knows how to handle it through rxtx, could you please give me a help? Thank you very much. r, Sara ____________________________________________________________________________________ Get easy, one-click access to your favorites. Make Yahoo! your homepage. http://www.yahoo.com/r/hs -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071112/4599f3ec/attachment-0002.html From netbeans at gatworks.com Mon Nov 12 17:52:22 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 12 Nov 2007 19:52:22 -0500 Subject: [Rxtx] [urgent] device's power off detection In-Reply-To: <766782.10076.qm@web55803.mail.re3.yahoo.com> References: <766782.10076.qm@web55803.mail.re3.yahoo.com> Message-ID: <4738F546.5010101@gatworks.com> Not sure what u are asking for. Are u asking for a way to detect if the device is OFF? Are u asking how to power off the device - via software ? Is it a Serial device? is it a parallel device? is it a usb device? Sara Hugh wrote: > Hello all, > I have a small application built on top of rxtx api. This application > can retrieve the incoming data from a device through a port. The device > can be powered off after the port get closed from the application. I > have been trying a couple of hours to find a way to detect the power > switching from device. If anyone knows how to handle it through rxtx, > could you please give me a help? Thank you very much. From tjarvi at qbang.org Mon Nov 12 22:48:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Nov 2007 22:48:11 -0700 (MST) Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711120225x562db8cbxb750767ade3b0d73@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> <900c6ba90711120031p66edc001ted76f7ba24e34b98@mail.gmail.com> <900c6ba90711120225x562db8cbxb750767ade3b0d73@mail.gmail.com> Message-ID: Hi Tim, The gnu.io namespace looks just like the javax.comm 2.0 namespace. There are additional (discouraged) undocumented methods in gnu.io that you need not use. We just used the different namespace to avoid poluting Sun's by mistake and to make sure we stayed off any potential licensing related radar. Usuaully, you just change your imports and make sure you do not use the javax.comm namespace for anything like exception handling. As I mentioned off the list, there are no issues with rxtx going through the JSR process to be more Sun friendly other than time. rxtx has no hidden intentions there; anything that does not work like CommAPI 2.0 documented is a bug. The reason we do not support CommAPI 2.1 is technical in nature and is in the list archives as well as the front page of www.rxtx.org. On Mon, 12 Nov 2007, Timothy Low wrote: > Hi Trent, > > I'll move to use a JDK1.5 64-bit version... but do I need to make any source > code changes to use the package (gnu.io) in the RTXTcomm.jar instead of the > ones from the javacomm api ? > > > Regards, > Tim > > On Nov 12, 2007 5:22 PM, Trent Jarvi wrote: > >> >> Hi Tim, >> >> I see a couple things here. >> >> First your jdk is for i686 yet the library is compiled on a x86_64 >> machine. You may try passing configure the --target=i686-unknown-linux to >> try using the i686 backend to gcc if it is available. Or move to the 64 >> bit jdk. >> >> The other error I see is again the moved UTF_RELEASE define that we need >> to fix. You can probably get around that with: >> >> make -DUTF_RELEASE=`uname -r` >> >> even more simple would be to just specify the serial library which should >> be in configure --help. >> >> You can remove the UTF_RELEASE check from configure by editing >> configure.in, searching for the simple C program check and deleting it. >> Running autoconf after that will regenerate a new configure without the >> check. >> >> Note that you should remove the previous native libraries >> (librxtxSerial.so) when moving from rxtx 2.0 to 2.1. These are compiled >> for different namespaces (javax.comm/gnu.io). >> >> On Mon, 12 Nov 2007, Timothy Low wrote: >> >>> *Hi Trent, >>> >>> I moved on to rxtx 2.1.7r2, and updated my jre to 1.6.0 (64-bit)... I >> tried >>> the following 2 methods: >>> >>> (1) using the rxtx 2.1.7 binaries from the RXTX website* >>> *Are these binaries suitable for a 64-bit OS ? There mentioning of the >>> gnu.io that you've talked about previously...* >>> ------ >>> [root at smsgateway sources]# java -Djava.library.path=/usr/lib PortLister >>> Experimental: JNI_OnLoad called. >>> >>> java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion >>> ()Ljava/lang/String; >>> at gnu.io.RXTXCommDriver.nativeGetVersion(Native Method) >>> at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:85) >>> at java.lang.Class.forName0(Native Method) >>> at java.lang.Class.forName(Unknown Source) >>> at javax.comm.CommPortIdentifier.loadDriver( >> CommPortIdentifier.java >>> :237) >>> at javax.comm.CommPortIdentifier.(CommPortIdentifier.java >>> :109) >>> at PortLister.(PortLister.java:6) >>> at PortLister.main(PortLister.java:25) >>> Exception in thread "main" java.lang.UnsatisfiedLinkError: >>> com.sun.comm.SunrayInfo.isSessionActive()Z >>> at com.sun.comm.SunrayInfo.isSessionActive(Native Method) >>> at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java >> :155) >>> at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java >>> :100) >>> at javax.comm.CommPortIdentifier.(CommPortIdentifier.java >>> :138) >>> at PortLister.(PortLister.java:6) >>> at PortLister.main(PortLister.java:25) >>> >>> ------ >>> >>> (2) compiling the rxtx 2.1.7 from source >>> *but i got the following error while running ./configure and make all* >>> >>> ------ >>> [root at smsgateway rxtx-2.1-7r2]# ./configure >>> checking build system type... x86_64-unknown-linux-gnu >>> checking host system type... x86_64-unknown-linux-gnu >>> checking target system type... x86_64-unknown-linux-gnu >>> configure: WARNING: Trying libtool. If the following fails install >> libtool >>> checking for gcc... gcc >>> checking for C compiler default output file name... a.out >>> checking whether the C compiler works... yes >>> checking whether we are cross compiling... no >>> checking for suffix of executables... >>> checking for suffix of object files... o >>> checking whether we are using the GNU C compiler... yes >>> checking whether gcc accepts -g... yes >>> checking for gcc option to accept ANSI C... none needed >>> checking for a sed that does not truncate output... /bin/sed >>> checking for egrep... grep -E >>> checking for ld used by gcc... /usr/bin/ld >>> checking if the linker (/usr/bin/ld) is GNU ld... yes >>> checking for /usr/bin/ld option to reload object files... -r >>> checking for BSD-compatible nm... /usr/bin/nm -B >>> checking whether ln -s works... yes >>> checking how to recognise dependent libraries... pass_all >>> checking how to run the C preprocessor... gcc -E >>> checking for ANSI C header files... yes >>> checking for sys/types.h... yes >>> checking for sys/stat.h... yes >>> checking for stdlib.h... yes >>> checking for string.h... yes >>> checking for memory.h... yes >>> checking for strings.h... yes >>> checking for inttypes.h... yes >>> checking for stdint.h... yes >>> checking for unistd.h... yes >>> checking dlfcn.h usability... yes >>> checking dlfcn.h presence... yes >>> checking for dlfcn.h... yes >>> checking for g++... g++ >>> checking whether we are using the GNU C++ compiler... yes >>> checking whether g++ accepts -g... yes >>> checking how to run the C++ preprocessor... g++ -E >>> checking for g77... no >>> checking for f77... no >>> checking for xlf... no >>> checking for frt... no >>> checking for pgf77... no >>> checking for fort77... no >>> checking for fl32... no >>> checking for af77... no >>> checking for f90... no >>> checking for xlf90... no >>> checking for pgf90... no >>> checking for epcf90... no >>> checking for f95... f95 >>> checking whether we are using the GNU Fortran 77 compiler... yes >>> checking whether f95 accepts -g... yes >>> checking the maximum length of command line arguments... 32768 >>> checking command to parse /usr/bin/nm -B output from gcc object... ok >>> checking for objdir... .libs >>> checking for ar... ar >>> checking for ranlib... ranlib >>> checking for strip... strip >>> checking if gcc static flag works... yes >>> checking if gcc supports -fno-rtti -fno-exceptions... no >>> checking for gcc option to produce PIC... -fPIC >>> checking if gcc PIC flag -fPIC works... yes >>> checking if gcc supports -c -o file.o... yes >>> checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking whether -lc should be explicitly linked in... no >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> checking if libtool supports shared libraries... yes >>> checking whether to build shared libraries... yes >>> checking whether to build static libraries... no >>> configure: creating libtool >>> appending configuration tag "CXX" to libtool >>> checking for ld used by g++... /usr/bin/ld -m elf_x86_64 >>> checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes >>> checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking for g++ option to produce PIC... -fPIC >>> checking if g++ PIC flag -fPIC works... yes >>> checking if g++ supports -c -o file.o... yes >>> checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> appending configuration tag "F77" to libtool >>> checking if libtool supports shared libraries... yes >>> checking whether to build shared libraries... yes >>> checking whether to build static libraries... no >>> checking for f95 option to produce PIC... -fPIC >>> checking if f95 PIC flag -fPIC works... yes >>> checking if f95 supports -c -o file.o... yes >>> checking whether the f95 linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> checking for a BSD-compatible install... /usr/bin/install -c >>> checking whether build environment is sane... yes >>> checking for gawk... gawk >>> checking whether make sets $(MAKE)... yes >>> checking for style of include used by make... GNU >>> checking dependency style of gcc... none >>> checking dependency style of g++... none >>> checking fcntl.h usability... yes >>> checking fcntl.h presence... yes >>> checking for fcntl.h... yes >>> checking sys/fcntl.h usability... yes >>> checking sys/fcntl.h presence... yes >>> checking for sys/fcntl.h... yes >>> checking sys/file.h usability... yes >>> checking sys/file.h presence... yes >>> checking for sys/file.h... yes >>> checking sys/time.h usability... yes >>> checking sys/time.h presence... yes >>> checking for sys/time.h... yes >>> checking sys/signal.h usability... yes >>> checking sys/signal.h presence... yes >>> checking for sys/signal.h... yes >>> checking signal.h usability... yes >>> checking signal.h presence... yes >>> checking for signal.h... yes >>> checking termios.h usability... yes >>> checking termios.h presence... yes >>> checking for termios.h... yes >>> checking grp.h usability... yes >>> checking grp.h presence... yes >>> checking for grp.h... yes >>> checking pwd.h usability... yes >>> checking pwd.h presence... yes >>> checking for pwd.h... yes >>> checking whether gcc needs -traditional... no >>> checking whether to enable maintainer-specific portions of Makefiles... >> no >>> /usr/java/jdk1.5.0_13 >>> configure: WARNING: using JAVA_HOME environmental variable >>> adjusted java.home is /usr/java/jdk1.5.0_13 >>> checking os.name Linux >>> checking os.arch i386 >>> checking java.vendor Sun Microsystems Inc. >>> checking java.version 1.5.0_13 >>> checking os.version 2.6.18-8.el5xen >>> conftest.c: In function 'main': >>> conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this >> function) >>> conftest.c:8: error: (Each undeclared identifier is reported only once >>> conftest.c:8: error: for each function it appears in.) >>> conftest.c:8: error: expected ')' before string constant >>> ./configure: line 21462: ./conftest: No such file or directory >>> ./configure: line 21462: test: 2.6.18-8.el5xen: unary operator expected >>> configure: creating ./config.status >>> config.status: creating Makefile >>> config.status: creating config.h >>> config.status: executing depfiles commands >>> [root at smsgateway rxtx-2.1-7r2]# make install >>> /usr/java/jdk1.5.0_13/bin/javac -classpath .:/home/jboss/sources/rxtx- >>> >> 2.1-7r2:/home/jboss/sources/rxtx-2.1-7r2/src:/usr/java/jdk1.5.0_13/jre/lib/ext/RXTXcomm.jar-d >>> /home/jboss/sources/rxtx- >>> 2.1-7r2/ -O -source 1.3 -target 1.3 >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommDriver.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortEnumerator.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortIdentifier.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortOwnershipListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Configure.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2C.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/I2CPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/LPRPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/NoSuchPortException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/PortInUseException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Raw.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/RawPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RawPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RawPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/RS485PortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485PortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485Port.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXCommDriver.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXVersion.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPort.java >>> /home/jboss/sources/rxtx-2.1-7r2 >> /./src/UnsupportedCommOperationException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/UnSupportedLoggerException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Zystem.java >>> /usr/java/jdk1.5.0_13/bin/javah -classpath .:/home/jboss/sources/rxtx- >>> >> 2.1-7r2:/home/jboss/sources/rxtx-2.1-7r2/src:/usr/java/jdk1.5.0_13/jre/lib/ext/RXTXcomm.jar-d >>> x86_64-unknown-linux-gnu -jni `(for i in CommDriver CommPortEnumerator >>> CommPortIdentifier CommPort CommPortOwnershipListener Configure I2C >>> I2CPortEvent I2CPortEventListener I2CPort LPRPort NoSuchPortException >>> ParallelPortEvent ParallelPortEventListener ParallelPort >> PortInUseException >>> Raw RawPortEvent RawPortEventListener RawPort RS485 RS485PortEvent >>> RS485PortEventListener RS485Port RXTXCommDriver RXTXPort RXTXVersion >>> SerialPortEvent SerialPortEventListener SerialPort >>> UnsupportedCommOperationException UnSupportedLoggerException Zystem;do \ >>> if grep > /dev/null native.*\( /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/$i.java; then \ >>> echo gnu.io.$i; \ >>> fi; \ >>> done)` >>> /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialImp.c -o >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo; >>> \ >>> if [ "Serial" = "Serial" ]; >>> then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxSerial.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxSerial.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo; >> \ >>> fi; \ >>> ) >>> mkdir /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/.libs >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/SerialImp.o >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/fuserImp.o >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c: In function >> 'show_user': >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c:238: warning: cast >> from >>> pointer to integer of different size >>> gcc -shared /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/SerialImp.o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/fuserImp.o >>> -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7.so -o >> .libs/librxtxSerial- >>> 2.1-7.so >>> (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.1-7.so >>> librxtxSerial.so) >>> creating librxtxSerial.la >>> (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la >>> librxtxSerial.la) >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelImp.c -o >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/ParallelImp.lo; >>> \ >>> if [ "Parallel" = "Serial" ]; >>> then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxParallel.la -rpath >>> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/ParallelImp.lo >>> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxParallel.la -rpath >>> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/ParallelImp.lo; >>> \ >>> fi; \ >>> ) >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >>> /x86_64-unknown-linux-gnu/.libs/ParallelImp.o >>> gcc -shared /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/ParallelImp.o >>> -lpthread -Wl,-soname -Wl,librxtxParallel-2.1-7.so -o >>> .libs/librxtxParallel-2.1-7.so >>> (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.1-7.so >>> librxtxParallel.so) >>> creating librxtxParallel.la >>> (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la >>> librxtxParallel.la) >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo; >>> \ >>> if [ "I2C" = "Serial" ]; then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxI2C.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo >>> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxI2C.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo; >>> \ >>> fi; \ >>> ) >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/.libs/I2CImp.o >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c: In function >>> 'Java_gnu_io_I2CPort_Initialize': >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: 'UTS_RELEASE' >>> undeclared (first use in this function) >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: (Each >> undeclared >>> identifier is reported only once >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: for each >> function >>> it appears in.) >>> libtool: link: `/home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/I2CImp.lo' >>> is not a valid libtool object >>> make: *** [x86_64-unknown-linux-gnu/librxtxI2C.la] Error 1 >>> >>> ------ >>> >>> >>> >>> On Nov 12, 2007 4:02 PM, Trent Jarvi wrote: >>> >>>> On Mon, 12 Nov 2007, Timothy Low wrote: >>>>> >>>>> Hi Trent, >>>> >>>> Hi Tim, >>>> >>>> Comments are inline. As I mentioned off the list, rxtx 2.0 is on the >> edge >>>> of deprecation. We can get it working but this is not the path of >> least >>>> resistance for future work. >>>> >>>> You will probably need to bounce another round of questions off the >> list. >>>> The following is intended to isolate the problem. >>>> >>>>> >>>>> I tried building RXTX from source, and I got this error. >>>>> >>>>> >>>>> I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm >>>> trying >>>>> to get the necessary ".so" files to use for my serial port >> communication >>>>> through java. >>>>> My linux kernal information is: >>>>> >>>>> *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 >>>> x86_64 >>>>> x86_64 x86_64 GNU/Linux* >>>>> >>>>> I'll most glad if you can provide me some direction on this. Thanks ! >>>>> >>>>> ---------------- >>>>> [root at smsgateway rxtx-2.0-7pre1]# ./configure >>>>> checking build system type... x86_64-unknown-linux-gnu >>>>> checking host system type... x86_64-unknown-linux-gnu >>>>> checking target system type... x86_64-unknown-linux-gnu >>>>> configure: WARNING: Trying libtool. If the following fails install >>>> libtool >>>>> checking for gcc... gcc >>>>> checking for C compiler default output... a.out >>>>> checking whether the C compiler works... yes >>>>> checking whether we are cross compiling... no >>>>> checking for suffix of executables... >>>>> checking for suffix of object files... o >>>>> checking whether we are using the GNU C compiler... yes >>>>> checking whether gcc accepts -g... yes >>>>> checking for gcc option to accept ANSI C... none needed >>>>> checking for ld used by GCC... /usr/bin/ld >>>>> checking if the linker (/usr/bin/ld) is GNU ld... yes >>>>> checking for /usr/bin/ld option to reload object files... -r >>>>> checking for BSD-compatible nm... /usr/bin/nm -B >>>>> checking for a sed that does not truncate output... /bin/sed >>>>> checking whether ln -s works... yes >>>>> checking how to recognise dependent libraries... pass_all >>>>> checking command to parse /usr/bin/nm -B output... ok >>>>> checking how to run the C preprocessor... gcc -E >>>>> checking for egrep... grep -E >>>>> checking for ANSI C header files... yes >>>>> checking for sys/types.h... yes >>>>> checking for sys/stat.h... yes >>>>> checking for stdlib.h... yes >>>>> checking for string.h... yes >>>>> checking for memory.h... yes >>>>> checking for strings.h... yes >>>>> checking for inttypes.h... yes >>>>> checking for stdint.h... yes >>>>> checking for unistd.h... yes >>>>> checking dlfcn.h usability... yes >>>>> checking dlfcn.h presence... yes >>>>> checking for dlfcn.h... yes >>>>> checking for ranlib... ranlib >>>>> checking for strip... strip >>>>> checking for objdir... .libs >>>>> checking for gcc option to produce PIC... -fPIC >>>>> checking if gcc PIC flag -fPIC works... yes >>>>> checking if gcc static flag -static works... yes >>>>> checking if gcc supports -c -o file.o... yes >>>>> checking if gcc supports -c -o file.lo... yes >>>>> checking if gcc supports -fno-rtti -fno-exceptions... yes >>>>> checking whether the linker (/usr/bin/ld) supports shared libraries... >>>> yes >>>>> checking how to hardcode library paths into programs... immediate >>>>> checking whether stripping libraries is possible... yes >>>>> checking dynamic linker characteristics... GNU/Linux ld.so >>>>> checking if libtool supports shared libraries... yes >>>>> checking whether to build shared libraries... yes >>>>> checking whether to build static libraries... no >>>>> checking whether -lc should be explicitly linked in... no >>>>> creating libtool >>>>> checking for a BSD-compatible install... /usr/bin/install -c >>>>> checking whether build environment is sane... yes >>>>> checking for gawk... gawk >>>>> checking whether make sets $(MAKE)... yes >>>>> checking for style of include used by make... GNU >>>>> checking dependency style of gcc... none >>>>> checking fcntl.h usability... yes >>>>> checking fcntl.h presence... yes >>>>> checking for fcntl.h... yes >>>>> checking sys/fcntl.h usability... yes >>>>> checking sys/fcntl.h presence... yes >>>>> checking for sys/fcntl.h... yes >>>>> checking sys/file.h usability... yes >>>>> checking sys/file.h presence... yes >>>>> checking for sys/file.h... yes >>>>> checking sys/time.h usability... yes >>>>> checking sys/time.h presence... yes >>>>> checking for sys/time.h... yes >>>>> checking sys/signal.h usability... yes >>>>> checking sys/signal.h presence... yes >>>>> checking for sys/signal.h... yes >>>>> checking signal.h usability... yes >>>>> checking signal.h presence... yes >>>>> checking for signal.h.. . yes >>>>> checking termios.h usability... yes >>>>> checking termios.h presence... yes >>>>> checking for termios.h... yes >>>>> checking asm/termbits.h usability... yes >>>>> checking asm/termbits.h presence... yes >>>>> checking for asm/termbits.h... yes >>>>> checking grp.h usability... yes >>>>> checking grp.h presence... yes >>>>> checking for grp.h... yes >>>>> checking pwd.h usability... yes >>>>> checking pwd.h presence... yes >>>>> checking for pwd.h... yes >>>>> checking whether gcc needs -traditional... no >>>>> checking whether to enable maintainer-specific portions of >> Makefiles... >>>> no >>>>> /usr/java/jdk1.5.0_13 >>>>> configure: WARNING: using JAVA_HOME environmental variable >>>>> adjusted java.home is /usr/java/jdk1.5.0_13 >>>>> checking os.name Linux >>>>> checking os.arch i386 >>>>> checking java.vendor Sun Microsystems Inc. >>>>> checking java.version 1.5.0_13 >>>>> checking os.version 2.6.18-8.el5xen >>>>> comm.jar appears to be installed already. >>>>> conftest.c: In function 'main': >>>>> conftest.c:6: warning: incompatible implicit declaration of built-in >>>>> function 'printf' >>>>> conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this >>>> function) >>>>> conftest.c:6: error: (Each undeclared identifier is reported only once >>>>> conftest.c:6: error: for each function it appears in.) >>>>> conftest.c:6: error: expected ')' before string constant >>>> >>>> >>>> This is an outdated kernel version check for when headers and kernels >>>> could cause problems for rxtx. If we made it past this, then you are >> OK. >>>> >>>> >>>>> conftest.c:7: warning: incompatible implicit declaration of built-in >>>>> function 'exit' >>>>> ./configure: line 9649: ./conftest: No such file or directory >>>>> ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected >>>> >>>> It blew up but continues.. >>>> >>>>> conftest.c: In function 'main': >>>>> conftest.c:5: warning: incompatible implicit declaration of built-in >>>>> function 'printf' >>>>> conftest.c:10: warning: incompatible implicit declaration of built-in >>>>> function 'exit' >>>>> configure: creating ./config.status >>>>> config.status: creating Makefile >>>>> config.status: creating config.h >>>>> config.status : config.h is unchanged >>>>> config.status: executing depfiles commands >>>>> [root at smsgateway rxtx-2.0-7pre1]# make install >>>>> /usr/java/jdk1.5.0_13/bin/javac -classpath >>>>> .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/ -O >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1 >> /./src/UnSupportedLoggerException.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java >>>>> Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or >>>>> overrides a deprecated API. >>>>> Note: Recompile with -Xlint:deprecation for details. >>>>> /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* >>>> >>>> >>>> The java jar should be fine now. You may need to change the source >> files >>>> as mentioned below. >>>> >>>>> gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu >> -I. >>>>> -I/usr/java/jdk1.5.0_13/include >> -I/usr/java/jdk1.5.0_13/include/./linux/ >>>> -g >>>>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o >>>>> /home/jboss/sources/rxtx-2.0-7pre1 >> /x86_64-unknown-linux-gnu/SerialImp.lo >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'init_threads': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: >>>> cast >>>>> from pointer to integer of different size >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_nativeDrain': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: >>>> cast to >>>>> pointer from integer of different size >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'read_byte_array': >>>>> /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: >>>> cast to >>>>> pointer from integer of different size >>>> >>>> >>>> As I recall, this was caused by pointers (now 64 bit rather than 32 >> bit) >>>> being stored in java ints (jints). I would look at the diff between >> the >>>> CVS 2.1 SerialImp.c and RXTXPort.java files against 2.0. We >>>> did fix those issues. >>>> >>>> You have a .so file but the different pointer sizes will cause runtime >>>> errors. >>>> >>>> >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_readArray': >>>>> /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: >>>>> comparison is always false due to limited range of data type >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_readTerminatedArray': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: >>>>> comparison is always false due to limited range of data type >>>>> mkdir .libs >>>>> rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* >> .libs/librxtxSerial- >>>>> 2.0.7pre1.* >>>>> gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so-o >>>>> .libs/librxtxSerial-2.0.7pre1.so >>>>> (cd .libs && rm -f librxtxSerial.so && ln -s >> librxtxSerial-2.0.7pre1.so >>>>> librxtxSerial.so) >>>>> creating librxtxSerial.la >>>>> (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la >>>>> librxtxSerial.la) >>>>> gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu >> -I. >>>>> -I/usr/java/jdk1.5.0_13/include >> -I/usr/java/jdk1.5.0_13/include/./linux/ >>>> -g >>>>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o >>>>> /home/jboss/sources/rxtx- 2.0-7pre1 >>>> /x86_64-unknown-linux-gnu/ParallelImp.lo >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function >>>>> 'Java_javax_comm_LPRPort_readArray': >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: >>>>> comparison is always false due to limited range of data type >>>>> rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* >>>>> .libs/librxtxParallel-2.0.7pre1.* >>>>> gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so-o >>>>> .libs/librxtxParallel- 2.0.7pre1.so >>>>> (cd .libs && rm -f librxtxParallel.so && ln -s >>>> librxtxParallel-2.0.7pre1.so >>>>> librxtxParallel.so) >>>>> creating librxtxParallel.la >>>>> (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la >>>>> librxtxParallel.la) >>>>> make all-am >>>>> make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' >>>>> make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' >>>>> libtool: install: `x86_64-unknown-linux-gnu' must be an absolute >>>> directory >>>>> name >>>>> Try `libtool --help --mode=install' for more information. >>>>> make: *** [install] Error 1 >>>> >>>> A libtool change? Assuming you ran configure && make install in >>>> /home/jboss/sources/rxtx- 2.0-7pre1, libtool is looking for >>>> /home/jboss/sources/rxtx- >>>> 2.0-7pre1/x86_64-unknown-linux-gnu/.libs/librxtxSerial-2.0.7pre1.so. >>>> >>>> I think you have this? The file is just being copied to >>>> ~JAVA/jre/lib/$(JAVA_ARCH). >>>> >>>> -- >>>> Trent Jarvi >>>> tjarvi at qbang.org >>>> >>> >> > From guido.vogt at celsi.ch Tue Nov 13 00:28:01 2007 From: guido.vogt at celsi.ch (Guido Vogt) Date: Tue, 13 Nov 2007 08:28:01 +0100 Subject: [Rxtx] RTS Line can't be set Message-ID: <47395201.1050400@celsi.ch> I'm working on an Windows XP /SP2 System. Version of RXTX: 2.1.7. The serial line is connected to a modem. As I can see, the RTS-Line of the serial Port is inactive, when the port is opened (flowcontrol=none). Obviously, no data is coming from the modem. If I use the setRTS(true) command after open, the comport does not send out my data any more. This behaviour is regardless of flowcontrol. Anybody has an idea what do do? Thanks for help. From Martin.Oberhuber at windriver.com Tue Nov 13 08:58:23 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 13 Nov 2007 16:58:23 +0100 Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803880918@ism-mail03.corp.ad.wrs.com> Hi Trent, as said before, I like the idea of discussing such quality engineering issues, but why hide these away from the rest of the public? Anyways, if you do want to create a new mailing list for these kinds of things I'll happily subscribe. 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: Sunday, November 11, 2007 1:46 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: RE: [Rxtx] Quality Engineering with rxtx > > On Mon, 5 Nov 2007, Oberhuber, Martin wrote: > > > Hi Trent, > > > > are the interestes of hobbyists really so different > > from commercial ones? Both should be interested in > > high quality and innovation the like. > > > > I haven't seen too many Open Source projects from the > > "inside" but those that I have seen did not have > > separate mailing lists for quality/testing/qa > > versus innovation/development. > > > > What I have seen with the Open Source projects that > > one would call "successful" is a good deal of > > process around automated builds, automated unit > > tests, predictable release dates and milestones, > > and policies around commiting/contributing/reviewing > > changes. > > > > I think that all of these benefit commercial users > > and hobbyists the like. > > > > If you were just asking about who's interested in > > discussing changes to foster more quality, count > > me in. I'm just not sure whether discussing these > > on a separate mailing list or other channel is the > > right thing to do. > > > > Hi Martin, > > There are two issues I'm thinking about. The first is the > generic unit > testing and quality initiatives required to move rxtx > forward. The second > is the inevitable fact that rxtx connects to external hardware. The > discussion deals with a different set of problems. > > Here is a simple example of what I'm getting at. > > We have the capability of setting custom baud rates in rxtx. > We may be > interested in seeing regressions in rxtx, the C library or > the kernel. > Some people may be doing some tests with loopback > connections. These will > always work even if the baud rate is not set to the expected > value. Some > people may use null modems between two ports. This may be > able to catch > the problem but not always. > > Will the build machines be able to test this? (no - for a few reasons) > Will people be trying to catch these type of regressions? (yes) > What type of coverage does the community have in the end? (?) > > We could include the discussions in the same list or another > equally open > list that may be of interest to some folks that deal with > these types of > problems on a regular basis. > > -- > Trent Jarvi > tjarvi at qbang.org > From toupsz at cs.tamu.edu Tue Nov 13 10:33:03 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 13 Nov 2007 11:33:03 -0600 Subject: [Rxtx] [urgent] device's power off detection In-Reply-To: <4738F546.5010101@gatworks.com> References: <766782.10076.qm@web55803.mail.re3.yahoo.com> <4738F546.5010101@gatworks.com> Message-ID: Lacking any other specification on it...but can you set up the device to notify your software when it turns off? Send a message or somesuch? Maybe it can signal using RTS or DTR? -Zach On Nov 12, 2007 6:52 PM, U. George wrote: > Not sure what u are asking for. Are u asking for a way to detect if the > device is OFF? Are u asking how to power off the device - via software ? > Is it a Serial device? > is it a parallel device? > is it a usb device? > > Sara Hugh wrote: > > Hello all, > > I have a small application built on top of rxtx api. This application > > can retrieve the incoming data from a device through a port. The device > > can be powered off after the port get closed from the application. I > > have been trying a couple of hours to find a way to detect the power > > switching from device. If anyone knows how to handle it through rxtx, > > could you please give me a help? Thank you very much. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071113/e5859e4d/attachment.html From tjarvi at qbang.org Tue Nov 13 20:02:03 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 13 Nov 2007 20:02:03 -0700 (MST) Subject: [Rxtx] #ifndef TIOCSERGETLSR In-Reply-To: <472E3AAF.7050709@gatworks.com> References: <472E3AAF.7050709@gatworks.com> Message-ID: On Sun, 4 Nov 2007, U. George wrote: > For Linux, it seems that you need the code for both *having* a > TIOCSERGETLSR, and *not having* a TIOCSERGETLSR. Maybe the ioctl exists > system wide, but not necessarily for the device driver itself ( always > returns -1 ) . > > Are there systems that have a *functioning* TIOCSERGETLSR for all their > devices? Then this would be the case where the "#ifndef TIOCSERGETLSR" > directive could be useful is eliminating the unnecessary code and tests. > > And for those systems that dont have a TIOCSERGETLSR, then the code for > TIOCSERGETLSR can be eliminated. > > It would be a simple case to have, as a foundation, all the code to > simulate the missing TIOCSERGETLSR ioctl. If the system does have the > ioctl, then that code can be ifdef'd in, and co-exist with the > functionality of the code that simulates the missing TIOCSERGETLSR ioctl. > Ah, there is the post. Sorry I was on vacation. Hi George, Yes there are systems that have functioning TIOCSERGETLSR for all of their devices. These are machines that just use traditional UARTs. If you mean operating systems, then probably not. Let me explain a bit about the history of those #ifdefs to help clear up a mess. RXTX aims to follow POSIX. TIOCSERGETLSR turns out to not be POSIX at all as I understand. It isn't in BSD, Solaris, AIX or HP-UX. It certainly provides access to important information. I assumed it was standard when I coded rxtx on a Linux system. Ya, laugh. Then I looked at Win32.. Oh you are still laughing? ..I could not navigate msft's web site at the time [still can't really find anything today]. So google pointed me to someones 'reverse documentation' of the w32 API and an example msft put together back in the win3.0 days. It was enough but maybe not 100% correct. They covered overlapped IO which was important for events in rxtx. Looking at Win32 and Linux, it made sense to implement TIOCSERGETLSR for win32 with the way rxtx works. That was how things matched up. But when I got feedback about other systems, it didn't match up. When people used multiport cards with money saving designs in Linux, it didn't match up. And today, there are drivers for unusual serial ports that don't match up. Now we have some ugly logic that mostly works for most serial ports. It isn't right though. The important aspect of TIOSERGETLSR is knowing when the output is really gone. But POSIX tcdrain tells us the same thing. So there is logic in the ifdefs to match that up as you suggest. Perhaps a more formal solution along those lines would be worth looking into. I would suggest the roles should be switched though. We should use POSIX calls on all systems and hide things that don't work on everything like we have with other undocumented calls. TIOSERGETLSR is nice and would be great if it was standard. It isn't as far as I can tell. In the end, many people write Java code because they want portability. The TIOSERGETLSR does not really fit. In someways, this is limiting to the least common denominator which is Solaris if you have seen it's serial kernel driver code. -- Trent Jarvi tjarvi at qbang.org From keithvz at verizon.net Thu Nov 1 08:08:58 2007 From: keithvz at verizon.net (Keith) Date: Thu, 01 Nov 2007 10:08:58 -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: <4729DDFA.7080206@verizon.net> Trent Jarvi wrote: > 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? Well, I honestly don't know how all this fits together. I think it's just a matter of enabling the right flow control option within the standard serial framework to tell the device driver, "HEY START USING DTR/DSR FOR FLOW CONTROL." If what UGeorge said,(about that type of nitty-gritty lead control being done within the device driver), is true, then this confirms my suspicion. I tried narrowing down within the Linux drivers what you are looking for, but I can't entirely tell wth I'm looking at. (virtual com port drivers -- they are included compiled by default with Ubuntu, source included) http://www.ftdichip.com/Drivers/VCP/Linux/ftdi_sio.tar.gz Hahahaa, they make a reference to DTR flow control being supported but say (UGH) in parenthesis. You can also use their direct device driver library on Ubuntu -- libftd2xx.so.0.4.13. No source code. http://www.ftdichip.com/Drivers/D2XX/Linux/libftd2xx0.4.13.tar.gz In that case, you make a call to their FT_SetFlowControl() function. FT_STATUS FT_SetFlowControl (FT_HANDLE ftHandle, USHORT usFlowControl, UCHAR uXon,UCHAR uXoff) Parameters ftHandle Handle of the device. usFlowControl Must be one of FT_FLOW_NONE, FT_FLOW_RTS_CTS, ****FT_FLOW_DTR_DSR**** or FT_FLOW_XON_XOFF. uXon Character used to signal Xon. Only used if flow control is FT_FLOW_XON_XOFF. uXoff Character used to signal Xoff. Only used if flow control is FT_FLOW_XON_XOFF. This is from their programming guide http://www.ftdichip.com/Documents/ProgramGuides/D2XXPG34.pdf I actually want to take this a step further and say that I think the flow control is actually handled right on the device itself in hardware/firmware. It's enabled through the device driver, but I think the maintaining of buffers, asserting/deasserting of leads, etc is handled by the device. For the time being, I've switched to jd2xx, https://jd2xx.dev.java.net/ and http://bleyer.org/jd2xx/ These are Java wrappers for the device driver libraries. It allows almost direct access to the well-documented device drivers from Java. I hope this helps Keith From tjarvi at qbang.org Thu Nov 1 11:09:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:09:51 -0600 (MDT) 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: Hi Martin, What I usually have done is allow changes that do not impact working software including changes to methods not documented in CommAPI (which remain undocumented in rxtx) and fixes to known problems in the documented portions. That way if you use the documented API, the releases should only become better with time. If you use the undocumented portions, the behavior is not as predictable but open for improvement. On Wed, 31 Oct 2007, 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 >> > From tjarvi at qbang.org Thu Nov 1 11:15:52 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:15:52 -0600 (MDT) 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: I too use rxtx in commercial products. The problem I've been trying to address while bringing the server back was how to make it possible for hobby folks to build the same software as companies so we can move rxtx along a little faster. Exposing internal tools is not an option at this time, the public rxtx builds have been done on my home machine which has drives hanging out of it all over the place dying one at a time. This isn't maintainable. I'm currently looking at the possibility of making an S3 image available on Amazon's EC. These are machines you can rent for ~10 cents an hour which is more than enough to build rxtx. The S3 image is not changed when people use it so everyone has the same starting point. With this, we could all build rxtx for ~20 platforms for a small price and eliminate tool issues. On Wed, 31 Oct 2007, Greg Johnson wrote: > 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 tjarvi at qbang.org Thu Nov 1 11:19:55 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:19:55 -0600 (MDT) 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: On Wed, 31 Oct 2007, 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. I was helping Dmitry do the Mac OS X port without access to a machine when we put that in. In the archives there is information (easily found with google on Apple's site) that describes how their API (and others) can determine if a port is used and ignore it. I think these changes are in CVS but need to confirm. The bottom line is that rxtx should not have used lock files on Mac. It was just ignorance of the system on my part. -- Trent Jarvi tjarvi at qbang.org From fabioanjos at gmail.com Thu Nov 1 12:35:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Thu, 1 Nov 2007 15:35:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Hi, I was using SerialEventListener in my project. But, as was said here, id doesnt work very well with virtual serial ports. So, I changed the strategy using the code posted here in this thread: try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > 0) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } The thing is that in my tests I could notice that in.read(buffer) never blocks. Even when there's nothing to read. Instead of blocking when there's nothing to read it returns 0. So, my questions are: 1. Am I doing something wrong? 2. If not, wouldnt this decrease performance? (the thread would be locked in a loop that does nothing.) 3. Is there a better way to do the job? Thanks in advance!! F?bio -------- On 10/31/07, Andre-John Mas wrote: > > > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/0aee59d0/attachment-0014.html From ajmas at sympatico.ca Thu Nov 1 16:07:55 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Nov 2007 18:07:55 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Message-ID: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From sarah_662005 at yahoo.com Thu Nov 1 17:10:05 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Thu, 1 Nov 2007 16:10:05 -0700 (PDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Message-ID: <351433.37166.qm@web55814.mail.re3.yahoo.com> Thank you very much for your help. Now the application works fine. the serialEvent gets triggered. Rxtx is cool! ----- Original Message ---- From: Andre-John Mas To: Sara Hugh ; RXTX Developers and Users Sent: Wednesday, October 31, 2007 9:55:45 AM Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered 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 __________________________________________________ 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/20071101/4a86bea6/attachment-0014.html From tjarvi at qbang.org Thu Nov 1 17:58:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 17:58:02 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx Message-ID: The rxtx.org site is primarily interested in the hobby aspects of rxtx. Obviously, there are some companies following the work too. These interests bring larger workflows and concerns about details hobby folks may not care about. They also bring many more users. I know the company I work for has a quality engineering effort going on which includes rxtx. While the server was down, I was contacted by another company that was missing the binaries for their testing. Several people have mentioned concerns about a stable release for like reasons. Would there be interest on the quality side of the coin to get together? It could be just sharing email's with each other or a seperate list for QE/QA. I can not say for sure, but we may be able to share some of our efforts/results that could help keep rxtx releases stable. -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Fri Nov 2 01:42:55 2007 From: scldad at sdc.com.au (Stephen Davies) Date: Fri, 2 Nov 2007 18:12:55 +1030 Subject: [Rxtx] Multiple modems Message-ID: <200711021812.56047.scldad@sdc.com.au> This may or may not be related to the Multiple Ports thread. I have an application which uses rxtx on Linux (via cron jobs) to connect multiple modems to remote sensing devices. The application works fine most of the time but occasionally fails to connect if two (or more) connection attempts happen at about the same time. When it fails, it looks as if it may get confused as to which port it is talking to. The app has a "base" component that looks for an available port, opens it and then creates an input thread and an output thread for the connection and data transfer. The "base" component uses this code: // loop round all known ports until one is available. Give up after three minutes Counter ptimeout = new Counter(); while(!portFound && ptimeout.elapsed() < 180000) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // special case. ttyS0 is not available to us on this server. if (!portId.isCurrentlyOwned() && !portId.getName().equals("/dev/ttyS0")) { gLog.debug(lognm + ": Found port " + portId.getName()); try { serialPort = (RXTXPort) portId.open("AguaModem", 10000); } catch (Exception e) { gLog.error(lognm + ": Port " + portId.getName() + " will not open."); gLog.error(e.getMessage()); continue; } AguaModem aguamodem = new AguaModem(); portFound = true; break; } gLog.debug(lognm + ": Port " + portId.getName() + " is busy"); } } } I am wondering about the isCurrentlyOwned method. Does this actually tell me whether a port is currently being used by another process? TIA, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From fabioanjos at gmail.com Fri Nov 2 04:59:58 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 07:59:58 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Message-ID: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/9009eb1d/attachment-0014.html From netbeans at gatworks.com Fri Nov 2 06:28:13 2007 From: netbeans at gatworks.com (U. George) Date: Fri, 02 Nov 2007 08:28:13 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <472B17DD.1050508@gatworks.com> It should normally block ( unless eof / event ) . so its a :{ whats the device ( to recreate if possible ) and how do u open. > My question is, is there a way to make in.read block the thead until > there's something to read? > From fabioanjos at gmail.com Fri Nov 2 06:34:46 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 09:34:46 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > On 11/1/07, Andre-John Mas wrote: > > > > Fabio, > > > > Turns out there was a small error in my example. The test should be: > > > > (numBytes = in.read(buffer)) > -1 > > > > This is because -1 indicates an end of file (end of data stream) > > > > Andre > > > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > > > Hi, > > > > > > I was using SerialEventListener in my project. But, as was said > > > here, id doesnt work very well with virtual serial ports. > > > So, I changed the strategy using the code posted here in this thread: > > > > > > try{ > > > in = port.getInputStream(); > > > out = port.getOutputStream(); > > > int numBytes = 0; > > > while(active){ > > > > > > byte[] buffer = new byte[10]; > > > > > > while ( (numBytes = in.read(buffer)) > 0) > > > { > > > String dataValue = new String(buffer,0,numBytes); > > > processInput(dataValue); > > > } > > > > > > if(numBytes==-1){ > > > break; > > > } > > > > > > Thread.sleep(50); > > > } > > > > > > }catch(IOException e){ > > > logger.info("falha de comunicacao "+ > > > getReceptor().getPort() ); > > > > > > }catch(InterruptedException e){ > > > logger.info ("Interrompendo leitura da porta "+ > > > getReceptor().getPort() ); > > > } > > > > > > The thing is that in my tests I could notice that in.read(buffer) > > > never blocks. Even when there's nothing to read. Instead of blocking > > > when there's nothing to read it returns 0. > > > > > > So, my questions are: > > > > > > 1. Am I doing something wrong? > > > 2. If not, wouldnt this decrease performance? (the thread would be > > > locked in a loop that does nothing.) > > > 3. Is there a better way to do the job? > > > > > > Thanks in advance!! > > > > > > F?bio > > > -------- > > > > > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > > 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 > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > > > > > -- > > > Atenciosamente, > > > F?bio Cristiano dos Anjos > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/5306c4b1/attachment-0014.html From nick.circelli at infrasafe.com Fri Nov 2 07:01:17 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Fri, 2 Nov 2007 08:01:17 -0500 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com><29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com><90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca><29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Message-ID: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> I'm pretty sure that not blocking has to do with you virtual ports. Cause it should block. Maybe you should try: while ((numBytes = in.available()) > 0) { If (numBytes > buffer.length) { numBytes = buffer.length; // in case you have buffer overflow } numBytes = in.read(buffer, 0 , numBytes)); String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } Also, just for optimization, I'd move that byte[] buffer = new byte[10]; out of the while since you don't need to reallocate it every iteration. ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of F?bio Cristiano dos Anjos Sent: Friday, November 02, 2007 8:35 AM To: RXTX Developers and Users Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream (); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas < ajmas at sympatico.ca > wrote: Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info ("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Atenciosamente, F?bio Cristiano dos Anjos -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/4de7f6a3/attachment-0014.html From fabioanjos at gmail.com Fri Nov 2 07:36:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 10:36:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> Message-ID: <29788b250711020636q1588c88fgaa5e27f5504164fb@mail.gmail.com> Hi Nick, Actually, it doesnt block for physical ports too. And, the method avaiable does not block either, so when there's nothing avaiable the loop ends and the thread stops lintening to the port. But I did some more test with serialEventListener, and now its working. I realy dont know what I've done to get it working. I just start woking as soon as I decided to test it again. It was said here that serialEventListener is not reliable for virtual serial ports. Is there another way to read it, without compromising performance? Tanks again!! F?bio ------- On 11/2/07, Nick Circelli wrote: > > I'm pretty sure that not blocking has to do with you virtual ports. > Cause it should block. > > Maybe you should try: > > > > while ((numBytes = in.available()) > 0) > > { > > If (numBytes > buffer.length) { > > numBytes = buffer.length; // in case you have buffer overflow > > } > > numBytes = in.read(buffer, 0 , numBytes)); > > String dataValue = new String(buffer,0,numBytes,"ASCII"); > > processInput(dataValue); > > } > > > > Also, just for optimization, I'd move that byte[] buffer = new > byte[10]; > > out of the while since you don't need to reallocate it every iteration. > > > ------------------------------ > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On Behalf > Of *F?bio Cristiano dos Anjos > *Sent:* Friday, November 02, 2007 8:35 AM > *To:* RXTX Developers and Users > *Subject:* Re: [Rxtx] serialEvent(SerialPortEvent event) never be > triggered > > > > Hi, > > I think i missunderstand something here. > The code you post here was meant to be used inside serialEvent method, > right? > > The think is, that i cannot user SerialEventListener to read serial ports, > because i need to read virual serial ports and id does not behaves well, as > said here before. serialEvent is never triggered. > > So what I quit using SerialEventListener and created a thread to listen to > the port: > > public void run(){ > try{ > in = port.getInputStream(); > out = port.getOutputStream (); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new > String(buffer,0,numBytes,"ASCII"); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ getReceptor().getPort() > ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > } > > > So, the problem is that in.read(buffer) always returns 0 when there is > nothing to read, instead of blocking the flow, and the thread becames locked > in the loop. > > I hope you can help me solve this. > > Thanks in advance! > > F?bio > -------- > > On 11/2/07, *F?bio Cristiano dos Anjos* wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > > > On 11/1/07, *Andre-John Mas* < ajmas at sympatico.ca> wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info ("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/571df6ea/attachment-0013.html From tjarvi at qbang.org Fri Nov 2 08:32:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Nov 2007 08:32:15 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: References: Message-ID: On Fri, 2 Nov 2007, Greg Johnson wrote: > Hi Trent, folks, > Having a single rxtx that is suitable for commercial uses and hobbyists both > would be a great idea? Perhaps it would be worth submitting rxtx as a > proposal to Codehaus - they not only provide excellent tools (Jira (bug > tracker), Confluence (wiki)) but also support build management ( > maestro, continuum, bamboo). Relying on your personal machine (btw, frii.com > / rxtx.org is down again?) seems like a burden you shouldn't have to shoulder > alone. Hi Greg, There may be a little confusion here. There is no need to have two seperate rxtx releases. What I'm trying to encourage is a discussion between some of the people responsible for making sure rxtx does not break their products each release. Usually these people are interested in testing a set of functionality their product depends upon. They do not work with rxtx code but rather traps to catch when rxtx developers break something. This goes on all the time in isolated labs. There are many services that offer to do various pieces of a project for you if you... Anyone is free to do the 'if you' portion with rxtx and see how it goes. I'm actually interested in doing less of that than more. The rxtx.org work I do just happens to overlap with other things I do for personal/family use. The reason I suggest the amazon solution is that anyone can take full control of the environment for a day and it costs less than a package of gum without causing harm to what anyone else is doing. I assume the down question was with respect to a mod_security setting that has been resolved. If not, please post a url to the problem. -- Trent Jarvi tjarvi at qbang.org From nsayer at kfu.com Sat Nov 3 20:17:49 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 19:17:49 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? Message-ID: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Has anyone got RXTX working with an app under Leopard? My app hangs on port open (it works fine with Tiger). The relevant thread looks like this in the activity monitor: 1536 JVM_InvokeMethod 1536 0x48ccd0 1536 0x46f8a0 1536 0x4c3ff4 1536 0x4c4284 1536 0x357d160 1536 0x357faac 1536 Java_gnu_io_RXTXPort_open 1536 open $NOCANCEL$UNIX2003 1536 open $NOCANCEL$UNIX2003 From ajmas at sympatico.ca Sat Nov 3 22:02:04 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 00:02:04 -0400 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> RXTX works for me with Leopard. I am currently using it communicate with a Bluetooth GPS. What computer and device are you trying to use? Is the driver for your serial device compatible with MacOS X 10.5? Andre On 3-Nov-07, at 22:17 , Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From nsayer at kfu.com Sat Nov 3 22:17:47 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 21:17:47 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> Message-ID: <1720F723-3643-438C-B3AB-E09A67536977@kfu.com> On Nov 3, 2007, at 9:02 PM, Andre-John Mas wrote: > RXTX works for me with Leopard. I am currently using it communicate > with a Bluetooth GPS. > > What computer and device are you trying to use? Is the driver for > your serial device compatible with MacOS X 10.5? An Intel mac mini The FTDI USB serial driver an XMPCR, which is just a fancy serial controlled radio and an FTDI usb-to-serial chip I've successfully used the FTDI driver with another FTDI device in another context. > > > Andre > > On 3-Nov-07, at 22:17 , Nick Sayer wrote: > >> Has anyone got RXTX working with an app under Leopard? >> >> My app hangs on port open (it works fine with Tiger). The relevant >> thread looks like this in the activity monitor: >> >> 1536 JVM_InvokeMethod >> 1536 0x48ccd0 >> 1536 0x46f8a0 >> 1536 0x4c3ff4 >> 1536 0x4c4284 >> 1536 0x357d160 >> 1536 0x357faac >> 1536 >> Java_gnu_io_RXTXPort_open >> 1536 open >> $NOCANCEL$UNIX2003 >> 1536 open >> $NOCANCEL$UNIX2003 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From racecar at gmail.com Sat Nov 3 22:25:53 2007 From: racecar at gmail.com (Kevin Mateo Lim) Date: Sat, 3 Nov 2007 21:25:53 -0700 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: Message-ID: I am alternating between two errors. After i run the macosx_setup.command, "everyone" is set to Read only in /var/lock. I notice in the terminal that the group for these perms is _uucp, not uucp. In that state, I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 check_group_uucp(): error testing lock file creation Error details:Permission deniedcheck_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException : Error inside Serial.() at processing.serial.Serial.errorMessage(Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.( Serial.java:102) at Temporary_829_3245.setup(Temporary_829_3245.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java :690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) Then, I hand edit the "everyone" permissions for /var/lock/ to Read and Write (note /var/spool/uucp is Read/Write in all cases, and doesn't change). I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX uucp_lock() /var/lock/LK.003.009.000 is there gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException: Error inside Serial.() at processing.serial.Serial.errorMessage (Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.(Serial.java:102) at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java:690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) See here: http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071103/f1a2c467/attachment-0012.html From greg.johnson at manchester.ac.uk Sun Nov 4 02:31:13 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sun, 4 Nov 2007 10:31:13 +0100 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <28B5E0A0-0802-4C74-AC21-87ED35F3B9A2@manchester.ac.uk> Hi Nick, I also had problems initially with Leopard, but it was resolved by reinstalling the serial USB driver (FTDI in my case). The symptoms were a non-detection of any ports (but I twigged when I tried ZTerm and it had the same problem). Good luck! Cheers, greg PS I did a "Archive and install" which may be the reason my FTDI driver had disappeared - I don't think the driver has changed for 10.5 ------------------------------------------------------------------------- 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 4 Nov 2007, at 03:17, Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Sun Nov 4 13:01:12 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 15:01:12 -0500 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: Message-ID: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Hi, You will need to get the 2.1-8 code from CVS. See the FAQ for more information: http://rxtx.qbang.org/wiki/index.php/FAQ Andre On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > I am alternating between two errors. > > After i run the macosx_setup.command, "everyone" is set to Read only > in /var/lock. I notice in the terminal that the group for these > perms is _uucp, not uucp. > > In that state, I get this error: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > check_group_uucp(): error testing lock file creation Error > details:Permission deniedcheck_lock_status: No permission to create > lock file. > please see: How can I use Lock Files with rxtx? in INSTALL > gnu.io.PortInUseException: Unknown Application > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > java.lang.RuntimeException : Error inside Serial.() > > at processing.serial.Serial.errorMessage(Serial.java:583) > > at processing.serial.Serial.(Serial.java:148) > > at processing.serial.Serial.( Serial.java:102) > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > at processing.core.PApplet.run(PApplet.java:1556) > > at java.lang.Thread.run(Thread.java:613) > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > and Write (note /var/spool/uucp is Read/Write in all cases, and > doesn't change). I get this error: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > gnu.io.PortInUseException: Unknown Application > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > java.lang.RuntimeException: Error inside Serial.() > > at processing.serial.Serial.errorMessage (Serial.java:583) > > at processing.serial.Serial.(Serial.java:148) > > at processing.serial.Serial.(Serial.java:102) > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > at processing.core.PApplet.run(PApplet.java:1556) > > at java.lang.Thread.run(Thread.java:613) > > See here: > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From netbeans at gatworks.com Sun Nov 4 14:33:35 2007 From: netbeans at gatworks.com (U. George) Date: Sun, 04 Nov 2007 16:33:35 -0500 Subject: [Rxtx] #ifndef TIOCSERGETLSR Message-ID: <472E3AAF.7050709@gatworks.com> For Linux, it seems that you need the code for both *having* a TIOCSERGETLSR, and *not having* a TIOCSERGETLSR. Maybe the ioctl exists system wide, but not necessarily for the device driver itself ( always returns -1 ) . Are there systems that have a *functioning* TIOCSERGETLSR for all their devices? Then this would be the case where the "#ifndef TIOCSERGETLSR" directive could be useful is eliminating the unnecessary code and tests. And for those systems that dont have a TIOCSERGETLSR, then the code for TIOCSERGETLSR can be eliminated. It would be a simple case to have, as a foundation, all the code to simulate the missing TIOCSERGETLSR ioctl. If the system does have the ioctl, then that code can be ifdef'd in, and co-exist with the functionality of the code that simulates the missing TIOCSERGETLSR ioctl. From racecar at gmail.com Sun Nov 4 17:30:19 2007 From: racecar at gmail.com (Kevin Mateo Lim) Date: Sun, 4 Nov 2007 17:30:19 -0700 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: the README.OSX reads: Put libSerial.jnilib in the directory of the application (the JavaVM will find it there). Add RXTXComm.jar to the application classpath or include the classes in the application jar. (Some applications already include the RXTX classes in their application jar, in which case only the file libSerial.jnilib is required). I can't find libSerial.jnilib I put librxtxSerial.jnilib into my Processing /libraries/serial/library/ directory. Yet it still sees the old version: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 On 11/4/07, Andre-John Mas wrote: > > Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > 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/20071104/c0a83f91/attachment-0011.html From ajmas at sympatico.ca Sun Nov 4 17:41:47 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 19:41:47 -0500 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> If you are wanting it to be available for all applications, - for all users: /Library/Java/Extensions - for your user: ~/Library/Java/Extensions Or just for your application, then it should be in the same directory from which yo are launching your application. If you are getting the 2.1-8 source, then the library built is called: librxtxSerial.jnilib despite what the docs say. Andre On 4-Nov-07, at 19:30 , Kevin Mateo Lim wrote: > > the README.OSX reads: > Put > libSerial.jnilib > in the directory of the application (the JavaVM will find it there). > Add > RXTXComm.jar > to the application classpath or include the classes in the > application jar. > (Some applications already include the RXTX classes in their > application jar, > in which case only the file libSerial.jnilib is required). > > > I can't find libSerial.jnilib > I put librxtxSerial.jnilib into my Processing /libraries/serial/ > library/ directory. > > Yet it still sees the old version: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > On 11/4/07, Andre-John Mas wrote: Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial .(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay (PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > From bschlining at gmail.com Sun Nov 4 19:46:23 2007 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 4 Nov 2007 18:46:23 -0800 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> Message-ID: > > Or just for your application, then it should be in the same directory > from which yo are launching your application. Just wanted to add one more way of specifying the native lib location... If you don't want to define it globally by putting it in /Library/Java/Extensions (and you don't, it's a very very bad practice) you can also specify the location of the native library when starting the JVM by specifying the 'java.library.path' property. For example: java -Djava.library.path=/Path/To/Directory/With/RXTX/Library YourMainClass -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071104/c5af6980/attachment-0011.html From greg.johnson at manchester.ac.uk Mon Nov 5 01:39:02 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Mon, 5 Nov 2007 09:39:02 +0100 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: The 2.1-8 code reports 2.1-7, hence your (and my) confusion. But as long as you've removed all traces of the old library, it really _is_ 2.1-8. And if you specify the library path to the VM, don't make my mistake (on OSX at least) - you need to respecify the entire library path it had by default, as the command line argument replaces the path, rather than appending to it. 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 5 Nov 2007, at 01:30, Kevin Mateo Lim wrote: > > the README.OSX reads: > Put > libSerial.jnilib > in the directory of the application (the JavaVM will find it there). > Add > RXTXComm.jar > to the application classpath or include the classes in the > application jar. > (Some applications already include the RXTX classes in their > application jar, > in which case only the file libSerial.jnilib is required). > > > I can't find libSerial.jnilib > I put librxtxSerial.jnilib into my Processing /libraries/serial/ > library/ directory. > > Yet it still sees the old version: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > On 11/4/07, Andre-John Mas wrote: > Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial .(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay (PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > 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 HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071105/7f50506d/attachment-0011.html From cyrille.dumont at tatexpress.fr Mon Nov 5 05:46:03 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 05 Nov 2007 13:46:03 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: References: <472727F1.1000704@tatexpress.fr> Message-ID: <472F108B.2090101@tatexpress.fr> Thanks a lot for your solution ... but I'm not a expert in JAVA ... (sorry) For the moment I've this function : """ public void serialEvent(SerialPortEvent e) { StringBuffer inputBuffer = new StringBuffer(); int newData = 0; switch (e.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } //-- Manag. Data from Scanner this.MngDataScanner(inputBuffer.toString()); break; case SerialPortEvent.BI:; //-- Break Received } } """ How can I do what you write ? ( maybe a simple ex ? ) PS : I don't know the PDF417 size (could be, for example, 338 char, or 500 ... ; what I know is that it can't be more than 800 char) Thanks in advance. Best regards. Trent Jarvi a ?crit : > 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 Martin.Oberhuber at windriver.com Mon Nov 5 08:47:50 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 5 Nov 2007 16:47:50 +0100 Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> Hi Trent, are the interestes of hobbyists really so different from commercial ones? Both should be interested in high quality and innovation the like. I haven't seen too many Open Source projects from the "inside" but those that I have seen did not have separate mailing lists for quality/testing/qa versus innovation/development. What I have seen with the Open Source projects that one would call "successful" is a good deal of process around automated builds, automated unit tests, predictable release dates and milestones, and policies around commiting/contributing/reviewing changes. I think that all of these benefit commercial users and hobbyists the like. If you were just asking about who's interested in discussing changes to foster more quality, count me in. I'm just not sure whether discussing these on a separate mailing list or other channel is the right thing to do. Cheers, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From toupsz at cs.tamu.edu Tue Nov 6 14:27:04 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 15:27:04 -0600 Subject: [Rxtx] reading TTL level signals from serial? Message-ID: Dear RXTX community- I've been using RXTX to handle communicating with several hardware devices in Java (a GPS and some custom audio circuitry for my dissertation work). I have a new, high-accuracy GPS which only communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there any way to communicate with this device using RXTX, perhaps by modding the native code for Windows? If so, does anyone have any tips on how to do it? Has it perhaps already been done? Another option is for me to invert / amplify the signal in hardware, but this is difficult for me to pull off due to the sensitivity of the electronics involved...I'll likely end up using a much less accurate piece of equipment rather than go that far! If anyone could help out, I'd really appreciate it! Thanks! -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/b6c59c2b/attachment-0009.html From netbeans at gatworks.com Tue Nov 6 14:55:22 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 06 Nov 2007 16:55:22 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: Message-ID: <4730E2CA.3090009@gatworks.com> This is really a hardware issue. Is there any device ( ie the serial port ) on your computer that will accept the voltage signals ( and load ) that your device produces? Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it happen safely ( ie u dont cook the GPS device ) I have a new, high-accuracy GPS which only > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there > any way to communicate with this device using RXTX, From toupsz at cs.tamu.edu Tue Nov 6 15:14:01 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 16:14:01 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4730E2CA.3090009@gatworks.com> References: <4730E2CA.3090009@gatworks.com> Message-ID: Actually, the device runs over USB, but shows up as a virtual serial port and is outputting these signals. The software that comes with the device (a u-blox ANTARIS 4 eval kit) is able to communicate. RXTX is able to detect and properly configure the port, but does not get any of the data from it. :-/ It seems like there must be some way to do it (obviously, ublox knows how)... -Zach On Nov 6, 2007 3:55 PM, U. George wrote: > This is really a hardware issue. > Is there any device ( ie the serial port ) on your computer that will > accept the voltage signals ( and load ) that your device produces? > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it > happen safely ( ie u dont cook the GPS device ) > > > I have a new, high-accuracy GPS which only > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there > > any way to communicate with this device using RXTX, > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/15ae7a0b/attachment-0009.html From keithvz at verizon.net Tue Nov 6 16:16:55 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 06 Nov 2007 18:16:55 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> Message-ID: <4730F5E7.1030704@verizon.net> Zach Toups wrote: > On Nov 6, 2007 3:55 PM, U. George > wrote: > > This is really a hardware issue. > Is there any device ( ie the serial port ) on your computer that will > accept the voltage signals ( and load ) that your device produces? > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it > happen safely ( ie u dont cook the GPS device ) > > > I have a new, high-accuracy GPS which only > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is > there > > any way to communicate with this device using RXTX, > _______________________________________________ As UGeorge intimated, it's a hardware issue. If your device outputs TTL level voltages, and your USB to serial converter is RS-232, then you've got a physical hardware differences. Inverted leads and voltage issues are mainly the problem. MAXIM makes a neat little chip called the MAX233 (better than the 232, no extern caps required) You can't solve this in software. Now, there are TTL level compatible USB to serial converters available, I happen to be using one right now. This unit below is from a UK company (there might be sources in the US) http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm Parallax makes one that does 3.3 and 5v http://www.parallax.com/detail.asp?product_id=32201 (but only supports RX, TX, GND, AND DTR towards device) (i've tested a variant of the unit above, and it works with RXTX) In both cases, you'll need some creative wiring depending on the interface on your GPS. Hope this helps Keith From toupsz at cs.tamu.edu Tue Nov 6 16:53:01 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 17:53:01 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4730F5E7.1030704@verizon.net> References: <4730E2CA.3090009@gatworks.com> <4730F5E7.1030704@verizon.net> Message-ID: Yeah...I used an FTDI chip to handle USB/serial conversion on the audio equipment I built. I'm leery of trying to build a board for this ublox GPS due to all the grounding/shielding issues around it. Anyway, I apreciate the help...just sad that I can't handle the problem in software! Ublox did send me the source code for their USB drivers...but as a Java programmer, it's a bit tough for me to sort out. ;) Thanks again! -Zach On Nov 6, 2007 5:16 PM, Keith Monahan wrote: > Zach Toups wrote: > > > On Nov 6, 2007 3:55 PM, U. George > > wrote: > > > > This is really a hardware issue. > > Is there any device ( ie the serial port ) on your computer that > will > > accept the voltage signals ( and load ) that your device produces? > > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make > it > > happen safely ( ie u dont cook the GPS device ) > > > > > > I have a new, high-accuracy GPS which only > > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is > > there > > > any way to communicate with this device using RXTX, > > _______________________________________________ > > As UGeorge intimated, it's a hardware issue. > > If your device outputs TTL level voltages, and your USB to serial > converter is RS-232, then you've got a physical hardware differences. > Inverted leads and voltage issues are mainly the problem. MAXIM makes a > neat little chip called the MAX233 (better than the 232, no extern caps > required) > > You can't solve this in software. > > Now, there are TTL level compatible USB to serial converters available, > I happen to be using one right now. > > This unit below is from a UK company (there might be sources in the US) > > http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm > > Parallax makes one that does 3.3 and 5v > > http://www.parallax.com/detail.asp?product_id=32201 > (but only supports RX, TX, GND, AND DTR towards device) > > (i've tested a variant of the unit above, and it works with RXTX) > > In both cases, you'll need some creative wiring depending on the > interface on your GPS. > > Hope this helps > > Keith > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/06e88ad4/attachment-0009.html From netbeans at gatworks.com Tue Nov 6 17:14:01 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 06 Nov 2007 19:14:01 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> <4730F5E7.1030704@verizon.net> Message-ID: <47310349.5000406@gatworks.com> what gps chipset do u have? > Ublox did send me the source code for their USB drivers...but as a Java > programmer, it's a bit tough for me to sort out. ;) From Steffen.DETTMER at ingenico.com Wed Nov 7 03:10:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 7 Nov 2007 11:10:01 +0100 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> Message-ID: <20071107101000.GN10978@elberon.bln.de.ingenico.com> * Zach Toups wrote on Tue, Nov 06, 2007 at 16:14 -0600: > Actually, the device runs over USB, but shows up as a virtual > serial port and is outputting these signals. Ahh, so what you want is to use rxtx on the serial port that is created by the driver and mapped maybe as some COM8 or whatever? I this case then IMHO it would be no hardware question but maybe a problem in your application, or some driver or indeed a rxtx issue. > The software that > comes with the device (a u-blox ANTARIS 4 eval kit) is able to > communicate. Is it sure that this software is really using the virtual serial port and only this port? oki, Steffen -- About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Wed Nov 7 04:59:10 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 06:59:10 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <20071107101000.GN10978@elberon.bln.de.ingenico.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> Message-ID: <4731A88E.6080705@gatworks.com> >> The software that >> comes with the device (a u-blox ANTARIS 4 eval kit) is able to >> communicate. > > Is it sure that this software is really using the virtual serial > port and only this port? > I have tried to read the docs. I have yet to find any explanation on a (windoz) device driver for this device ( the usb device ). That magic is not explained. For a developer thats important magic. Maybe a call to their support team is in order? From netbeans at gatworks.com Wed Nov 7 05:01:38 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 07:01:38 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <20071107101000.GN10978@elberon.bln.de.ingenico.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> Message-ID: <4731A922.7@gatworks.com> Steffen DETTMER wrote: > * Zach Toups wrote on Tue, Nov 06, 2007 at 16:14 -0600: >> Actually, the device runs over USB, but shows up as a virtual BTW: it seems that I am not getting all the Rxtx mail. Is there still a problem? From toupsz at cs.tamu.edu Wed Nov 7 07:36:20 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Wed, 7 Nov 2007 08:36:20 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4731A88E.6080705@gatworks.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> <4731A88E.6080705@gatworks.com> Message-ID: When I emailed them about this issue, they sent me their WinCE drivers, which are apparently based on this open source driver: http://www.yetanotherhomepage.com/j7xx/j7xx.html?/j7xx/software/util/usbdriver.html These include srcdll, and x86 subfolders, though it's not 100% clear to me that these are useful. The ublox communication suite appears to only communicate with serial ports...I've communicated with the ublox on two different comm ports (one with the serial adapter plugged into the serial port, one with the main USB connection), as well as a Garmin bluetooth GPS (which comes up as a bluetooth serial device). I'm not well versed in code this close to the hardware, but it seems to me that if you're running a virtual serial port, then you're virtually controlling the "voltages" that come in on this "port"...so why would they be "ttl level"? :-/ Shouldn't the USB driver be able to interpret the signals in whatever way it wants and just supply software with the binary interpretation? Thanks for all the help, guys, it's really appreciated! -Zach On Nov 7, 2007 5:59 AM, U. George wrote: > > >> The software that > >> comes with the device (a u-blox ANTARIS 4 eval kit) is able to > >> communicate. > > > > Is it sure that this software is really using the virtual serial > > port and only this port? > > > > I have tried to read the docs. I have yet to find any explanation on a > (windoz) device driver for this device ( the usb device ). That magic > is not explained. For a developer thats important magic. Maybe a call > to their support team is in order? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071107/18a13314/attachment-0008.html From netbeans at gatworks.com Wed Nov 7 08:55:55 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 10:55:55 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> <4731A88E.6080705@gatworks.com> Message-ID: <4731E00B.9030902@gatworks.com> There are 2 components to talking to hardware. There is the electrical specification, and then there is the software specification. there is the rs232 specification, parallel port specification, and the USB electrical specification. Generally these are used to plug in the various devices, and hook up electrically. Then there is the software side. There is the device driver, a software component that sits somewhere in the kernel that handles the USB ( in your case ) controller. The device driver generally does not care about the electrical component. There are various chips that handle USB signals, and these chips have I/O addresses so that signals and data can be properly routed. There is also the side that communicates to the user via the COM port device-name. The device driver that you mentioned is for the "Support PL2303 serial chip". This device driver, which hopefully works, handles the USB chip, and eventually recognzes the gps device, and hopefully creates an COM port so the user can open up and communicate. These are a lot of "HOPES". Since u have the web address of the device driver, and developer, I would think that the developer, and any docs, might be better able to help u to first determine if the GPS device is recognized, and the COM port ( maybe its called by another name ) is created, as per documentation. > > These include srcdll, and x86 subfolders, though it's not 100% clear to > me that these are useful. From tjarvi at qbang.org Sat Nov 10 17:46:13 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Nov 2007 17:46:13 -0700 (MST) Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 5 Nov 2007, Oberhuber, Martin wrote: > Hi Trent, > > are the interestes of hobbyists really so different > from commercial ones? Both should be interested in > high quality and innovation the like. > > I haven't seen too many Open Source projects from the > "inside" but those that I have seen did not have > separate mailing lists for quality/testing/qa > versus innovation/development. > > What I have seen with the Open Source projects that > one would call "successful" is a good deal of > process around automated builds, automated unit > tests, predictable release dates and milestones, > and policies around commiting/contributing/reviewing > changes. > > I think that all of these benefit commercial users > and hobbyists the like. > > If you were just asking about who's interested in > discussing changes to foster more quality, count > me in. I'm just not sure whether discussing these > on a separate mailing list or other channel is the > right thing to do. > Hi Martin, There are two issues I'm thinking about. The first is the generic unit testing and quality initiatives required to move rxtx forward. The second is the inevitable fact that rxtx connects to external hardware. The discussion deals with a different set of problems. Here is a simple example of what I'm getting at. We have the capability of setting custom baud rates in rxtx. We may be interested in seeing regressions in rxtx, the C library or the kernel. Some people may be doing some tests with loopback connections. These will always work even if the baud rate is not set to the expected value. Some people may use null modems between two ports. This may be able to catch the problem but not always. Will the build machines be able to test this? (no - for a few reasons) Will people be trying to catch these type of regressions? (yes) What type of coverage does the community have in the end? (?) We could include the discussions in the same list or another equally open list that may be of interest to some folks that deal with these types of problems on a regular basis. -- Trent Jarvi tjarvi at qbang.org From timlow84 at gmail.com Mon Nov 12 00:31:17 2007 From: timlow84 at gmail.com (Timothy Low) Date: Mon, 12 Nov 2007 15:31:17 +0800 Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> Message-ID: <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> ---------- Forwarded message ---------- From: Timothy Low Date: Nov 12, 2007 3:02 PM Subject: Building RXTX From Source To: taj at www.linux.org.uk Cc: ferdinand.tang at tangs.net, Timothy Low , chweehuat.ng at tangs.net Hi Trent, I tried building RXTX from source, and I got this error. I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm trying to get the necessary ".so" files to use for my serial port communication through java. My linux kernal information is: *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 x86_64 x86_64 x86_64 GNU/Linux* I'll most glad if you can provide me some direction on this. Thanks ! ---------------- [root at smsgateway rxtx-2.0-7pre1]# ./configure checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu configure: WARNING: Trying libtool. If the following fails install libtool checking for gcc... gcc checking for C compiler default output... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking for ld used by GCC... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking for a sed that does not truncate output... /bin/sed checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking command to parse /usr/bin/nm -B output... ok checking how to run the C preprocessor... gcc -E checking for egrep... grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for ranlib... ranlib checking for strip... strip checking for objdir... .libs checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.lo... yes checking if gcc supports -fno-rtti -fno-exceptions... yes checking whether the linker (/usr/bin/ld) supports shared libraries... yes checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking dynamic linker characteristics... GNU/Linux ld.so checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no checking whether -lc should be explicitly linked in... no creating libtool checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking for style of include used by make... GNU checking dependency style of gcc... none checking fcntl.h usability... yes checking fcntl.h presence... yes checking for fcntl.h... yes checking sys/fcntl.h usability... yes checking sys/fcntl.h presence... yes checking for sys/fcntl.h... yes checking sys/file.h usability... yes checking sys/file.h presence... yes checking for sys/file.h... yes checking sys/time.h usability... yes checking sys/time.h presence... yes checking for sys/time.h... yes checking sys/signal.h usability... yes checking sys/signal.h presence... yes checking for sys/signal.h... yes checking signal.h usability... yes checking signal.h presence... yes checking for signal.h.. . yes checking termios.h usability... yes checking termios.h presence... yes checking for termios.h... yes checking asm/termbits.h usability... yes checking asm/termbits.h presence... yes checking for asm/termbits.h... yes checking grp.h usability... yes checking grp.h presence... yes checking for grp.h... yes checking pwd.h usability... yes checking pwd.h presence... yes checking for pwd.h... yes checking whether gcc needs -traditional... no checking whether to enable maintainer-specific portions of Makefiles... no /usr/java/jdk1.5.0_13 configure: WARNING: using JAVA_HOME environmental variable adjusted java.home is /usr/java/jdk1.5.0_13 checking os.name Linux checking os.arch i386 checking java.vendor Sun Microsystems Inc. checking java.version 1.5.0_13 checking os.version 2.6.18-8.el5xen comm.jar appears to be installed already. conftest.c: In function 'main': conftest.c:6: warning: incompatible implicit declaration of built-in function 'printf' conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:6: error: (Each undeclared identifier is reported only once conftest.c:6: error: for each function it appears in.) conftest.c:6: error: expected ')' before string constant conftest.c:7: warning: incompatible implicit declaration of built-in function 'exit' ./configure: line 9649: ./conftest: No such file or directory ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected conftest.c: In function 'main': conftest.c:5: warning: incompatible implicit declaration of built-in function 'printf' conftest.c:10: warning: incompatible implicit declaration of built-in function 'exit' configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status : config.h is unchanged config.status: executing depfiles commands [root at smsgateway rxtx-2.0-7pre1]# make install /usr/java/jdk1.5.0_13/bin/javac -classpath .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d /home/jboss/sources/rxtx- 2.0-7pre1/ -O /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java /home/jboss/sources/rxtx-2.0-7pre1/./src/UnSupportedLoggerException.java /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o /home/jboss/sources/rxtx-2.0-7pre1/x86_64-unknown-linux-gnu/SerialImp.lo /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'init_threads': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: cast from pointer to integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_nativeDrain': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: cast to pointer from integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'read_byte_array': /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: cast to pointer from integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_readArray': /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: comparison is always false due to limited range of data type /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_readTerminatedArray': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: comparison is always false due to limited range of data type mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial- 2.0.7pre1.* gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so -o .libs/librxtxSerial-2.0.7pre1.so (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.0.7pre1.so librxtxSerial.so) creating librxtxSerial.la (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la librxtxSerial.la) gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/ParallelImp.lo /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function 'Java_javax_comm_LPRPort_readArray': /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: comparison is always false due to limited range of data type rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* .libs/librxtxParallel-2.0.7pre1.* gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so -o .libs/librxtxParallel- 2.0.7pre1.so (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.0.7pre1.so librxtxParallel.so) creating librxtxParallel.la (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la librxtxParallel.la) make all-am make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' libtool: install: `x86_64-unknown-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 ------------- Regards, Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071112/27758c3c/attachment-0004.html From tjarvi at qbang.org Mon Nov 12 01:02:09 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Nov 2007 01:02:09 -0700 (MST) Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> Message-ID: On Mon, 12 Nov 2007, Timothy Low wrote: > > Hi Trent, Hi Tim, Comments are inline. As I mentioned off the list, rxtx 2.0 is on the edge of deprecation. We can get it working but this is not the path of least resistance for future work. You will probably need to bounce another round of questions off the list. The following is intended to isolate the problem. > > I tried building RXTX from source, and I got this error. > > > I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm trying > to get the necessary ".so" files to use for my serial port communication > through java. > My linux kernal information is: > > *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 x86_64 > x86_64 x86_64 GNU/Linux* > > I'll most glad if you can provide me some direction on this. Thanks ! > > ---------------- > [root at smsgateway rxtx-2.0-7pre1]# ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > checking for C compiler default output... a.out > checking whether the C compiler works... yes > checking whether we are cross compiling... no > checking for suffix of executables... > checking for suffix of object files... o > checking whether we are using the GNU C compiler... yes > checking whether gcc accepts -g... yes > checking for gcc option to accept ANSI C... none needed > checking for ld used by GCC... /usr/bin/ld > checking if the linker (/usr/bin/ld) is GNU ld... yes > checking for /usr/bin/ld option to reload object files... -r > checking for BSD-compatible nm... /usr/bin/nm -B > checking for a sed that does not truncate output... /bin/sed > checking whether ln -s works... yes > checking how to recognise dependent libraries... pass_all > checking command to parse /usr/bin/nm -B output... ok > checking how to run the C preprocessor... gcc -E > checking for egrep... grep -E > checking for ANSI C header files... yes > checking for sys/types.h... yes > checking for sys/stat.h... yes > checking for stdlib.h... yes > checking for string.h... yes > checking for memory.h... yes > checking for strings.h... yes > checking for inttypes.h... yes > checking for stdint.h... yes > checking for unistd.h... yes > checking dlfcn.h usability... yes > checking dlfcn.h presence... yes > checking for dlfcn.h... yes > checking for ranlib... ranlib > checking for strip... strip > checking for objdir... .libs > checking for gcc option to produce PIC... -fPIC > checking if gcc PIC flag -fPIC works... yes > checking if gcc static flag -static works... yes > checking if gcc supports -c -o file.o... yes > checking if gcc supports -c -o file.lo... yes > checking if gcc supports -fno-rtti -fno-exceptions... yes > checking whether the linker (/usr/bin/ld) supports shared libraries... yes > checking how to hardcode library paths into programs... immediate > checking whether stripping libraries is possible... yes > checking dynamic linker characteristics... GNU/Linux ld.so > checking if libtool supports shared libraries... yes > checking whether to build shared libraries... yes > checking whether to build static libraries... no > checking whether -lc should be explicitly linked in... no > creating libtool > checking for a BSD-compatible install... /usr/bin/install -c > checking whether build environment is sane... yes > checking for gawk... gawk > checking whether make sets $(MAKE)... yes > checking for style of include used by make... GNU > checking dependency style of gcc... none > checking fcntl.h usability... yes > checking fcntl.h presence... yes > checking for fcntl.h... yes > checking sys/fcntl.h usability... yes > checking sys/fcntl.h presence... yes > checking for sys/fcntl.h... yes > checking sys/file.h usability... yes > checking sys/file.h presence... yes > checking for sys/file.h... yes > checking sys/time.h usability... yes > checking sys/time.h presence... yes > checking for sys/time.h... yes > checking sys/signal.h usability... yes > checking sys/signal.h presence... yes > checking for sys/signal.h... yes > checking signal.h usability... yes > checking signal.h presence... yes > checking for signal.h.. . yes > checking termios.h usability... yes > checking termios.h presence... yes > checking for termios.h... yes > checking asm/termbits.h usability... yes > checking asm/termbits.h presence... yes > checking for asm/termbits.h... yes > checking grp.h usability... yes > checking grp.h presence... yes > checking for grp.h... yes > checking pwd.h usability... yes > checking pwd.h presence... yes > checking for pwd.h... yes > checking whether gcc needs -traditional... no > checking whether to enable maintainer-specific portions of Makefiles... no > /usr/java/jdk1.5.0_13 > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /usr/java/jdk1.5.0_13 > checking os.name Linux > checking os.arch i386 > checking java.vendor Sun Microsystems Inc. > checking java.version 1.5.0_13 > checking os.version 2.6.18-8.el5xen > comm.jar appears to be installed already. > conftest.c: In function 'main': > conftest.c:6: warning: incompatible implicit declaration of built-in > function 'printf' > conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:6: error: (Each undeclared identifier is reported only once > conftest.c:6: error: for each function it appears in.) > conftest.c:6: error: expected ')' before string constant This is an outdated kernel version check for when headers and kernels could cause problems for rxtx. If we made it past this, then you are OK. > conftest.c:7: warning: incompatible implicit declaration of built-in > function 'exit' > ./configure: line 9649: ./conftest: No such file or directory > ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected It blew up but continues.. > conftest.c: In function 'main': > conftest.c:5: warning: incompatible implicit declaration of built-in > function 'printf' > conftest.c:10: warning: incompatible implicit declaration of built-in > function 'exit' > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status : config.h is unchanged > config.status: executing depfiles commands > [root at smsgateway rxtx-2.0-7pre1]# make install > /usr/java/jdk1.5.0_13/bin/javac -classpath > .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d > /home/jboss/sources/rxtx- 2.0-7pre1/ -O > /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java > /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/UnSupportedLoggerException.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java > Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or > overrides a deprecated API. > Note: Recompile with -Xlint:deprecation for details. > /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* The java jar should be fine now. You may need to change the source files as mentioned below. > gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. > -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g > -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o > /home/jboss/sources/rxtx-2.0-7pre1/x86_64-unknown-linux-gnu/SerialImp.lo > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'init_threads': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: cast > from pointer to integer of different size > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_nativeDrain': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: cast to > pointer from integer of different size > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'read_byte_array': > /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: cast to > pointer from integer of different size As I recall, this was caused by pointers (now 64 bit rather than 32 bit) being stored in java ints (jints). I would look at the diff between the CVS 2.1 SerialImp.c and RXTXPort.java files against 2.0. We did fix those issues. You have a .so file but the different pointer sizes will cause runtime errors. > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_readArray': > /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: > comparison is always false due to limited range of data type > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_readTerminatedArray': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: > comparison is always false due to limited range of data type > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial- > 2.0.7pre1.* > gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so -o > .libs/librxtxSerial-2.0.7pre1.so > (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.0.7pre1.so > librxtxSerial.so) > creating librxtxSerial.la > (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la > librxtxSerial.la) > gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. > -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g > -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o > /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/ParallelImp.lo > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function > 'Java_javax_comm_LPRPort_readArray': > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: > comparison is always false due to limited range of data type > rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* > .libs/librxtxParallel-2.0.7pre1.* > gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so -o > .libs/librxtxParallel- 2.0.7pre1.so > (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.0.7pre1.so > librxtxParallel.so) > creating librxtxParallel.la > (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la > librxtxParallel.la) > make all-am > make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' > make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' > libtool: install: `x86_64-unknown-linux-gnu' must be an absolute directory > name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 A libtool change? Assuming you ran configure && make install in /home/jboss/sources/rxtx- 2.0-7pre1, libtool is looking for /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/.libs/librxtxSerial-2.0.7pre1.so. I think you have this? The file is just being copied to ~JAVA/jre/lib/$(JAVA_ARCH). -- Trent Jarvi tjarvi at qbang.org From sarah_662005 at yahoo.com Mon Nov 12 16:10:28 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Mon, 12 Nov 2007 15:10:28 -0800 (PST) Subject: [Rxtx] [urgent] device's power off detection Message-ID: <766782.10076.qm@web55803.mail.re3.yahoo.com> Hello all, I have a small application built on top of rxtx api. This application can retrieve the incoming data from a device through a port. The device can be powered off after the port get closed from the application. I have been trying a couple of hours to find a way to detect the power switching from device. If anyone knows how to handle it through rxtx, could you please give me a help? Thank you very much. r, Sara ____________________________________________________________________________________ Get easy, one-click access to your favorites. Make Yahoo! your homepage. http://www.yahoo.com/r/hs -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071112/4599f3ec/attachment-0003.html From netbeans at gatworks.com Mon Nov 12 17:52:22 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 12 Nov 2007 19:52:22 -0500 Subject: [Rxtx] [urgent] device's power off detection In-Reply-To: <766782.10076.qm@web55803.mail.re3.yahoo.com> References: <766782.10076.qm@web55803.mail.re3.yahoo.com> Message-ID: <4738F546.5010101@gatworks.com> Not sure what u are asking for. Are u asking for a way to detect if the device is OFF? Are u asking how to power off the device - via software ? Is it a Serial device? is it a parallel device? is it a usb device? Sara Hugh wrote: > Hello all, > I have a small application built on top of rxtx api. This application > can retrieve the incoming data from a device through a port. The device > can be powered off after the port get closed from the application. I > have been trying a couple of hours to find a way to detect the power > switching from device. If anyone knows how to handle it through rxtx, > could you please give me a help? Thank you very much. From tjarvi at qbang.org Mon Nov 12 22:48:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Nov 2007 22:48:11 -0700 (MST) Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711120225x562db8cbxb750767ade3b0d73@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> <900c6ba90711120031p66edc001ted76f7ba24e34b98@mail.gmail.com> <900c6ba90711120225x562db8cbxb750767ade3b0d73@mail.gmail.com> Message-ID: Hi Tim, The gnu.io namespace looks just like the javax.comm 2.0 namespace. There are additional (discouraged) undocumented methods in gnu.io that you need not use. We just used the different namespace to avoid poluting Sun's by mistake and to make sure we stayed off any potential licensing related radar. Usuaully, you just change your imports and make sure you do not use the javax.comm namespace for anything like exception handling. As I mentioned off the list, there are no issues with rxtx going through the JSR process to be more Sun friendly other than time. rxtx has no hidden intentions there; anything that does not work like CommAPI 2.0 documented is a bug. The reason we do not support CommAPI 2.1 is technical in nature and is in the list archives as well as the front page of www.rxtx.org. On Mon, 12 Nov 2007, Timothy Low wrote: > Hi Trent, > > I'll move to use a JDK1.5 64-bit version... but do I need to make any source > code changes to use the package (gnu.io) in the RTXTcomm.jar instead of the > ones from the javacomm api ? > > > Regards, > Tim > > On Nov 12, 2007 5:22 PM, Trent Jarvi wrote: > >> >> Hi Tim, >> >> I see a couple things here. >> >> First your jdk is for i686 yet the library is compiled on a x86_64 >> machine. You may try passing configure the --target=i686-unknown-linux to >> try using the i686 backend to gcc if it is available. Or move to the 64 >> bit jdk. >> >> The other error I see is again the moved UTF_RELEASE define that we need >> to fix. You can probably get around that with: >> >> make -DUTF_RELEASE=`uname -r` >> >> even more simple would be to just specify the serial library which should >> be in configure --help. >> >> You can remove the UTF_RELEASE check from configure by editing >> configure.in, searching for the simple C program check and deleting it. >> Running autoconf after that will regenerate a new configure without the >> check. >> >> Note that you should remove the previous native libraries >> (librxtxSerial.so) when moving from rxtx 2.0 to 2.1. These are compiled >> for different namespaces (javax.comm/gnu.io). >> >> On Mon, 12 Nov 2007, Timothy Low wrote: >> >>> *Hi Trent, >>> >>> I moved on to rxtx 2.1.7r2, and updated my jre to 1.6.0 (64-bit)... I >> tried >>> the following 2 methods: >>> >>> (1) using the rxtx 2.1.7 binaries from the RXTX website* >>> *Are these binaries suitable for a 64-bit OS ? There mentioning of the >>> gnu.io that you've talked about previously...* >>> ------ >>> [root at smsgateway sources]# java -Djava.library.path=/usr/lib PortLister >>> Experimental: JNI_OnLoad called. >>> >>> java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion >>> ()Ljava/lang/String; >>> at gnu.io.RXTXCommDriver.nativeGetVersion(Native Method) >>> at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:85) >>> at java.lang.Class.forName0(Native Method) >>> at java.lang.Class.forName(Unknown Source) >>> at javax.comm.CommPortIdentifier.loadDriver( >> CommPortIdentifier.java >>> :237) >>> at javax.comm.CommPortIdentifier.(CommPortIdentifier.java >>> :109) >>> at PortLister.(PortLister.java:6) >>> at PortLister.main(PortLister.java:25) >>> Exception in thread "main" java.lang.UnsatisfiedLinkError: >>> com.sun.comm.SunrayInfo.isSessionActive()Z >>> at com.sun.comm.SunrayInfo.isSessionActive(Native Method) >>> at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java >> :155) >>> at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java >>> :100) >>> at javax.comm.CommPortIdentifier.(CommPortIdentifier.java >>> :138) >>> at PortLister.(PortLister.java:6) >>> at PortLister.main(PortLister.java:25) >>> >>> ------ >>> >>> (2) compiling the rxtx 2.1.7 from source >>> *but i got the following error while running ./configure and make all* >>> >>> ------ >>> [root at smsgateway rxtx-2.1-7r2]# ./configure >>> checking build system type... x86_64-unknown-linux-gnu >>> checking host system type... x86_64-unknown-linux-gnu >>> checking target system type... x86_64-unknown-linux-gnu >>> configure: WARNING: Trying libtool. If the following fails install >> libtool >>> checking for gcc... gcc >>> checking for C compiler default output file name... a.out >>> checking whether the C compiler works... yes >>> checking whether we are cross compiling... no >>> checking for suffix of executables... >>> checking for suffix of object files... o >>> checking whether we are using the GNU C compiler... yes >>> checking whether gcc accepts -g... yes >>> checking for gcc option to accept ANSI C... none needed >>> checking for a sed that does not truncate output... /bin/sed >>> checking for egrep... grep -E >>> checking for ld used by gcc... /usr/bin/ld >>> checking if the linker (/usr/bin/ld) is GNU ld... yes >>> checking for /usr/bin/ld option to reload object files... -r >>> checking for BSD-compatible nm... /usr/bin/nm -B >>> checking whether ln -s works... yes >>> checking how to recognise dependent libraries... pass_all >>> checking how to run the C preprocessor... gcc -E >>> checking for ANSI C header files... yes >>> checking for sys/types.h... yes >>> checking for sys/stat.h... yes >>> checking for stdlib.h... yes >>> checking for string.h... yes >>> checking for memory.h... yes >>> checking for strings.h... yes >>> checking for inttypes.h... yes >>> checking for stdint.h... yes >>> checking for unistd.h... yes >>> checking dlfcn.h usability... yes >>> checking dlfcn.h presence... yes >>> checking for dlfcn.h... yes >>> checking for g++... g++ >>> checking whether we are using the GNU C++ compiler... yes >>> checking whether g++ accepts -g... yes >>> checking how to run the C++ preprocessor... g++ -E >>> checking for g77... no >>> checking for f77... no >>> checking for xlf... no >>> checking for frt... no >>> checking for pgf77... no >>> checking for fort77... no >>> checking for fl32... no >>> checking for af77... no >>> checking for f90... no >>> checking for xlf90... no >>> checking for pgf90... no >>> checking for epcf90... no >>> checking for f95... f95 >>> checking whether we are using the GNU Fortran 77 compiler... yes >>> checking whether f95 accepts -g... yes >>> checking the maximum length of command line arguments... 32768 >>> checking command to parse /usr/bin/nm -B output from gcc object... ok >>> checking for objdir... .libs >>> checking for ar... ar >>> checking for ranlib... ranlib >>> checking for strip... strip >>> checking if gcc static flag works... yes >>> checking if gcc supports -fno-rtti -fno-exceptions... no >>> checking for gcc option to produce PIC... -fPIC >>> checking if gcc PIC flag -fPIC works... yes >>> checking if gcc supports -c -o file.o... yes >>> checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking whether -lc should be explicitly linked in... no >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> checking if libtool supports shared libraries... yes >>> checking whether to build shared libraries... yes >>> checking whether to build static libraries... no >>> configure: creating libtool >>> appending configuration tag "CXX" to libtool >>> checking for ld used by g++... /usr/bin/ld -m elf_x86_64 >>> checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes >>> checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking for g++ option to produce PIC... -fPIC >>> checking if g++ PIC flag -fPIC works... yes >>> checking if g++ supports -c -o file.o... yes >>> checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> appending configuration tag "F77" to libtool >>> checking if libtool supports shared libraries... yes >>> checking whether to build shared libraries... yes >>> checking whether to build static libraries... no >>> checking for f95 option to produce PIC... -fPIC >>> checking if f95 PIC flag -fPIC works... yes >>> checking if f95 supports -c -o file.o... yes >>> checking whether the f95 linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> checking for a BSD-compatible install... /usr/bin/install -c >>> checking whether build environment is sane... yes >>> checking for gawk... gawk >>> checking whether make sets $(MAKE)... yes >>> checking for style of include used by make... GNU >>> checking dependency style of gcc... none >>> checking dependency style of g++... none >>> checking fcntl.h usability... yes >>> checking fcntl.h presence... yes >>> checking for fcntl.h... yes >>> checking sys/fcntl.h usability... yes >>> checking sys/fcntl.h presence... yes >>> checking for sys/fcntl.h... yes >>> checking sys/file.h usability... yes >>> checking sys/file.h presence... yes >>> checking for sys/file.h... yes >>> checking sys/time.h usability... yes >>> checking sys/time.h presence... yes >>> checking for sys/time.h... yes >>> checking sys/signal.h usability... yes >>> checking sys/signal.h presence... yes >>> checking for sys/signal.h... yes >>> checking signal.h usability... yes >>> checking signal.h presence... yes >>> checking for signal.h... yes >>> checking termios.h usability... yes >>> checking termios.h presence... yes >>> checking for termios.h... yes >>> checking grp.h usability... yes >>> checking grp.h presence... yes >>> checking for grp.h... yes >>> checking pwd.h usability... yes >>> checking pwd.h presence... yes >>> checking for pwd.h... yes >>> checking whether gcc needs -traditional... no >>> checking whether to enable maintainer-specific portions of Makefiles... >> no >>> /usr/java/jdk1.5.0_13 >>> configure: WARNING: using JAVA_HOME environmental variable >>> adjusted java.home is /usr/java/jdk1.5.0_13 >>> checking os.name Linux >>> checking os.arch i386 >>> checking java.vendor Sun Microsystems Inc. >>> checking java.version 1.5.0_13 >>> checking os.version 2.6.18-8.el5xen >>> conftest.c: In function 'main': >>> conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this >> function) >>> conftest.c:8: error: (Each undeclared identifier is reported only once >>> conftest.c:8: error: for each function it appears in.) >>> conftest.c:8: error: expected ')' before string constant >>> ./configure: line 21462: ./conftest: No such file or directory >>> ./configure: line 21462: test: 2.6.18-8.el5xen: unary operator expected >>> configure: creating ./config.status >>> config.status: creating Makefile >>> config.status: creating config.h >>> config.status: executing depfiles commands >>> [root at smsgateway rxtx-2.1-7r2]# make install >>> /usr/java/jdk1.5.0_13/bin/javac -classpath .:/home/jboss/sources/rxtx- >>> >> 2.1-7r2:/home/jboss/sources/rxtx-2.1-7r2/src:/usr/java/jdk1.5.0_13/jre/lib/ext/RXTXcomm.jar-d >>> /home/jboss/sources/rxtx- >>> 2.1-7r2/ -O -source 1.3 -target 1.3 >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommDriver.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortEnumerator.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortIdentifier.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortOwnershipListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Configure.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2C.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/I2CPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/LPRPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/NoSuchPortException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/PortInUseException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Raw.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/RawPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RawPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RawPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/RS485PortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485PortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485Port.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXCommDriver.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXVersion.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPort.java >>> /home/jboss/sources/rxtx-2.1-7r2 >> /./src/UnsupportedCommOperationException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/UnSupportedLoggerException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Zystem.java >>> /usr/java/jdk1.5.0_13/bin/javah -classpath .:/home/jboss/sources/rxtx- >>> >> 2.1-7r2:/home/jboss/sources/rxtx-2.1-7r2/src:/usr/java/jdk1.5.0_13/jre/lib/ext/RXTXcomm.jar-d >>> x86_64-unknown-linux-gnu -jni `(for i in CommDriver CommPortEnumerator >>> CommPortIdentifier CommPort CommPortOwnershipListener Configure I2C >>> I2CPortEvent I2CPortEventListener I2CPort LPRPort NoSuchPortException >>> ParallelPortEvent ParallelPortEventListener ParallelPort >> PortInUseException >>> Raw RawPortEvent RawPortEventListener RawPort RS485 RS485PortEvent >>> RS485PortEventListener RS485Port RXTXCommDriver RXTXPort RXTXVersion >>> SerialPortEvent SerialPortEventListener SerialPort >>> UnsupportedCommOperationException UnSupportedLoggerException Zystem;do \ >>> if grep > /dev/null native.*\( /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/$i.java; then \ >>> echo gnu.io.$i; \ >>> fi; \ >>> done)` >>> /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialImp.c -o >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo; >>> \ >>> if [ "Serial" = "Serial" ]; >>> then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxSerial.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxSerial.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo; >> \ >>> fi; \ >>> ) >>> mkdir /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/.libs >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/SerialImp.o >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/fuserImp.o >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c: In function >> 'show_user': >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c:238: warning: cast >> from >>> pointer to integer of different size >>> gcc -shared /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/SerialImp.o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/fuserImp.o >>> -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7.so -o >> .libs/librxtxSerial- >>> 2.1-7.so >>> (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.1-7.so >>> librxtxSerial.so) >>> creating librxtxSerial.la >>> (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la >>> librxtxSerial.la) >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelImp.c -o >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/ParallelImp.lo; >>> \ >>> if [ "Parallel" = "Serial" ]; >>> then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxParallel.la -rpath >>> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/ParallelImp.lo >>> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxParallel.la -rpath >>> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/ParallelImp.lo; >>> \ >>> fi; \ >>> ) >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >>> /x86_64-unknown-linux-gnu/.libs/ParallelImp.o >>> gcc -shared /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/ParallelImp.o >>> -lpthread -Wl,-soname -Wl,librxtxParallel-2.1-7.so -o >>> .libs/librxtxParallel-2.1-7.so >>> (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.1-7.so >>> librxtxParallel.so) >>> creating librxtxParallel.la >>> (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la >>> librxtxParallel.la) >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo; >>> \ >>> if [ "I2C" = "Serial" ]; then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxI2C.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo >>> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxI2C.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo; >>> \ >>> fi; \ >>> ) >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/.libs/I2CImp.o >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c: In function >>> 'Java_gnu_io_I2CPort_Initialize': >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: 'UTS_RELEASE' >>> undeclared (first use in this function) >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: (Each >> undeclared >>> identifier is reported only once >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: for each >> function >>> it appears in.) >>> libtool: link: `/home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/I2CImp.lo' >>> is not a valid libtool object >>> make: *** [x86_64-unknown-linux-gnu/librxtxI2C.la] Error 1 >>> >>> ------ >>> >>> >>> >>> On Nov 12, 2007 4:02 PM, Trent Jarvi wrote: >>> >>>> On Mon, 12 Nov 2007, Timothy Low wrote: >>>>> >>>>> Hi Trent, >>>> >>>> Hi Tim, >>>> >>>> Comments are inline. As I mentioned off the list, rxtx 2.0 is on the >> edge >>>> of deprecation. We can get it working but this is not the path of >> least >>>> resistance for future work. >>>> >>>> You will probably need to bounce another round of questions off the >> list. >>>> The following is intended to isolate the problem. >>>> >>>>> >>>>> I tried building RXTX from source, and I got this error. >>>>> >>>>> >>>>> I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm >>>> trying >>>>> to get the necessary ".so" files to use for my serial port >> communication >>>>> through java. >>>>> My linux kernal information is: >>>>> >>>>> *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 >>>> x86_64 >>>>> x86_64 x86_64 GNU/Linux* >>>>> >>>>> I'll most glad if you can provide me some direction on this. Thanks ! >>>>> >>>>> ---------------- >>>>> [root at smsgateway rxtx-2.0-7pre1]# ./configure >>>>> checking build system type... x86_64-unknown-linux-gnu >>>>> checking host system type... x86_64-unknown-linux-gnu >>>>> checking target system type... x86_64-unknown-linux-gnu >>>>> configure: WARNING: Trying libtool. If the following fails install >>>> libtool >>>>> checking for gcc... gcc >>>>> checking for C compiler default output... a.out >>>>> checking whether the C compiler works... yes >>>>> checking whether we are cross compiling... no >>>>> checking for suffix of executables... >>>>> checking for suffix of object files... o >>>>> checking whether we are using the GNU C compiler... yes >>>>> checking whether gcc accepts -g... yes >>>>> checking for gcc option to accept ANSI C... none needed >>>>> checking for ld used by GCC... /usr/bin/ld >>>>> checking if the linker (/usr/bin/ld) is GNU ld... yes >>>>> checking for /usr/bin/ld option to reload object files... -r >>>>> checking for BSD-compatible nm... /usr/bin/nm -B >>>>> checking for a sed that does not truncate output... /bin/sed >>>>> checking whether ln -s works... yes >>>>> checking how to recognise dependent libraries... pass_all >>>>> checking command to parse /usr/bin/nm -B output... ok >>>>> checking how to run the C preprocessor... gcc -E >>>>> checking for egrep... grep -E >>>>> checking for ANSI C header files... yes >>>>> checking for sys/types.h... yes >>>>> checking for sys/stat.h... yes >>>>> checking for stdlib.h... yes >>>>> checking for string.h... yes >>>>> checking for memory.h... yes >>>>> checking for strings.h... yes >>>>> checking for inttypes.h... yes >>>>> checking for stdint.h... yes >>>>> checking for unistd.h... yes >>>>> checking dlfcn.h usability... yes >>>>> checking dlfcn.h presence... yes >>>>> checking for dlfcn.h... yes >>>>> checking for ranlib... ranlib >>>>> checking for strip... strip >>>>> checking for objdir... .libs >>>>> checking for gcc option to produce PIC... -fPIC >>>>> checking if gcc PIC flag -fPIC works... yes >>>>> checking if gcc static flag -static works... yes >>>>> checking if gcc supports -c -o file.o... yes >>>>> checking if gcc supports -c -o file.lo... yes >>>>> checking if gcc supports -fno-rtti -fno-exceptions... yes >>>>> checking whether the linker (/usr/bin/ld) supports shared libraries... >>>> yes >>>>> checking how to hardcode library paths into programs... immediate >>>>> checking whether stripping libraries is possible... yes >>>>> checking dynamic linker characteristics... GNU/Linux ld.so >>>>> checking if libtool supports shared libraries... yes >>>>> checking whether to build shared libraries... yes >>>>> checking whether to build static libraries... no >>>>> checking whether -lc should be explicitly linked in... no >>>>> creating libtool >>>>> checking for a BSD-compatible install... /usr/bin/install -c >>>>> checking whether build environment is sane... yes >>>>> checking for gawk... gawk >>>>> checking whether make sets $(MAKE)... yes >>>>> checking for style of include used by make... GNU >>>>> checking dependency style of gcc... none >>>>> checking fcntl.h usability... yes >>>>> checking fcntl.h presence... yes >>>>> checking for fcntl.h... yes >>>>> checking sys/fcntl.h usability... yes >>>>> checking sys/fcntl.h presence... yes >>>>> checking for sys/fcntl.h... yes >>>>> checking sys/file.h usability... yes >>>>> checking sys/file.h presence... yes >>>>> checking for sys/file.h... yes >>>>> checking sys/time.h usability... yes >>>>> checking sys/time.h presence... yes >>>>> checking for sys/time.h... yes >>>>> checking sys/signal.h usability... yes >>>>> checking sys/signal.h presence... yes >>>>> checking for sys/signal.h... yes >>>>> checking signal.h usability... yes >>>>> checking signal.h presence... yes >>>>> checking for signal.h.. . yes >>>>> checking termios.h usability... yes >>>>> checking termios.h presence... yes >>>>> checking for termios.h... yes >>>>> checking asm/termbits.h usability... yes >>>>> checking asm/termbits.h presence... yes >>>>> checking for asm/termbits.h... yes >>>>> checking grp.h usability... yes >>>>> checking grp.h presence... yes >>>>> checking for grp.h... yes >>>>> checking pwd.h usability... yes >>>>> checking pwd.h presence... yes >>>>> checking for pwd.h... yes >>>>> checking whether gcc needs -traditional... no >>>>> checking whether to enable maintainer-specific portions of >> Makefiles... >>>> no >>>>> /usr/java/jdk1.5.0_13 >>>>> configure: WARNING: using JAVA_HOME environmental variable >>>>> adjusted java.home is /usr/java/jdk1.5.0_13 >>>>> checking os.name Linux >>>>> checking os.arch i386 >>>>> checking java.vendor Sun Microsystems Inc. >>>>> checking java.version 1.5.0_13 >>>>> checking os.version 2.6.18-8.el5xen >>>>> comm.jar appears to be installed already. >>>>> conftest.c: In function 'main': >>>>> conftest.c:6: warning: incompatible implicit declaration of built-in >>>>> function 'printf' >>>>> conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this >>>> function) >>>>> conftest.c:6: error: (Each undeclared identifier is reported only once >>>>> conftest.c:6: error: for each function it appears in.) >>>>> conftest.c:6: error: expected ')' before string constant >>>> >>>> >>>> This is an outdated kernel version check for when headers and kernels >>>> could cause problems for rxtx. If we made it past this, then you are >> OK. >>>> >>>> >>>>> conftest.c:7: warning: incompatible implicit declaration of built-in >>>>> function 'exit' >>>>> ./configure: line 9649: ./conftest: No such file or directory >>>>> ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected >>>> >>>> It blew up but continues.. >>>> >>>>> conftest.c: In function 'main': >>>>> conftest.c:5: warning: incompatible implicit declaration of built-in >>>>> function 'printf' >>>>> conftest.c:10: warning: incompatible implicit declaration of built-in >>>>> function 'exit' >>>>> configure: creating ./config.status >>>>> config.status: creating Makefile >>>>> config.status: creating config.h >>>>> config.status : config.h is unchanged >>>>> config.status: executing depfiles commands >>>>> [root at smsgateway rxtx-2.0-7pre1]# make install >>>>> /usr/java/jdk1.5.0_13/bin/javac -classpath >>>>> .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/ -O >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1 >> /./src/UnSupportedLoggerException.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java >>>>> Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or >>>>> overrides a deprecated API. >>>>> Note: Recompile with -Xlint:deprecation for details. >>>>> /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* >>>> >>>> >>>> The java jar should be fine now. You may need to change the source >> files >>>> as mentioned below. >>>> >>>>> gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu >> -I. >>>>> -I/usr/java/jdk1.5.0_13/include >> -I/usr/java/jdk1.5.0_13/include/./linux/ >>>> -g >>>>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o >>>>> /home/jboss/sources/rxtx-2.0-7pre1 >> /x86_64-unknown-linux-gnu/SerialImp.lo >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'init_threads': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: >>>> cast >>>>> from pointer to integer of different size >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_nativeDrain': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: >>>> cast to >>>>> pointer from integer of different size >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'read_byte_array': >>>>> /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: >>>> cast to >>>>> pointer from integer of different size >>>> >>>> >>>> As I recall, this was caused by pointers (now 64 bit rather than 32 >> bit) >>>> being stored in java ints (jints). I would look at the diff between >> the >>>> CVS 2.1 SerialImp.c and RXTXPort.java files against 2.0. We >>>> did fix those issues. >>>> >>>> You have a .so file but the different pointer sizes will cause runtime >>>> errors. >>>> >>>> >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_readArray': >>>>> /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: >>>>> comparison is always false due to limited range of data type >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_readTerminatedArray': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: >>>>> comparison is always false due to limited range of data type >>>>> mkdir .libs >>>>> rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* >> .libs/librxtxSerial- >>>>> 2.0.7pre1.* >>>>> gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so-o >>>>> .libs/librxtxSerial-2.0.7pre1.so >>>>> (cd .libs && rm -f librxtxSerial.so && ln -s >> librxtxSerial-2.0.7pre1.so >>>>> librxtxSerial.so) >>>>> creating librxtxSerial.la >>>>> (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la >>>>> librxtxSerial.la) >>>>> gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu >> -I. >>>>> -I/usr/java/jdk1.5.0_13/include >> -I/usr/java/jdk1.5.0_13/include/./linux/ >>>> -g >>>>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o >>>>> /home/jboss/sources/rxtx- 2.0-7pre1 >>>> /x86_64-unknown-linux-gnu/ParallelImp.lo >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function >>>>> 'Java_javax_comm_LPRPort_readArray': >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: >>>>> comparison is always false due to limited range of data type >>>>> rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* >>>>> .libs/librxtxParallel-2.0.7pre1.* >>>>> gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so-o >>>>> .libs/librxtxParallel- 2.0.7pre1.so >>>>> (cd .libs && rm -f librxtxParallel.so && ln -s >>>> librxtxParallel-2.0.7pre1.so >>>>> librxtxParallel.so) >>>>> creating librxtxParallel.la >>>>> (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la >>>>> librxtxParallel.la) >>>>> make all-am >>>>> make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' >>>>> make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' >>>>> libtool: install: `x86_64-unknown-linux-gnu' must be an absolute >>>> directory >>>>> name >>>>> Try `libtool --help --mode=install' for more information. >>>>> make: *** [install] Error 1 >>>> >>>> A libtool change? Assuming you ran configure && make install in >>>> /home/jboss/sources/rxtx- 2.0-7pre1, libtool is looking for >>>> /home/jboss/sources/rxtx- >>>> 2.0-7pre1/x86_64-unknown-linux-gnu/.libs/librxtxSerial-2.0.7pre1.so. >>>> >>>> I think you have this? The file is just being copied to >>>> ~JAVA/jre/lib/$(JAVA_ARCH). >>>> >>>> -- >>>> Trent Jarvi >>>> tjarvi at qbang.org >>>> >>> >> > From guido.vogt at celsi.ch Tue Nov 13 00:28:01 2007 From: guido.vogt at celsi.ch (Guido Vogt) Date: Tue, 13 Nov 2007 08:28:01 +0100 Subject: [Rxtx] RTS Line can't be set Message-ID: <47395201.1050400@celsi.ch> I'm working on an Windows XP /SP2 System. Version of RXTX: 2.1.7. The serial line is connected to a modem. As I can see, the RTS-Line of the serial Port is inactive, when the port is opened (flowcontrol=none). Obviously, no data is coming from the modem. If I use the setRTS(true) command after open, the comport does not send out my data any more. This behaviour is regardless of flowcontrol. Anybody has an idea what do do? Thanks for help. From Martin.Oberhuber at windriver.com Tue Nov 13 08:58:23 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 13 Nov 2007 16:58:23 +0100 Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803880918@ism-mail03.corp.ad.wrs.com> Hi Trent, as said before, I like the idea of discussing such quality engineering issues, but why hide these away from the rest of the public? Anyways, if you do want to create a new mailing list for these kinds of things I'll happily subscribe. 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: Sunday, November 11, 2007 1:46 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: RE: [Rxtx] Quality Engineering with rxtx > > On Mon, 5 Nov 2007, Oberhuber, Martin wrote: > > > Hi Trent, > > > > are the interestes of hobbyists really so different > > from commercial ones? Both should be interested in > > high quality and innovation the like. > > > > I haven't seen too many Open Source projects from the > > "inside" but those that I have seen did not have > > separate mailing lists for quality/testing/qa > > versus innovation/development. > > > > What I have seen with the Open Source projects that > > one would call "successful" is a good deal of > > process around automated builds, automated unit > > tests, predictable release dates and milestones, > > and policies around commiting/contributing/reviewing > > changes. > > > > I think that all of these benefit commercial users > > and hobbyists the like. > > > > If you were just asking about who's interested in > > discussing changes to foster more quality, count > > me in. I'm just not sure whether discussing these > > on a separate mailing list or other channel is the > > right thing to do. > > > > Hi Martin, > > There are two issues I'm thinking about. The first is the > generic unit > testing and quality initiatives required to move rxtx > forward. The second > is the inevitable fact that rxtx connects to external hardware. The > discussion deals with a different set of problems. > > Here is a simple example of what I'm getting at. > > We have the capability of setting custom baud rates in rxtx. > We may be > interested in seeing regressions in rxtx, the C library or > the kernel. > Some people may be doing some tests with loopback > connections. These will > always work even if the baud rate is not set to the expected > value. Some > people may use null modems between two ports. This may be > able to catch > the problem but not always. > > Will the build machines be able to test this? (no - for a few reasons) > Will people be trying to catch these type of regressions? (yes) > What type of coverage does the community have in the end? (?) > > We could include the discussions in the same list or another > equally open > list that may be of interest to some folks that deal with > these types of > problems on a regular basis. > > -- > Trent Jarvi > tjarvi at qbang.org > From toupsz at cs.tamu.edu Tue Nov 13 10:33:03 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 13 Nov 2007 11:33:03 -0600 Subject: [Rxtx] [urgent] device's power off detection In-Reply-To: <4738F546.5010101@gatworks.com> References: <766782.10076.qm@web55803.mail.re3.yahoo.com> <4738F546.5010101@gatworks.com> Message-ID: Lacking any other specification on it...but can you set up the device to notify your software when it turns off? Send a message or somesuch? Maybe it can signal using RTS or DTR? -Zach On Nov 12, 2007 6:52 PM, U. George wrote: > Not sure what u are asking for. Are u asking for a way to detect if the > device is OFF? Are u asking how to power off the device - via software ? > Is it a Serial device? > is it a parallel device? > is it a usb device? > > Sara Hugh wrote: > > Hello all, > > I have a small application built on top of rxtx api. This application > > can retrieve the incoming data from a device through a port. The device > > can be powered off after the port get closed from the application. I > > have been trying a couple of hours to find a way to detect the power > > switching from device. If anyone knows how to handle it through rxtx, > > could you please give me a help? Thank you very much. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071113/e5859e4d/attachment-0001.html From tjarvi at qbang.org Tue Nov 13 20:02:03 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 13 Nov 2007 20:02:03 -0700 (MST) Subject: [Rxtx] #ifndef TIOCSERGETLSR In-Reply-To: <472E3AAF.7050709@gatworks.com> References: <472E3AAF.7050709@gatworks.com> Message-ID: On Sun, 4 Nov 2007, U. George wrote: > For Linux, it seems that you need the code for both *having* a > TIOCSERGETLSR, and *not having* a TIOCSERGETLSR. Maybe the ioctl exists > system wide, but not necessarily for the device driver itself ( always > returns -1 ) . > > Are there systems that have a *functioning* TIOCSERGETLSR for all their > devices? Then this would be the case where the "#ifndef TIOCSERGETLSR" > directive could be useful is eliminating the unnecessary code and tests. > > And for those systems that dont have a TIOCSERGETLSR, then the code for > TIOCSERGETLSR can be eliminated. > > It would be a simple case to have, as a foundation, all the code to > simulate the missing TIOCSERGETLSR ioctl. If the system does have the > ioctl, then that code can be ifdef'd in, and co-exist with the > functionality of the code that simulates the missing TIOCSERGETLSR ioctl. > Ah, there is the post. Sorry I was on vacation. Hi George, Yes there are systems that have functioning TIOCSERGETLSR for all of their devices. These are machines that just use traditional UARTs. If you mean operating systems, then probably not. Let me explain a bit about the history of those #ifdefs to help clear up a mess. RXTX aims to follow POSIX. TIOCSERGETLSR turns out to not be POSIX at all as I understand. It isn't in BSD, Solaris, AIX or HP-UX. It certainly provides access to important information. I assumed it was standard when I coded rxtx on a Linux system. Ya, laugh. Then I looked at Win32.. Oh you are still laughing? ..I could not navigate msft's web site at the time [still can't really find anything today]. So google pointed me to someones 'reverse documentation' of the w32 API and an example msft put together back in the win3.0 days. It was enough but maybe not 100% correct. They covered overlapped IO which was important for events in rxtx. Looking at Win32 and Linux, it made sense to implement TIOCSERGETLSR for win32 with the way rxtx works. That was how things matched up. But when I got feedback about other systems, it didn't match up. When people used multiport cards with money saving designs in Linux, it didn't match up. And today, there are drivers for unusual serial ports that don't match up. Now we have some ugly logic that mostly works for most serial ports. It isn't right though. The important aspect of TIOSERGETLSR is knowing when the output is really gone. But POSIX tcdrain tells us the same thing. So there is logic in the ifdefs to match that up as you suggest. Perhaps a more formal solution along those lines would be worth looking into. I would suggest the roles should be switched though. We should use POSIX calls on all systems and hide things that don't work on everything like we have with other undocumented calls. TIOSERGETLSR is nice and would be great if it was standard. It isn't as far as I can tell. In the end, many people write Java code because they want portability. The TIOSERGETLSR does not really fit. In someways, this is limiting to the least common denominator which is Solaris if you have seen it's serial kernel driver code. -- Trent Jarvi tjarvi at qbang.org From keithvz at verizon.net Thu Nov 1 08:08:58 2007 From: keithvz at verizon.net (Keith) Date: Thu, 01 Nov 2007 10:08:58 -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: <4729DDFA.7080206@verizon.net> Trent Jarvi wrote: > 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? Well, I honestly don't know how all this fits together. I think it's just a matter of enabling the right flow control option within the standard serial framework to tell the device driver, "HEY START USING DTR/DSR FOR FLOW CONTROL." If what UGeorge said,(about that type of nitty-gritty lead control being done within the device driver), is true, then this confirms my suspicion. I tried narrowing down within the Linux drivers what you are looking for, but I can't entirely tell wth I'm looking at. (virtual com port drivers -- they are included compiled by default with Ubuntu, source included) http://www.ftdichip.com/Drivers/VCP/Linux/ftdi_sio.tar.gz Hahahaa, they make a reference to DTR flow control being supported but say (UGH) in parenthesis. You can also use their direct device driver library on Ubuntu -- libftd2xx.so.0.4.13. No source code. http://www.ftdichip.com/Drivers/D2XX/Linux/libftd2xx0.4.13.tar.gz In that case, you make a call to their FT_SetFlowControl() function. FT_STATUS FT_SetFlowControl (FT_HANDLE ftHandle, USHORT usFlowControl, UCHAR uXon,UCHAR uXoff) Parameters ftHandle Handle of the device. usFlowControl Must be one of FT_FLOW_NONE, FT_FLOW_RTS_CTS, ****FT_FLOW_DTR_DSR**** or FT_FLOW_XON_XOFF. uXon Character used to signal Xon. Only used if flow control is FT_FLOW_XON_XOFF. uXoff Character used to signal Xoff. Only used if flow control is FT_FLOW_XON_XOFF. This is from their programming guide http://www.ftdichip.com/Documents/ProgramGuides/D2XXPG34.pdf I actually want to take this a step further and say that I think the flow control is actually handled right on the device itself in hardware/firmware. It's enabled through the device driver, but I think the maintaining of buffers, asserting/deasserting of leads, etc is handled by the device. For the time being, I've switched to jd2xx, https://jd2xx.dev.java.net/ and http://bleyer.org/jd2xx/ These are Java wrappers for the device driver libraries. It allows almost direct access to the well-documented device drivers from Java. I hope this helps Keith From tjarvi at qbang.org Thu Nov 1 11:09:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:09:51 -0600 (MDT) 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: Hi Martin, What I usually have done is allow changes that do not impact working software including changes to methods not documented in CommAPI (which remain undocumented in rxtx) and fixes to known problems in the documented portions. That way if you use the documented API, the releases should only become better with time. If you use the undocumented portions, the behavior is not as predictable but open for improvement. On Wed, 31 Oct 2007, 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 >> > From tjarvi at qbang.org Thu Nov 1 11:15:52 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:15:52 -0600 (MDT) 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: I too use rxtx in commercial products. The problem I've been trying to address while bringing the server back was how to make it possible for hobby folks to build the same software as companies so we can move rxtx along a little faster. Exposing internal tools is not an option at this time, the public rxtx builds have been done on my home machine which has drives hanging out of it all over the place dying one at a time. This isn't maintainable. I'm currently looking at the possibility of making an S3 image available on Amazon's EC. These are machines you can rent for ~10 cents an hour which is more than enough to build rxtx. The S3 image is not changed when people use it so everyone has the same starting point. With this, we could all build rxtx for ~20 platforms for a small price and eliminate tool issues. On Wed, 31 Oct 2007, Greg Johnson wrote: > 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 tjarvi at qbang.org Thu Nov 1 11:19:55 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:19:55 -0600 (MDT) 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: On Wed, 31 Oct 2007, 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. I was helping Dmitry do the Mac OS X port without access to a machine when we put that in. In the archives there is information (easily found with google on Apple's site) that describes how their API (and others) can determine if a port is used and ignore it. I think these changes are in CVS but need to confirm. The bottom line is that rxtx should not have used lock files on Mac. It was just ignorance of the system on my part. -- Trent Jarvi tjarvi at qbang.org From fabioanjos at gmail.com Thu Nov 1 12:35:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Thu, 1 Nov 2007 15:35:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Hi, I was using SerialEventListener in my project. But, as was said here, id doesnt work very well with virtual serial ports. So, I changed the strategy using the code posted here in this thread: try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > 0) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } The thing is that in my tests I could notice that in.read(buffer) never blocks. Even when there's nothing to read. Instead of blocking when there's nothing to read it returns 0. So, my questions are: 1. Am I doing something wrong? 2. If not, wouldnt this decrease performance? (the thread would be locked in a loop that does nothing.) 3. Is there a better way to do the job? Thanks in advance!! F?bio -------- On 10/31/07, Andre-John Mas wrote: > > > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/0aee59d0/attachment-0015.html From ajmas at sympatico.ca Thu Nov 1 16:07:55 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Nov 2007 18:07:55 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Message-ID: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From sarah_662005 at yahoo.com Thu Nov 1 17:10:05 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Thu, 1 Nov 2007 16:10:05 -0700 (PDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Message-ID: <351433.37166.qm@web55814.mail.re3.yahoo.com> Thank you very much for your help. Now the application works fine. the serialEvent gets triggered. Rxtx is cool! ----- Original Message ---- From: Andre-John Mas To: Sara Hugh ; RXTX Developers and Users Sent: Wednesday, October 31, 2007 9:55:45 AM Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered 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 __________________________________________________ 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/20071101/4a86bea6/attachment-0015.html From tjarvi at qbang.org Thu Nov 1 17:58:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 17:58:02 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx Message-ID: The rxtx.org site is primarily interested in the hobby aspects of rxtx. Obviously, there are some companies following the work too. These interests bring larger workflows and concerns about details hobby folks may not care about. They also bring many more users. I know the company I work for has a quality engineering effort going on which includes rxtx. While the server was down, I was contacted by another company that was missing the binaries for their testing. Several people have mentioned concerns about a stable release for like reasons. Would there be interest on the quality side of the coin to get together? It could be just sharing email's with each other or a seperate list for QE/QA. I can not say for sure, but we may be able to share some of our efforts/results that could help keep rxtx releases stable. -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Fri Nov 2 01:42:55 2007 From: scldad at sdc.com.au (Stephen Davies) Date: Fri, 2 Nov 2007 18:12:55 +1030 Subject: [Rxtx] Multiple modems Message-ID: <200711021812.56047.scldad@sdc.com.au> This may or may not be related to the Multiple Ports thread. I have an application which uses rxtx on Linux (via cron jobs) to connect multiple modems to remote sensing devices. The application works fine most of the time but occasionally fails to connect if two (or more) connection attempts happen at about the same time. When it fails, it looks as if it may get confused as to which port it is talking to. The app has a "base" component that looks for an available port, opens it and then creates an input thread and an output thread for the connection and data transfer. The "base" component uses this code: // loop round all known ports until one is available. Give up after three minutes Counter ptimeout = new Counter(); while(!portFound && ptimeout.elapsed() < 180000) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // special case. ttyS0 is not available to us on this server. if (!portId.isCurrentlyOwned() && !portId.getName().equals("/dev/ttyS0")) { gLog.debug(lognm + ": Found port " + portId.getName()); try { serialPort = (RXTXPort) portId.open("AguaModem", 10000); } catch (Exception e) { gLog.error(lognm + ": Port " + portId.getName() + " will not open."); gLog.error(e.getMessage()); continue; } AguaModem aguamodem = new AguaModem(); portFound = true; break; } gLog.debug(lognm + ": Port " + portId.getName() + " is busy"); } } } I am wondering about the isCurrentlyOwned method. Does this actually tell me whether a port is currently being used by another process? TIA, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From fabioanjos at gmail.com Fri Nov 2 04:59:58 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 07:59:58 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Message-ID: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/9009eb1d/attachment-0015.html From netbeans at gatworks.com Fri Nov 2 06:28:13 2007 From: netbeans at gatworks.com (U. George) Date: Fri, 02 Nov 2007 08:28:13 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <472B17DD.1050508@gatworks.com> It should normally block ( unless eof / event ) . so its a :{ whats the device ( to recreate if possible ) and how do u open. > My question is, is there a way to make in.read block the thead until > there's something to read? > From fabioanjos at gmail.com Fri Nov 2 06:34:46 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 09:34:46 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > On 11/1/07, Andre-John Mas wrote: > > > > Fabio, > > > > Turns out there was a small error in my example. The test should be: > > > > (numBytes = in.read(buffer)) > -1 > > > > This is because -1 indicates an end of file (end of data stream) > > > > Andre > > > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > > > Hi, > > > > > > I was using SerialEventListener in my project. But, as was said > > > here, id doesnt work very well with virtual serial ports. > > > So, I changed the strategy using the code posted here in this thread: > > > > > > try{ > > > in = port.getInputStream(); > > > out = port.getOutputStream(); > > > int numBytes = 0; > > > while(active){ > > > > > > byte[] buffer = new byte[10]; > > > > > > while ( (numBytes = in.read(buffer)) > 0) > > > { > > > String dataValue = new String(buffer,0,numBytes); > > > processInput(dataValue); > > > } > > > > > > if(numBytes==-1){ > > > break; > > > } > > > > > > Thread.sleep(50); > > > } > > > > > > }catch(IOException e){ > > > logger.info("falha de comunicacao "+ > > > getReceptor().getPort() ); > > > > > > }catch(InterruptedException e){ > > > logger.info ("Interrompendo leitura da porta "+ > > > getReceptor().getPort() ); > > > } > > > > > > The thing is that in my tests I could notice that in.read(buffer) > > > never blocks. Even when there's nothing to read. Instead of blocking > > > when there's nothing to read it returns 0. > > > > > > So, my questions are: > > > > > > 1. Am I doing something wrong? > > > 2. If not, wouldnt this decrease performance? (the thread would be > > > locked in a loop that does nothing.) > > > 3. Is there a better way to do the job? > > > > > > Thanks in advance!! > > > > > > F?bio > > > -------- > > > > > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > > 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 > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > > > > > -- > > > Atenciosamente, > > > F?bio Cristiano dos Anjos > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/5306c4b1/attachment-0015.html From nick.circelli at infrasafe.com Fri Nov 2 07:01:17 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Fri, 2 Nov 2007 08:01:17 -0500 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com><29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com><90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca><29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Message-ID: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> I'm pretty sure that not blocking has to do with you virtual ports. Cause it should block. Maybe you should try: while ((numBytes = in.available()) > 0) { If (numBytes > buffer.length) { numBytes = buffer.length; // in case you have buffer overflow } numBytes = in.read(buffer, 0 , numBytes)); String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } Also, just for optimization, I'd move that byte[] buffer = new byte[10]; out of the while since you don't need to reallocate it every iteration. ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of F?bio Cristiano dos Anjos Sent: Friday, November 02, 2007 8:35 AM To: RXTX Developers and Users Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream (); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas < ajmas at sympatico.ca > wrote: Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info ("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Atenciosamente, F?bio Cristiano dos Anjos -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/4de7f6a3/attachment-0015.html From fabioanjos at gmail.com Fri Nov 2 07:36:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 10:36:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> Message-ID: <29788b250711020636q1588c88fgaa5e27f5504164fb@mail.gmail.com> Hi Nick, Actually, it doesnt block for physical ports too. And, the method avaiable does not block either, so when there's nothing avaiable the loop ends and the thread stops lintening to the port. But I did some more test with serialEventListener, and now its working. I realy dont know what I've done to get it working. I just start woking as soon as I decided to test it again. It was said here that serialEventListener is not reliable for virtual serial ports. Is there another way to read it, without compromising performance? Tanks again!! F?bio ------- On 11/2/07, Nick Circelli wrote: > > I'm pretty sure that not blocking has to do with you virtual ports. > Cause it should block. > > Maybe you should try: > > > > while ((numBytes = in.available()) > 0) > > { > > If (numBytes > buffer.length) { > > numBytes = buffer.length; // in case you have buffer overflow > > } > > numBytes = in.read(buffer, 0 , numBytes)); > > String dataValue = new String(buffer,0,numBytes,"ASCII"); > > processInput(dataValue); > > } > > > > Also, just for optimization, I'd move that byte[] buffer = new > byte[10]; > > out of the while since you don't need to reallocate it every iteration. > > > ------------------------------ > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On Behalf > Of *F?bio Cristiano dos Anjos > *Sent:* Friday, November 02, 2007 8:35 AM > *To:* RXTX Developers and Users > *Subject:* Re: [Rxtx] serialEvent(SerialPortEvent event) never be > triggered > > > > Hi, > > I think i missunderstand something here. > The code you post here was meant to be used inside serialEvent method, > right? > > The think is, that i cannot user SerialEventListener to read serial ports, > because i need to read virual serial ports and id does not behaves well, as > said here before. serialEvent is never triggered. > > So what I quit using SerialEventListener and created a thread to listen to > the port: > > public void run(){ > try{ > in = port.getInputStream(); > out = port.getOutputStream (); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new > String(buffer,0,numBytes,"ASCII"); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ getReceptor().getPort() > ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > } > > > So, the problem is that in.read(buffer) always returns 0 when there is > nothing to read, instead of blocking the flow, and the thread becames locked > in the loop. > > I hope you can help me solve this. > > Thanks in advance! > > F?bio > -------- > > On 11/2/07, *F?bio Cristiano dos Anjos* wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > > > On 11/1/07, *Andre-John Mas* < ajmas at sympatico.ca> wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info ("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/571df6ea/attachment-0014.html From tjarvi at qbang.org Fri Nov 2 08:32:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Nov 2007 08:32:15 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: References: Message-ID: On Fri, 2 Nov 2007, Greg Johnson wrote: > Hi Trent, folks, > Having a single rxtx that is suitable for commercial uses and hobbyists both > would be a great idea? Perhaps it would be worth submitting rxtx as a > proposal to Codehaus - they not only provide excellent tools (Jira (bug > tracker), Confluence (wiki)) but also support build management ( > maestro, continuum, bamboo). Relying on your personal machine (btw, frii.com > / rxtx.org is down again?) seems like a burden you shouldn't have to shoulder > alone. Hi Greg, There may be a little confusion here. There is no need to have two seperate rxtx releases. What I'm trying to encourage is a discussion between some of the people responsible for making sure rxtx does not break their products each release. Usually these people are interested in testing a set of functionality their product depends upon. They do not work with rxtx code but rather traps to catch when rxtx developers break something. This goes on all the time in isolated labs. There are many services that offer to do various pieces of a project for you if you... Anyone is free to do the 'if you' portion with rxtx and see how it goes. I'm actually interested in doing less of that than more. The rxtx.org work I do just happens to overlap with other things I do for personal/family use. The reason I suggest the amazon solution is that anyone can take full control of the environment for a day and it costs less than a package of gum without causing harm to what anyone else is doing. I assume the down question was with respect to a mod_security setting that has been resolved. If not, please post a url to the problem. -- Trent Jarvi tjarvi at qbang.org From nsayer at kfu.com Sat Nov 3 20:17:49 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 19:17:49 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? Message-ID: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Has anyone got RXTX working with an app under Leopard? My app hangs on port open (it works fine with Tiger). The relevant thread looks like this in the activity monitor: 1536 JVM_InvokeMethod 1536 0x48ccd0 1536 0x46f8a0 1536 0x4c3ff4 1536 0x4c4284 1536 0x357d160 1536 0x357faac 1536 Java_gnu_io_RXTXPort_open 1536 open $NOCANCEL$UNIX2003 1536 open $NOCANCEL$UNIX2003 From ajmas at sympatico.ca Sat Nov 3 22:02:04 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 00:02:04 -0400 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> RXTX works for me with Leopard. I am currently using it communicate with a Bluetooth GPS. What computer and device are you trying to use? Is the driver for your serial device compatible with MacOS X 10.5? Andre On 3-Nov-07, at 22:17 , Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From nsayer at kfu.com Sat Nov 3 22:17:47 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 21:17:47 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> Message-ID: <1720F723-3643-438C-B3AB-E09A67536977@kfu.com> On Nov 3, 2007, at 9:02 PM, Andre-John Mas wrote: > RXTX works for me with Leopard. I am currently using it communicate > with a Bluetooth GPS. > > What computer and device are you trying to use? Is the driver for > your serial device compatible with MacOS X 10.5? An Intel mac mini The FTDI USB serial driver an XMPCR, which is just a fancy serial controlled radio and an FTDI usb-to-serial chip I've successfully used the FTDI driver with another FTDI device in another context. > > > Andre > > On 3-Nov-07, at 22:17 , Nick Sayer wrote: > >> Has anyone got RXTX working with an app under Leopard? >> >> My app hangs on port open (it works fine with Tiger). The relevant >> thread looks like this in the activity monitor: >> >> 1536 JVM_InvokeMethod >> 1536 0x48ccd0 >> 1536 0x46f8a0 >> 1536 0x4c3ff4 >> 1536 0x4c4284 >> 1536 0x357d160 >> 1536 0x357faac >> 1536 >> Java_gnu_io_RXTXPort_open >> 1536 open >> $NOCANCEL$UNIX2003 >> 1536 open >> $NOCANCEL$UNIX2003 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From racecar at gmail.com Sat Nov 3 22:25:53 2007 From: racecar at gmail.com (Kevin Mateo Lim) Date: Sat, 3 Nov 2007 21:25:53 -0700 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: Message-ID: I am alternating between two errors. After i run the macosx_setup.command, "everyone" is set to Read only in /var/lock. I notice in the terminal that the group for these perms is _uucp, not uucp. In that state, I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 check_group_uucp(): error testing lock file creation Error details:Permission deniedcheck_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException : Error inside Serial.() at processing.serial.Serial.errorMessage(Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.( Serial.java:102) at Temporary_829_3245.setup(Temporary_829_3245.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java :690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) Then, I hand edit the "everyone" permissions for /var/lock/ to Read and Write (note /var/spool/uucp is Read/Write in all cases, and doesn't change). I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX uucp_lock() /var/lock/LK.003.009.000 is there gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException: Error inside Serial.() at processing.serial.Serial.errorMessage (Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.(Serial.java:102) at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java:690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) See here: http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071103/f1a2c467/attachment-0013.html From greg.johnson at manchester.ac.uk Sun Nov 4 02:31:13 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sun, 4 Nov 2007 10:31:13 +0100 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <28B5E0A0-0802-4C74-AC21-87ED35F3B9A2@manchester.ac.uk> Hi Nick, I also had problems initially with Leopard, but it was resolved by reinstalling the serial USB driver (FTDI in my case). The symptoms were a non-detection of any ports (but I twigged when I tried ZTerm and it had the same problem). Good luck! Cheers, greg PS I did a "Archive and install" which may be the reason my FTDI driver had disappeared - I don't think the driver has changed for 10.5 ------------------------------------------------------------------------- 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 4 Nov 2007, at 03:17, Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Sun Nov 4 13:01:12 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 15:01:12 -0500 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: Message-ID: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Hi, You will need to get the 2.1-8 code from CVS. See the FAQ for more information: http://rxtx.qbang.org/wiki/index.php/FAQ Andre On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > I am alternating between two errors. > > After i run the macosx_setup.command, "everyone" is set to Read only > in /var/lock. I notice in the terminal that the group for these > perms is _uucp, not uucp. > > In that state, I get this error: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > check_group_uucp(): error testing lock file creation Error > details:Permission deniedcheck_lock_status: No permission to create > lock file. > please see: How can I use Lock Files with rxtx? in INSTALL > gnu.io.PortInUseException: Unknown Application > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > java.lang.RuntimeException : Error inside Serial.() > > at processing.serial.Serial.errorMessage(Serial.java:583) > > at processing.serial.Serial.(Serial.java:148) > > at processing.serial.Serial.( Serial.java:102) > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > at processing.core.PApplet.run(PApplet.java:1556) > > at java.lang.Thread.run(Thread.java:613) > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > and Write (note /var/spool/uucp is Read/Write in all cases, and > doesn't change). I get this error: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > gnu.io.PortInUseException: Unknown Application > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > java.lang.RuntimeException: Error inside Serial.() > > at processing.serial.Serial.errorMessage (Serial.java:583) > > at processing.serial.Serial.(Serial.java:148) > > at processing.serial.Serial.(Serial.java:102) > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > at processing.core.PApplet.run(PApplet.java:1556) > > at java.lang.Thread.run(Thread.java:613) > > See here: > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From netbeans at gatworks.com Sun Nov 4 14:33:35 2007 From: netbeans at gatworks.com (U. George) Date: Sun, 04 Nov 2007 16:33:35 -0500 Subject: [Rxtx] #ifndef TIOCSERGETLSR Message-ID: <472E3AAF.7050709@gatworks.com> For Linux, it seems that you need the code for both *having* a TIOCSERGETLSR, and *not having* a TIOCSERGETLSR. Maybe the ioctl exists system wide, but not necessarily for the device driver itself ( always returns -1 ) . Are there systems that have a *functioning* TIOCSERGETLSR for all their devices? Then this would be the case where the "#ifndef TIOCSERGETLSR" directive could be useful is eliminating the unnecessary code and tests. And for those systems that dont have a TIOCSERGETLSR, then the code for TIOCSERGETLSR can be eliminated. It would be a simple case to have, as a foundation, all the code to simulate the missing TIOCSERGETLSR ioctl. If the system does have the ioctl, then that code can be ifdef'd in, and co-exist with the functionality of the code that simulates the missing TIOCSERGETLSR ioctl. From racecar at gmail.com Sun Nov 4 17:30:19 2007 From: racecar at gmail.com (Kevin Mateo Lim) Date: Sun, 4 Nov 2007 17:30:19 -0700 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: the README.OSX reads: Put libSerial.jnilib in the directory of the application (the JavaVM will find it there). Add RXTXComm.jar to the application classpath or include the classes in the application jar. (Some applications already include the RXTX classes in their application jar, in which case only the file libSerial.jnilib is required). I can't find libSerial.jnilib I put librxtxSerial.jnilib into my Processing /libraries/serial/library/ directory. Yet it still sees the old version: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 On 11/4/07, Andre-John Mas wrote: > > Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > 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/20071104/c0a83f91/attachment-0012.html From ajmas at sympatico.ca Sun Nov 4 17:41:47 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 19:41:47 -0500 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> If you are wanting it to be available for all applications, - for all users: /Library/Java/Extensions - for your user: ~/Library/Java/Extensions Or just for your application, then it should be in the same directory from which yo are launching your application. If you are getting the 2.1-8 source, then the library built is called: librxtxSerial.jnilib despite what the docs say. Andre On 4-Nov-07, at 19:30 , Kevin Mateo Lim wrote: > > the README.OSX reads: > Put > libSerial.jnilib > in the directory of the application (the JavaVM will find it there). > Add > RXTXComm.jar > to the application classpath or include the classes in the > application jar. > (Some applications already include the RXTX classes in their > application jar, > in which case only the file libSerial.jnilib is required). > > > I can't find libSerial.jnilib > I put librxtxSerial.jnilib into my Processing /libraries/serial/ > library/ directory. > > Yet it still sees the old version: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > On 11/4/07, Andre-John Mas wrote: Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial .(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay (PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > From bschlining at gmail.com Sun Nov 4 19:46:23 2007 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 4 Nov 2007 18:46:23 -0800 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> Message-ID: > > Or just for your application, then it should be in the same directory > from which yo are launching your application. Just wanted to add one more way of specifying the native lib location... If you don't want to define it globally by putting it in /Library/Java/Extensions (and you don't, it's a very very bad practice) you can also specify the location of the native library when starting the JVM by specifying the 'java.library.path' property. For example: java -Djava.library.path=/Path/To/Directory/With/RXTX/Library YourMainClass -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071104/c5af6980/attachment-0012.html From greg.johnson at manchester.ac.uk Mon Nov 5 01:39:02 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Mon, 5 Nov 2007 09:39:02 +0100 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: The 2.1-8 code reports 2.1-7, hence your (and my) confusion. But as long as you've removed all traces of the old library, it really _is_ 2.1-8. And if you specify the library path to the VM, don't make my mistake (on OSX at least) - you need to respecify the entire library path it had by default, as the command line argument replaces the path, rather than appending to it. 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 5 Nov 2007, at 01:30, Kevin Mateo Lim wrote: > > the README.OSX reads: > Put > libSerial.jnilib > in the directory of the application (the JavaVM will find it there). > Add > RXTXComm.jar > to the application classpath or include the classes in the > application jar. > (Some applications already include the RXTX classes in their > application jar, > in which case only the file libSerial.jnilib is required). > > > I can't find libSerial.jnilib > I put librxtxSerial.jnilib into my Processing /libraries/serial/ > library/ directory. > > Yet it still sees the old version: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > On 11/4/07, Andre-John Mas wrote: > Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial .(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay (PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > 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 HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071105/7f50506d/attachment-0012.html From cyrille.dumont at tatexpress.fr Mon Nov 5 05:46:03 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 05 Nov 2007 13:46:03 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: References: <472727F1.1000704@tatexpress.fr> Message-ID: <472F108B.2090101@tatexpress.fr> Thanks a lot for your solution ... but I'm not a expert in JAVA ... (sorry) For the moment I've this function : """ public void serialEvent(SerialPortEvent e) { StringBuffer inputBuffer = new StringBuffer(); int newData = 0; switch (e.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } //-- Manag. Data from Scanner this.MngDataScanner(inputBuffer.toString()); break; case SerialPortEvent.BI:; //-- Break Received } } """ How can I do what you write ? ( maybe a simple ex ? ) PS : I don't know the PDF417 size (could be, for example, 338 char, or 500 ... ; what I know is that it can't be more than 800 char) Thanks in advance. Best regards. Trent Jarvi a ?crit : > 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 Martin.Oberhuber at windriver.com Mon Nov 5 08:47:50 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 5 Nov 2007 16:47:50 +0100 Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> Hi Trent, are the interestes of hobbyists really so different from commercial ones? Both should be interested in high quality and innovation the like. I haven't seen too many Open Source projects from the "inside" but those that I have seen did not have separate mailing lists for quality/testing/qa versus innovation/development. What I have seen with the Open Source projects that one would call "successful" is a good deal of process around automated builds, automated unit tests, predictable release dates and milestones, and policies around commiting/contributing/reviewing changes. I think that all of these benefit commercial users and hobbyists the like. If you were just asking about who's interested in discussing changes to foster more quality, count me in. I'm just not sure whether discussing these on a separate mailing list or other channel is the right thing to do. Cheers, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From toupsz at cs.tamu.edu Tue Nov 6 14:27:04 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 15:27:04 -0600 Subject: [Rxtx] reading TTL level signals from serial? Message-ID: Dear RXTX community- I've been using RXTX to handle communicating with several hardware devices in Java (a GPS and some custom audio circuitry for my dissertation work). I have a new, high-accuracy GPS which only communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there any way to communicate with this device using RXTX, perhaps by modding the native code for Windows? If so, does anyone have any tips on how to do it? Has it perhaps already been done? Another option is for me to invert / amplify the signal in hardware, but this is difficult for me to pull off due to the sensitivity of the electronics involved...I'll likely end up using a much less accurate piece of equipment rather than go that far! If anyone could help out, I'd really appreciate it! Thanks! -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/b6c59c2b/attachment-0010.html From netbeans at gatworks.com Tue Nov 6 14:55:22 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 06 Nov 2007 16:55:22 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: Message-ID: <4730E2CA.3090009@gatworks.com> This is really a hardware issue. Is there any device ( ie the serial port ) on your computer that will accept the voltage signals ( and load ) that your device produces? Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it happen safely ( ie u dont cook the GPS device ) I have a new, high-accuracy GPS which only > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there > any way to communicate with this device using RXTX, From toupsz at cs.tamu.edu Tue Nov 6 15:14:01 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 16:14:01 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4730E2CA.3090009@gatworks.com> References: <4730E2CA.3090009@gatworks.com> Message-ID: Actually, the device runs over USB, but shows up as a virtual serial port and is outputting these signals. The software that comes with the device (a u-blox ANTARIS 4 eval kit) is able to communicate. RXTX is able to detect and properly configure the port, but does not get any of the data from it. :-/ It seems like there must be some way to do it (obviously, ublox knows how)... -Zach On Nov 6, 2007 3:55 PM, U. George wrote: > This is really a hardware issue. > Is there any device ( ie the serial port ) on your computer that will > accept the voltage signals ( and load ) that your device produces? > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it > happen safely ( ie u dont cook the GPS device ) > > > I have a new, high-accuracy GPS which only > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there > > any way to communicate with this device using RXTX, > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/15ae7a0b/attachment-0010.html From keithvz at verizon.net Tue Nov 6 16:16:55 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 06 Nov 2007 18:16:55 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> Message-ID: <4730F5E7.1030704@verizon.net> Zach Toups wrote: > On Nov 6, 2007 3:55 PM, U. George > wrote: > > This is really a hardware issue. > Is there any device ( ie the serial port ) on your computer that will > accept the voltage signals ( and load ) that your device produces? > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it > happen safely ( ie u dont cook the GPS device ) > > > I have a new, high-accuracy GPS which only > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is > there > > any way to communicate with this device using RXTX, > _______________________________________________ As UGeorge intimated, it's a hardware issue. If your device outputs TTL level voltages, and your USB to serial converter is RS-232, then you've got a physical hardware differences. Inverted leads and voltage issues are mainly the problem. MAXIM makes a neat little chip called the MAX233 (better than the 232, no extern caps required) You can't solve this in software. Now, there are TTL level compatible USB to serial converters available, I happen to be using one right now. This unit below is from a UK company (there might be sources in the US) http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm Parallax makes one that does 3.3 and 5v http://www.parallax.com/detail.asp?product_id=32201 (but only supports RX, TX, GND, AND DTR towards device) (i've tested a variant of the unit above, and it works with RXTX) In both cases, you'll need some creative wiring depending on the interface on your GPS. Hope this helps Keith From toupsz at cs.tamu.edu Tue Nov 6 16:53:01 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 17:53:01 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4730F5E7.1030704@verizon.net> References: <4730E2CA.3090009@gatworks.com> <4730F5E7.1030704@verizon.net> Message-ID: Yeah...I used an FTDI chip to handle USB/serial conversion on the audio equipment I built. I'm leery of trying to build a board for this ublox GPS due to all the grounding/shielding issues around it. Anyway, I apreciate the help...just sad that I can't handle the problem in software! Ublox did send me the source code for their USB drivers...but as a Java programmer, it's a bit tough for me to sort out. ;) Thanks again! -Zach On Nov 6, 2007 5:16 PM, Keith Monahan wrote: > Zach Toups wrote: > > > On Nov 6, 2007 3:55 PM, U. George > > wrote: > > > > This is really a hardware issue. > > Is there any device ( ie the serial port ) on your computer that > will > > accept the voltage signals ( and load ) that your device produces? > > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make > it > > happen safely ( ie u dont cook the GPS device ) > > > > > > I have a new, high-accuracy GPS which only > > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is > > there > > > any way to communicate with this device using RXTX, > > _______________________________________________ > > As UGeorge intimated, it's a hardware issue. > > If your device outputs TTL level voltages, and your USB to serial > converter is RS-232, then you've got a physical hardware differences. > Inverted leads and voltage issues are mainly the problem. MAXIM makes a > neat little chip called the MAX233 (better than the 232, no extern caps > required) > > You can't solve this in software. > > Now, there are TTL level compatible USB to serial converters available, > I happen to be using one right now. > > This unit below is from a UK company (there might be sources in the US) > > http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm > > Parallax makes one that does 3.3 and 5v > > http://www.parallax.com/detail.asp?product_id=32201 > (but only supports RX, TX, GND, AND DTR towards device) > > (i've tested a variant of the unit above, and it works with RXTX) > > In both cases, you'll need some creative wiring depending on the > interface on your GPS. > > Hope this helps > > Keith > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/06e88ad4/attachment-0010.html From netbeans at gatworks.com Tue Nov 6 17:14:01 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 06 Nov 2007 19:14:01 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> <4730F5E7.1030704@verizon.net> Message-ID: <47310349.5000406@gatworks.com> what gps chipset do u have? > Ublox did send me the source code for their USB drivers...but as a Java > programmer, it's a bit tough for me to sort out. ;) From Steffen.DETTMER at ingenico.com Wed Nov 7 03:10:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 7 Nov 2007 11:10:01 +0100 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> Message-ID: <20071107101000.GN10978@elberon.bln.de.ingenico.com> * Zach Toups wrote on Tue, Nov 06, 2007 at 16:14 -0600: > Actually, the device runs over USB, but shows up as a virtual > serial port and is outputting these signals. Ahh, so what you want is to use rxtx on the serial port that is created by the driver and mapped maybe as some COM8 or whatever? I this case then IMHO it would be no hardware question but maybe a problem in your application, or some driver or indeed a rxtx issue. > The software that > comes with the device (a u-blox ANTARIS 4 eval kit) is able to > communicate. Is it sure that this software is really using the virtual serial port and only this port? oki, Steffen -- About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Wed Nov 7 04:59:10 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 06:59:10 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <20071107101000.GN10978@elberon.bln.de.ingenico.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> Message-ID: <4731A88E.6080705@gatworks.com> >> The software that >> comes with the device (a u-blox ANTARIS 4 eval kit) is able to >> communicate. > > Is it sure that this software is really using the virtual serial > port and only this port? > I have tried to read the docs. I have yet to find any explanation on a (windoz) device driver for this device ( the usb device ). That magic is not explained. For a developer thats important magic. Maybe a call to their support team is in order? From netbeans at gatworks.com Wed Nov 7 05:01:38 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 07:01:38 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <20071107101000.GN10978@elberon.bln.de.ingenico.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> Message-ID: <4731A922.7@gatworks.com> Steffen DETTMER wrote: > * Zach Toups wrote on Tue, Nov 06, 2007 at 16:14 -0600: >> Actually, the device runs over USB, but shows up as a virtual BTW: it seems that I am not getting all the Rxtx mail. Is there still a problem? From toupsz at cs.tamu.edu Wed Nov 7 07:36:20 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Wed, 7 Nov 2007 08:36:20 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4731A88E.6080705@gatworks.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> <4731A88E.6080705@gatworks.com> Message-ID: When I emailed them about this issue, they sent me their WinCE drivers, which are apparently based on this open source driver: http://www.yetanotherhomepage.com/j7xx/j7xx.html?/j7xx/software/util/usbdriver.html These include srcdll, and x86 subfolders, though it's not 100% clear to me that these are useful. The ublox communication suite appears to only communicate with serial ports...I've communicated with the ublox on two different comm ports (one with the serial adapter plugged into the serial port, one with the main USB connection), as well as a Garmin bluetooth GPS (which comes up as a bluetooth serial device). I'm not well versed in code this close to the hardware, but it seems to me that if you're running a virtual serial port, then you're virtually controlling the "voltages" that come in on this "port"...so why would they be "ttl level"? :-/ Shouldn't the USB driver be able to interpret the signals in whatever way it wants and just supply software with the binary interpretation? Thanks for all the help, guys, it's really appreciated! -Zach On Nov 7, 2007 5:59 AM, U. George wrote: > > >> The software that > >> comes with the device (a u-blox ANTARIS 4 eval kit) is able to > >> communicate. > > > > Is it sure that this software is really using the virtual serial > > port and only this port? > > > > I have tried to read the docs. I have yet to find any explanation on a > (windoz) device driver for this device ( the usb device ). That magic > is not explained. For a developer thats important magic. Maybe a call > to their support team is in order? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071107/18a13314/attachment-0009.html From netbeans at gatworks.com Wed Nov 7 08:55:55 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 10:55:55 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> <4731A88E.6080705@gatworks.com> Message-ID: <4731E00B.9030902@gatworks.com> There are 2 components to talking to hardware. There is the electrical specification, and then there is the software specification. there is the rs232 specification, parallel port specification, and the USB electrical specification. Generally these are used to plug in the various devices, and hook up electrically. Then there is the software side. There is the device driver, a software component that sits somewhere in the kernel that handles the USB ( in your case ) controller. The device driver generally does not care about the electrical component. There are various chips that handle USB signals, and these chips have I/O addresses so that signals and data can be properly routed. There is also the side that communicates to the user via the COM port device-name. The device driver that you mentioned is for the "Support PL2303 serial chip". This device driver, which hopefully works, handles the USB chip, and eventually recognzes the gps device, and hopefully creates an COM port so the user can open up and communicate. These are a lot of "HOPES". Since u have the web address of the device driver, and developer, I would think that the developer, and any docs, might be better able to help u to first determine if the GPS device is recognized, and the COM port ( maybe its called by another name ) is created, as per documentation. > > These include srcdll, and x86 subfolders, though it's not 100% clear to > me that these are useful. From tjarvi at qbang.org Sat Nov 10 17:46:13 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Nov 2007 17:46:13 -0700 (MST) Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 5 Nov 2007, Oberhuber, Martin wrote: > Hi Trent, > > are the interestes of hobbyists really so different > from commercial ones? Both should be interested in > high quality and innovation the like. > > I haven't seen too many Open Source projects from the > "inside" but those that I have seen did not have > separate mailing lists for quality/testing/qa > versus innovation/development. > > What I have seen with the Open Source projects that > one would call "successful" is a good deal of > process around automated builds, automated unit > tests, predictable release dates and milestones, > and policies around commiting/contributing/reviewing > changes. > > I think that all of these benefit commercial users > and hobbyists the like. > > If you were just asking about who's interested in > discussing changes to foster more quality, count > me in. I'm just not sure whether discussing these > on a separate mailing list or other channel is the > right thing to do. > Hi Martin, There are two issues I'm thinking about. The first is the generic unit testing and quality initiatives required to move rxtx forward. The second is the inevitable fact that rxtx connects to external hardware. The discussion deals with a different set of problems. Here is a simple example of what I'm getting at. We have the capability of setting custom baud rates in rxtx. We may be interested in seeing regressions in rxtx, the C library or the kernel. Some people may be doing some tests with loopback connections. These will always work even if the baud rate is not set to the expected value. Some people may use null modems between two ports. This may be able to catch the problem but not always. Will the build machines be able to test this? (no - for a few reasons) Will people be trying to catch these type of regressions? (yes) What type of coverage does the community have in the end? (?) We could include the discussions in the same list or another equally open list that may be of interest to some folks that deal with these types of problems on a regular basis. -- Trent Jarvi tjarvi at qbang.org From timlow84 at gmail.com Mon Nov 12 00:31:17 2007 From: timlow84 at gmail.com (Timothy Low) Date: Mon, 12 Nov 2007 15:31:17 +0800 Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> Message-ID: <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> ---------- Forwarded message ---------- From: Timothy Low Date: Nov 12, 2007 3:02 PM Subject: Building RXTX From Source To: taj at www.linux.org.uk Cc: ferdinand.tang at tangs.net, Timothy Low , chweehuat.ng at tangs.net Hi Trent, I tried building RXTX from source, and I got this error. I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm trying to get the necessary ".so" files to use for my serial port communication through java. My linux kernal information is: *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 x86_64 x86_64 x86_64 GNU/Linux* I'll most glad if you can provide me some direction on this. Thanks ! ---------------- [root at smsgateway rxtx-2.0-7pre1]# ./configure checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu configure: WARNING: Trying libtool. If the following fails install libtool checking for gcc... gcc checking for C compiler default output... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking for ld used by GCC... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking for a sed that does not truncate output... /bin/sed checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking command to parse /usr/bin/nm -B output... ok checking how to run the C preprocessor... gcc -E checking for egrep... grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for ranlib... ranlib checking for strip... strip checking for objdir... .libs checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.lo... yes checking if gcc supports -fno-rtti -fno-exceptions... yes checking whether the linker (/usr/bin/ld) supports shared libraries... yes checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking dynamic linker characteristics... GNU/Linux ld.so checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no checking whether -lc should be explicitly linked in... no creating libtool checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking for style of include used by make... GNU checking dependency style of gcc... none checking fcntl.h usability... yes checking fcntl.h presence... yes checking for fcntl.h... yes checking sys/fcntl.h usability... yes checking sys/fcntl.h presence... yes checking for sys/fcntl.h... yes checking sys/file.h usability... yes checking sys/file.h presence... yes checking for sys/file.h... yes checking sys/time.h usability... yes checking sys/time.h presence... yes checking for sys/time.h... yes checking sys/signal.h usability... yes checking sys/signal.h presence... yes checking for sys/signal.h... yes checking signal.h usability... yes checking signal.h presence... yes checking for signal.h.. . yes checking termios.h usability... yes checking termios.h presence... yes checking for termios.h... yes checking asm/termbits.h usability... yes checking asm/termbits.h presence... yes checking for asm/termbits.h... yes checking grp.h usability... yes checking grp.h presence... yes checking for grp.h... yes checking pwd.h usability... yes checking pwd.h presence... yes checking for pwd.h... yes checking whether gcc needs -traditional... no checking whether to enable maintainer-specific portions of Makefiles... no /usr/java/jdk1.5.0_13 configure: WARNING: using JAVA_HOME environmental variable adjusted java.home is /usr/java/jdk1.5.0_13 checking os.name Linux checking os.arch i386 checking java.vendor Sun Microsystems Inc. checking java.version 1.5.0_13 checking os.version 2.6.18-8.el5xen comm.jar appears to be installed already. conftest.c: In function 'main': conftest.c:6: warning: incompatible implicit declaration of built-in function 'printf' conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:6: error: (Each undeclared identifier is reported only once conftest.c:6: error: for each function it appears in.) conftest.c:6: error: expected ')' before string constant conftest.c:7: warning: incompatible implicit declaration of built-in function 'exit' ./configure: line 9649: ./conftest: No such file or directory ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected conftest.c: In function 'main': conftest.c:5: warning: incompatible implicit declaration of built-in function 'printf' conftest.c:10: warning: incompatible implicit declaration of built-in function 'exit' configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status : config.h is unchanged config.status: executing depfiles commands [root at smsgateway rxtx-2.0-7pre1]# make install /usr/java/jdk1.5.0_13/bin/javac -classpath .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d /home/jboss/sources/rxtx- 2.0-7pre1/ -O /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java /home/jboss/sources/rxtx-2.0-7pre1/./src/UnSupportedLoggerException.java /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o /home/jboss/sources/rxtx-2.0-7pre1/x86_64-unknown-linux-gnu/SerialImp.lo /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'init_threads': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: cast from pointer to integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_nativeDrain': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: cast to pointer from integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'read_byte_array': /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: cast to pointer from integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_readArray': /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: comparison is always false due to limited range of data type /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_readTerminatedArray': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: comparison is always false due to limited range of data type mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial- 2.0.7pre1.* gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so -o .libs/librxtxSerial-2.0.7pre1.so (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.0.7pre1.so librxtxSerial.so) creating librxtxSerial.la (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la librxtxSerial.la) gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/ParallelImp.lo /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function 'Java_javax_comm_LPRPort_readArray': /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: comparison is always false due to limited range of data type rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* .libs/librxtxParallel-2.0.7pre1.* gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so -o .libs/librxtxParallel- 2.0.7pre1.so (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.0.7pre1.so librxtxParallel.so) creating librxtxParallel.la (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la librxtxParallel.la) make all-am make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' libtool: install: `x86_64-unknown-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 ------------- Regards, Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071112/27758c3c/attachment-0005.html From tjarvi at qbang.org Mon Nov 12 01:02:09 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Nov 2007 01:02:09 -0700 (MST) Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> Message-ID: On Mon, 12 Nov 2007, Timothy Low wrote: > > Hi Trent, Hi Tim, Comments are inline. As I mentioned off the list, rxtx 2.0 is on the edge of deprecation. We can get it working but this is not the path of least resistance for future work. You will probably need to bounce another round of questions off the list. The following is intended to isolate the problem. > > I tried building RXTX from source, and I got this error. > > > I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm trying > to get the necessary ".so" files to use for my serial port communication > through java. > My linux kernal information is: > > *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 x86_64 > x86_64 x86_64 GNU/Linux* > > I'll most glad if you can provide me some direction on this. Thanks ! > > ---------------- > [root at smsgateway rxtx-2.0-7pre1]# ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > checking for C compiler default output... a.out > checking whether the C compiler works... yes > checking whether we are cross compiling... no > checking for suffix of executables... > checking for suffix of object files... o > checking whether we are using the GNU C compiler... yes > checking whether gcc accepts -g... yes > checking for gcc option to accept ANSI C... none needed > checking for ld used by GCC... /usr/bin/ld > checking if the linker (/usr/bin/ld) is GNU ld... yes > checking for /usr/bin/ld option to reload object files... -r > checking for BSD-compatible nm... /usr/bin/nm -B > checking for a sed that does not truncate output... /bin/sed > checking whether ln -s works... yes > checking how to recognise dependent libraries... pass_all > checking command to parse /usr/bin/nm -B output... ok > checking how to run the C preprocessor... gcc -E > checking for egrep... grep -E > checking for ANSI C header files... yes > checking for sys/types.h... yes > checking for sys/stat.h... yes > checking for stdlib.h... yes > checking for string.h... yes > checking for memory.h... yes > checking for strings.h... yes > checking for inttypes.h... yes > checking for stdint.h... yes > checking for unistd.h... yes > checking dlfcn.h usability... yes > checking dlfcn.h presence... yes > checking for dlfcn.h... yes > checking for ranlib... ranlib > checking for strip... strip > checking for objdir... .libs > checking for gcc option to produce PIC... -fPIC > checking if gcc PIC flag -fPIC works... yes > checking if gcc static flag -static works... yes > checking if gcc supports -c -o file.o... yes > checking if gcc supports -c -o file.lo... yes > checking if gcc supports -fno-rtti -fno-exceptions... yes > checking whether the linker (/usr/bin/ld) supports shared libraries... yes > checking how to hardcode library paths into programs... immediate > checking whether stripping libraries is possible... yes > checking dynamic linker characteristics... GNU/Linux ld.so > checking if libtool supports shared libraries... yes > checking whether to build shared libraries... yes > checking whether to build static libraries... no > checking whether -lc should be explicitly linked in... no > creating libtool > checking for a BSD-compatible install... /usr/bin/install -c > checking whether build environment is sane... yes > checking for gawk... gawk > checking whether make sets $(MAKE)... yes > checking for style of include used by make... GNU > checking dependency style of gcc... none > checking fcntl.h usability... yes > checking fcntl.h presence... yes > checking for fcntl.h... yes > checking sys/fcntl.h usability... yes > checking sys/fcntl.h presence... yes > checking for sys/fcntl.h... yes > checking sys/file.h usability... yes > checking sys/file.h presence... yes > checking for sys/file.h... yes > checking sys/time.h usability... yes > checking sys/time.h presence... yes > checking for sys/time.h... yes > checking sys/signal.h usability... yes > checking sys/signal.h presence... yes > checking for sys/signal.h... yes > checking signal.h usability... yes > checking signal.h presence... yes > checking for signal.h.. . yes > checking termios.h usability... yes > checking termios.h presence... yes > checking for termios.h... yes > checking asm/termbits.h usability... yes > checking asm/termbits.h presence... yes > checking for asm/termbits.h... yes > checking grp.h usability... yes > checking grp.h presence... yes > checking for grp.h... yes > checking pwd.h usability... yes > checking pwd.h presence... yes > checking for pwd.h... yes > checking whether gcc needs -traditional... no > checking whether to enable maintainer-specific portions of Makefiles... no > /usr/java/jdk1.5.0_13 > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /usr/java/jdk1.5.0_13 > checking os.name Linux > checking os.arch i386 > checking java.vendor Sun Microsystems Inc. > checking java.version 1.5.0_13 > checking os.version 2.6.18-8.el5xen > comm.jar appears to be installed already. > conftest.c: In function 'main': > conftest.c:6: warning: incompatible implicit declaration of built-in > function 'printf' > conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:6: error: (Each undeclared identifier is reported only once > conftest.c:6: error: for each function it appears in.) > conftest.c:6: error: expected ')' before string constant This is an outdated kernel version check for when headers and kernels could cause problems for rxtx. If we made it past this, then you are OK. > conftest.c:7: warning: incompatible implicit declaration of built-in > function 'exit' > ./configure: line 9649: ./conftest: No such file or directory > ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected It blew up but continues.. > conftest.c: In function 'main': > conftest.c:5: warning: incompatible implicit declaration of built-in > function 'printf' > conftest.c:10: warning: incompatible implicit declaration of built-in > function 'exit' > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status : config.h is unchanged > config.status: executing depfiles commands > [root at smsgateway rxtx-2.0-7pre1]# make install > /usr/java/jdk1.5.0_13/bin/javac -classpath > .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d > /home/jboss/sources/rxtx- 2.0-7pre1/ -O > /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java > /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/UnSupportedLoggerException.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java > Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or > overrides a deprecated API. > Note: Recompile with -Xlint:deprecation for details. > /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* The java jar should be fine now. You may need to change the source files as mentioned below. > gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. > -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g > -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o > /home/jboss/sources/rxtx-2.0-7pre1/x86_64-unknown-linux-gnu/SerialImp.lo > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'init_threads': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: cast > from pointer to integer of different size > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_nativeDrain': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: cast to > pointer from integer of different size > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'read_byte_array': > /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: cast to > pointer from integer of different size As I recall, this was caused by pointers (now 64 bit rather than 32 bit) being stored in java ints (jints). I would look at the diff between the CVS 2.1 SerialImp.c and RXTXPort.java files against 2.0. We did fix those issues. You have a .so file but the different pointer sizes will cause runtime errors. > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_readArray': > /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: > comparison is always false due to limited range of data type > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_readTerminatedArray': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: > comparison is always false due to limited range of data type > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial- > 2.0.7pre1.* > gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so -o > .libs/librxtxSerial-2.0.7pre1.so > (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.0.7pre1.so > librxtxSerial.so) > creating librxtxSerial.la > (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la > librxtxSerial.la) > gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. > -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g > -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o > /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/ParallelImp.lo > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function > 'Java_javax_comm_LPRPort_readArray': > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: > comparison is always false due to limited range of data type > rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* > .libs/librxtxParallel-2.0.7pre1.* > gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so -o > .libs/librxtxParallel- 2.0.7pre1.so > (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.0.7pre1.so > librxtxParallel.so) > creating librxtxParallel.la > (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la > librxtxParallel.la) > make all-am > make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' > make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' > libtool: install: `x86_64-unknown-linux-gnu' must be an absolute directory > name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 A libtool change? Assuming you ran configure && make install in /home/jboss/sources/rxtx- 2.0-7pre1, libtool is looking for /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/.libs/librxtxSerial-2.0.7pre1.so. I think you have this? The file is just being copied to ~JAVA/jre/lib/$(JAVA_ARCH). -- Trent Jarvi tjarvi at qbang.org From sarah_662005 at yahoo.com Mon Nov 12 16:10:28 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Mon, 12 Nov 2007 15:10:28 -0800 (PST) Subject: [Rxtx] [urgent] device's power off detection Message-ID: <766782.10076.qm@web55803.mail.re3.yahoo.com> Hello all, I have a small application built on top of rxtx api. This application can retrieve the incoming data from a device through a port. The device can be powered off after the port get closed from the application. I have been trying a couple of hours to find a way to detect the power switching from device. If anyone knows how to handle it through rxtx, could you please give me a help? Thank you very much. r, Sara ____________________________________________________________________________________ Get easy, one-click access to your favorites. Make Yahoo! your homepage. http://www.yahoo.com/r/hs -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071112/4599f3ec/attachment-0004.html From netbeans at gatworks.com Mon Nov 12 17:52:22 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 12 Nov 2007 19:52:22 -0500 Subject: [Rxtx] [urgent] device's power off detection In-Reply-To: <766782.10076.qm@web55803.mail.re3.yahoo.com> References: <766782.10076.qm@web55803.mail.re3.yahoo.com> Message-ID: <4738F546.5010101@gatworks.com> Not sure what u are asking for. Are u asking for a way to detect if the device is OFF? Are u asking how to power off the device - via software ? Is it a Serial device? is it a parallel device? is it a usb device? Sara Hugh wrote: > Hello all, > I have a small application built on top of rxtx api. This application > can retrieve the incoming data from a device through a port. The device > can be powered off after the port get closed from the application. I > have been trying a couple of hours to find a way to detect the power > switching from device. If anyone knows how to handle it through rxtx, > could you please give me a help? Thank you very much. From tjarvi at qbang.org Mon Nov 12 22:48:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Nov 2007 22:48:11 -0700 (MST) Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711120225x562db8cbxb750767ade3b0d73@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> <900c6ba90711120031p66edc001ted76f7ba24e34b98@mail.gmail.com> <900c6ba90711120225x562db8cbxb750767ade3b0d73@mail.gmail.com> Message-ID: Hi Tim, The gnu.io namespace looks just like the javax.comm 2.0 namespace. There are additional (discouraged) undocumented methods in gnu.io that you need not use. We just used the different namespace to avoid poluting Sun's by mistake and to make sure we stayed off any potential licensing related radar. Usuaully, you just change your imports and make sure you do not use the javax.comm namespace for anything like exception handling. As I mentioned off the list, there are no issues with rxtx going through the JSR process to be more Sun friendly other than time. rxtx has no hidden intentions there; anything that does not work like CommAPI 2.0 documented is a bug. The reason we do not support CommAPI 2.1 is technical in nature and is in the list archives as well as the front page of www.rxtx.org. On Mon, 12 Nov 2007, Timothy Low wrote: > Hi Trent, > > I'll move to use a JDK1.5 64-bit version... but do I need to make any source > code changes to use the package (gnu.io) in the RTXTcomm.jar instead of the > ones from the javacomm api ? > > > Regards, > Tim > > On Nov 12, 2007 5:22 PM, Trent Jarvi wrote: > >> >> Hi Tim, >> >> I see a couple things here. >> >> First your jdk is for i686 yet the library is compiled on a x86_64 >> machine. You may try passing configure the --target=i686-unknown-linux to >> try using the i686 backend to gcc if it is available. Or move to the 64 >> bit jdk. >> >> The other error I see is again the moved UTF_RELEASE define that we need >> to fix. You can probably get around that with: >> >> make -DUTF_RELEASE=`uname -r` >> >> even more simple would be to just specify the serial library which should >> be in configure --help. >> >> You can remove the UTF_RELEASE check from configure by editing >> configure.in, searching for the simple C program check and deleting it. >> Running autoconf after that will regenerate a new configure without the >> check. >> >> Note that you should remove the previous native libraries >> (librxtxSerial.so) when moving from rxtx 2.0 to 2.1. These are compiled >> for different namespaces (javax.comm/gnu.io). >> >> On Mon, 12 Nov 2007, Timothy Low wrote: >> >>> *Hi Trent, >>> >>> I moved on to rxtx 2.1.7r2, and updated my jre to 1.6.0 (64-bit)... I >> tried >>> the following 2 methods: >>> >>> (1) using the rxtx 2.1.7 binaries from the RXTX website* >>> *Are these binaries suitable for a 64-bit OS ? There mentioning of the >>> gnu.io that you've talked about previously...* >>> ------ >>> [root at smsgateway sources]# java -Djava.library.path=/usr/lib PortLister >>> Experimental: JNI_OnLoad called. >>> >>> java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion >>> ()Ljava/lang/String; >>> at gnu.io.RXTXCommDriver.nativeGetVersion(Native Method) >>> at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:85) >>> at java.lang.Class.forName0(Native Method) >>> at java.lang.Class.forName(Unknown Source) >>> at javax.comm.CommPortIdentifier.loadDriver( >> CommPortIdentifier.java >>> :237) >>> at javax.comm.CommPortIdentifier.(CommPortIdentifier.java >>> :109) >>> at PortLister.(PortLister.java:6) >>> at PortLister.main(PortLister.java:25) >>> Exception in thread "main" java.lang.UnsatisfiedLinkError: >>> com.sun.comm.SunrayInfo.isSessionActive()Z >>> at com.sun.comm.SunrayInfo.isSessionActive(Native Method) >>> at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java >> :155) >>> at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java >>> :100) >>> at javax.comm.CommPortIdentifier.(CommPortIdentifier.java >>> :138) >>> at PortLister.(PortLister.java:6) >>> at PortLister.main(PortLister.java:25) >>> >>> ------ >>> >>> (2) compiling the rxtx 2.1.7 from source >>> *but i got the following error while running ./configure and make all* >>> >>> ------ >>> [root at smsgateway rxtx-2.1-7r2]# ./configure >>> checking build system type... x86_64-unknown-linux-gnu >>> checking host system type... x86_64-unknown-linux-gnu >>> checking target system type... x86_64-unknown-linux-gnu >>> configure: WARNING: Trying libtool. If the following fails install >> libtool >>> checking for gcc... gcc >>> checking for C compiler default output file name... a.out >>> checking whether the C compiler works... yes >>> checking whether we are cross compiling... no >>> checking for suffix of executables... >>> checking for suffix of object files... o >>> checking whether we are using the GNU C compiler... yes >>> checking whether gcc accepts -g... yes >>> checking for gcc option to accept ANSI C... none needed >>> checking for a sed that does not truncate output... /bin/sed >>> checking for egrep... grep -E >>> checking for ld used by gcc... /usr/bin/ld >>> checking if the linker (/usr/bin/ld) is GNU ld... yes >>> checking for /usr/bin/ld option to reload object files... -r >>> checking for BSD-compatible nm... /usr/bin/nm -B >>> checking whether ln -s works... yes >>> checking how to recognise dependent libraries... pass_all >>> checking how to run the C preprocessor... gcc -E >>> checking for ANSI C header files... yes >>> checking for sys/types.h... yes >>> checking for sys/stat.h... yes >>> checking for stdlib.h... yes >>> checking for string.h... yes >>> checking for memory.h... yes >>> checking for strings.h... yes >>> checking for inttypes.h... yes >>> checking for stdint.h... yes >>> checking for unistd.h... yes >>> checking dlfcn.h usability... yes >>> checking dlfcn.h presence... yes >>> checking for dlfcn.h... yes >>> checking for g++... g++ >>> checking whether we are using the GNU C++ compiler... yes >>> checking whether g++ accepts -g... yes >>> checking how to run the C++ preprocessor... g++ -E >>> checking for g77... no >>> checking for f77... no >>> checking for xlf... no >>> checking for frt... no >>> checking for pgf77... no >>> checking for fort77... no >>> checking for fl32... no >>> checking for af77... no >>> checking for f90... no >>> checking for xlf90... no >>> checking for pgf90... no >>> checking for epcf90... no >>> checking for f95... f95 >>> checking whether we are using the GNU Fortran 77 compiler... yes >>> checking whether f95 accepts -g... yes >>> checking the maximum length of command line arguments... 32768 >>> checking command to parse /usr/bin/nm -B output from gcc object... ok >>> checking for objdir... .libs >>> checking for ar... ar >>> checking for ranlib... ranlib >>> checking for strip... strip >>> checking if gcc static flag works... yes >>> checking if gcc supports -fno-rtti -fno-exceptions... no >>> checking for gcc option to produce PIC... -fPIC >>> checking if gcc PIC flag -fPIC works... yes >>> checking if gcc supports -c -o file.o... yes >>> checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking whether -lc should be explicitly linked in... no >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> checking if libtool supports shared libraries... yes >>> checking whether to build shared libraries... yes >>> checking whether to build static libraries... no >>> configure: creating libtool >>> appending configuration tag "CXX" to libtool >>> checking for ld used by g++... /usr/bin/ld -m elf_x86_64 >>> checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes >>> checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking for g++ option to produce PIC... -fPIC >>> checking if g++ PIC flag -fPIC works... yes >>> checking if g++ supports -c -o file.o... yes >>> checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> appending configuration tag "F77" to libtool >>> checking if libtool supports shared libraries... yes >>> checking whether to build shared libraries... yes >>> checking whether to build static libraries... no >>> checking for f95 option to produce PIC... -fPIC >>> checking if f95 PIC flag -fPIC works... yes >>> checking if f95 supports -c -o file.o... yes >>> checking whether the f95 linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> checking for a BSD-compatible install... /usr/bin/install -c >>> checking whether build environment is sane... yes >>> checking for gawk... gawk >>> checking whether make sets $(MAKE)... yes >>> checking for style of include used by make... GNU >>> checking dependency style of gcc... none >>> checking dependency style of g++... none >>> checking fcntl.h usability... yes >>> checking fcntl.h presence... yes >>> checking for fcntl.h... yes >>> checking sys/fcntl.h usability... yes >>> checking sys/fcntl.h presence... yes >>> checking for sys/fcntl.h... yes >>> checking sys/file.h usability... yes >>> checking sys/file.h presence... yes >>> checking for sys/file.h... yes >>> checking sys/time.h usability... yes >>> checking sys/time.h presence... yes >>> checking for sys/time.h... yes >>> checking sys/signal.h usability... yes >>> checking sys/signal.h presence... yes >>> checking for sys/signal.h... yes >>> checking signal.h usability... yes >>> checking signal.h presence... yes >>> checking for signal.h... yes >>> checking termios.h usability... yes >>> checking termios.h presence... yes >>> checking for termios.h... yes >>> checking grp.h usability... yes >>> checking grp.h presence... yes >>> checking for grp.h... yes >>> checking pwd.h usability... yes >>> checking pwd.h presence... yes >>> checking for pwd.h... yes >>> checking whether gcc needs -traditional... no >>> checking whether to enable maintainer-specific portions of Makefiles... >> no >>> /usr/java/jdk1.5.0_13 >>> configure: WARNING: using JAVA_HOME environmental variable >>> adjusted java.home is /usr/java/jdk1.5.0_13 >>> checking os.name Linux >>> checking os.arch i386 >>> checking java.vendor Sun Microsystems Inc. >>> checking java.version 1.5.0_13 >>> checking os.version 2.6.18-8.el5xen >>> conftest.c: In function 'main': >>> conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this >> function) >>> conftest.c:8: error: (Each undeclared identifier is reported only once >>> conftest.c:8: error: for each function it appears in.) >>> conftest.c:8: error: expected ')' before string constant >>> ./configure: line 21462: ./conftest: No such file or directory >>> ./configure: line 21462: test: 2.6.18-8.el5xen: unary operator expected >>> configure: creating ./config.status >>> config.status: creating Makefile >>> config.status: creating config.h >>> config.status: executing depfiles commands >>> [root at smsgateway rxtx-2.1-7r2]# make install >>> /usr/java/jdk1.5.0_13/bin/javac -classpath .:/home/jboss/sources/rxtx- >>> >> 2.1-7r2:/home/jboss/sources/rxtx-2.1-7r2/src:/usr/java/jdk1.5.0_13/jre/lib/ext/RXTXcomm.jar-d >>> /home/jboss/sources/rxtx- >>> 2.1-7r2/ -O -source 1.3 -target 1.3 >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommDriver.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortEnumerator.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortIdentifier.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortOwnershipListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Configure.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2C.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/I2CPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/LPRPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/NoSuchPortException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/PortInUseException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Raw.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/RawPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RawPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RawPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/RS485PortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485PortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485Port.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXCommDriver.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXVersion.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPort.java >>> /home/jboss/sources/rxtx-2.1-7r2 >> /./src/UnsupportedCommOperationException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/UnSupportedLoggerException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Zystem.java >>> /usr/java/jdk1.5.0_13/bin/javah -classpath .:/home/jboss/sources/rxtx- >>> >> 2.1-7r2:/home/jboss/sources/rxtx-2.1-7r2/src:/usr/java/jdk1.5.0_13/jre/lib/ext/RXTXcomm.jar-d >>> x86_64-unknown-linux-gnu -jni `(for i in CommDriver CommPortEnumerator >>> CommPortIdentifier CommPort CommPortOwnershipListener Configure I2C >>> I2CPortEvent I2CPortEventListener I2CPort LPRPort NoSuchPortException >>> ParallelPortEvent ParallelPortEventListener ParallelPort >> PortInUseException >>> Raw RawPortEvent RawPortEventListener RawPort RS485 RS485PortEvent >>> RS485PortEventListener RS485Port RXTXCommDriver RXTXPort RXTXVersion >>> SerialPortEvent SerialPortEventListener SerialPort >>> UnsupportedCommOperationException UnSupportedLoggerException Zystem;do \ >>> if grep > /dev/null native.*\( /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/$i.java; then \ >>> echo gnu.io.$i; \ >>> fi; \ >>> done)` >>> /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialImp.c -o >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo; >>> \ >>> if [ "Serial" = "Serial" ]; >>> then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxSerial.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxSerial.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo; >> \ >>> fi; \ >>> ) >>> mkdir /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/.libs >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/SerialImp.o >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/fuserImp.o >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c: In function >> 'show_user': >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c:238: warning: cast >> from >>> pointer to integer of different size >>> gcc -shared /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/SerialImp.o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/fuserImp.o >>> -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7.so -o >> .libs/librxtxSerial- >>> 2.1-7.so >>> (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.1-7.so >>> librxtxSerial.so) >>> creating librxtxSerial.la >>> (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la >>> librxtxSerial.la) >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelImp.c -o >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/ParallelImp.lo; >>> \ >>> if [ "Parallel" = "Serial" ]; >>> then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxParallel.la -rpath >>> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/ParallelImp.lo >>> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxParallel.la -rpath >>> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/ParallelImp.lo; >>> \ >>> fi; \ >>> ) >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >>> /x86_64-unknown-linux-gnu/.libs/ParallelImp.o >>> gcc -shared /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/ParallelImp.o >>> -lpthread -Wl,-soname -Wl,librxtxParallel-2.1-7.so -o >>> .libs/librxtxParallel-2.1-7.so >>> (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.1-7.so >>> librxtxParallel.so) >>> creating librxtxParallel.la >>> (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la >>> librxtxParallel.la) >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo; >>> \ >>> if [ "I2C" = "Serial" ]; then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxI2C.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo >>> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxI2C.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo; >>> \ >>> fi; \ >>> ) >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/.libs/I2CImp.o >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c: In function >>> 'Java_gnu_io_I2CPort_Initialize': >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: 'UTS_RELEASE' >>> undeclared (first use in this function) >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: (Each >> undeclared >>> identifier is reported only once >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: for each >> function >>> it appears in.) >>> libtool: link: `/home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/I2CImp.lo' >>> is not a valid libtool object >>> make: *** [x86_64-unknown-linux-gnu/librxtxI2C.la] Error 1 >>> >>> ------ >>> >>> >>> >>> On Nov 12, 2007 4:02 PM, Trent Jarvi wrote: >>> >>>> On Mon, 12 Nov 2007, Timothy Low wrote: >>>>> >>>>> Hi Trent, >>>> >>>> Hi Tim, >>>> >>>> Comments are inline. As I mentioned off the list, rxtx 2.0 is on the >> edge >>>> of deprecation. We can get it working but this is not the path of >> least >>>> resistance for future work. >>>> >>>> You will probably need to bounce another round of questions off the >> list. >>>> The following is intended to isolate the problem. >>>> >>>>> >>>>> I tried building RXTX from source, and I got this error. >>>>> >>>>> >>>>> I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm >>>> trying >>>>> to get the necessary ".so" files to use for my serial port >> communication >>>>> through java. >>>>> My linux kernal information is: >>>>> >>>>> *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 >>>> x86_64 >>>>> x86_64 x86_64 GNU/Linux* >>>>> >>>>> I'll most glad if you can provide me some direction on this. Thanks ! >>>>> >>>>> ---------------- >>>>> [root at smsgateway rxtx-2.0-7pre1]# ./configure >>>>> checking build system type... x86_64-unknown-linux-gnu >>>>> checking host system type... x86_64-unknown-linux-gnu >>>>> checking target system type... x86_64-unknown-linux-gnu >>>>> configure: WARNING: Trying libtool. If the following fails install >>>> libtool >>>>> checking for gcc... gcc >>>>> checking for C compiler default output... a.out >>>>> checking whether the C compiler works... yes >>>>> checking whether we are cross compiling... no >>>>> checking for suffix of executables... >>>>> checking for suffix of object files... o >>>>> checking whether we are using the GNU C compiler... yes >>>>> checking whether gcc accepts -g... yes >>>>> checking for gcc option to accept ANSI C... none needed >>>>> checking for ld used by GCC... /usr/bin/ld >>>>> checking if the linker (/usr/bin/ld) is GNU ld... yes >>>>> checking for /usr/bin/ld option to reload object files... -r >>>>> checking for BSD-compatible nm... /usr/bin/nm -B >>>>> checking for a sed that does not truncate output... /bin/sed >>>>> checking whether ln -s works... yes >>>>> checking how to recognise dependent libraries... pass_all >>>>> checking command to parse /usr/bin/nm -B output... ok >>>>> checking how to run the C preprocessor... gcc -E >>>>> checking for egrep... grep -E >>>>> checking for ANSI C header files... yes >>>>> checking for sys/types.h... yes >>>>> checking for sys/stat.h... yes >>>>> checking for stdlib.h... yes >>>>> checking for string.h... yes >>>>> checking for memory.h... yes >>>>> checking for strings.h... yes >>>>> checking for inttypes.h... yes >>>>> checking for stdint.h... yes >>>>> checking for unistd.h... yes >>>>> checking dlfcn.h usability... yes >>>>> checking dlfcn.h presence... yes >>>>> checking for dlfcn.h... yes >>>>> checking for ranlib... ranlib >>>>> checking for strip... strip >>>>> checking for objdir... .libs >>>>> checking for gcc option to produce PIC... -fPIC >>>>> checking if gcc PIC flag -fPIC works... yes >>>>> checking if gcc static flag -static works... yes >>>>> checking if gcc supports -c -o file.o... yes >>>>> checking if gcc supports -c -o file.lo... yes >>>>> checking if gcc supports -fno-rtti -fno-exceptions... yes >>>>> checking whether the linker (/usr/bin/ld) supports shared libraries... >>>> yes >>>>> checking how to hardcode library paths into programs... immediate >>>>> checking whether stripping libraries is possible... yes >>>>> checking dynamic linker characteristics... GNU/Linux ld.so >>>>> checking if libtool supports shared libraries... yes >>>>> checking whether to build shared libraries... yes >>>>> checking whether to build static libraries... no >>>>> checking whether -lc should be explicitly linked in... no >>>>> creating libtool >>>>> checking for a BSD-compatible install... /usr/bin/install -c >>>>> checking whether build environment is sane... yes >>>>> checking for gawk... gawk >>>>> checking whether make sets $(MAKE)... yes >>>>> checking for style of include used by make... GNU >>>>> checking dependency style of gcc... none >>>>> checking fcntl.h usability... yes >>>>> checking fcntl.h presence... yes >>>>> checking for fcntl.h... yes >>>>> checking sys/fcntl.h usability... yes >>>>> checking sys/fcntl.h presence... yes >>>>> checking for sys/fcntl.h... yes >>>>> checking sys/file.h usability... yes >>>>> checking sys/file.h presence... yes >>>>> checking for sys/file.h... yes >>>>> checking sys/time.h usability... yes >>>>> checking sys/time.h presence... yes >>>>> checking for sys/time.h... yes >>>>> checking sys/signal.h usability... yes >>>>> checking sys/signal.h presence... yes >>>>> checking for sys/signal.h... yes >>>>> checking signal.h usability... yes >>>>> checking signal.h presence... yes >>>>> checking for signal.h.. . yes >>>>> checking termios.h usability... yes >>>>> checking termios.h presence... yes >>>>> checking for termios.h... yes >>>>> checking asm/termbits.h usability... yes >>>>> checking asm/termbits.h presence... yes >>>>> checking for asm/termbits.h... yes >>>>> checking grp.h usability... yes >>>>> checking grp.h presence... yes >>>>> checking for grp.h... yes >>>>> checking pwd.h usability... yes >>>>> checking pwd.h presence... yes >>>>> checking for pwd.h... yes >>>>> checking whether gcc needs -traditional... no >>>>> checking whether to enable maintainer-specific portions of >> Makefiles... >>>> no >>>>> /usr/java/jdk1.5.0_13 >>>>> configure: WARNING: using JAVA_HOME environmental variable >>>>> adjusted java.home is /usr/java/jdk1.5.0_13 >>>>> checking os.name Linux >>>>> checking os.arch i386 >>>>> checking java.vendor Sun Microsystems Inc. >>>>> checking java.version 1.5.0_13 >>>>> checking os.version 2.6.18-8.el5xen >>>>> comm.jar appears to be installed already. >>>>> conftest.c: In function 'main': >>>>> conftest.c:6: warning: incompatible implicit declaration of built-in >>>>> function 'printf' >>>>> conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this >>>> function) >>>>> conftest.c:6: error: (Each undeclared identifier is reported only once >>>>> conftest.c:6: error: for each function it appears in.) >>>>> conftest.c:6: error: expected ')' before string constant >>>> >>>> >>>> This is an outdated kernel version check for when headers and kernels >>>> could cause problems for rxtx. If we made it past this, then you are >> OK. >>>> >>>> >>>>> conftest.c:7: warning: incompatible implicit declaration of built-in >>>>> function 'exit' >>>>> ./configure: line 9649: ./conftest: No such file or directory >>>>> ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected >>>> >>>> It blew up but continues.. >>>> >>>>> conftest.c: In function 'main': >>>>> conftest.c:5: warning: incompatible implicit declaration of built-in >>>>> function 'printf' >>>>> conftest.c:10: warning: incompatible implicit declaration of built-in >>>>> function 'exit' >>>>> configure: creating ./config.status >>>>> config.status: creating Makefile >>>>> config.status: creating config.h >>>>> config.status : config.h is unchanged >>>>> config.status: executing depfiles commands >>>>> [root at smsgateway rxtx-2.0-7pre1]# make install >>>>> /usr/java/jdk1.5.0_13/bin/javac -classpath >>>>> .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/ -O >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1 >> /./src/UnSupportedLoggerException.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java >>>>> Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or >>>>> overrides a deprecated API. >>>>> Note: Recompile with -Xlint:deprecation for details. >>>>> /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* >>>> >>>> >>>> The java jar should be fine now. You may need to change the source >> files >>>> as mentioned below. >>>> >>>>> gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu >> -I. >>>>> -I/usr/java/jdk1.5.0_13/include >> -I/usr/java/jdk1.5.0_13/include/./linux/ >>>> -g >>>>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o >>>>> /home/jboss/sources/rxtx-2.0-7pre1 >> /x86_64-unknown-linux-gnu/SerialImp.lo >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'init_threads': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: >>>> cast >>>>> from pointer to integer of different size >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_nativeDrain': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: >>>> cast to >>>>> pointer from integer of different size >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'read_byte_array': >>>>> /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: >>>> cast to >>>>> pointer from integer of different size >>>> >>>> >>>> As I recall, this was caused by pointers (now 64 bit rather than 32 >> bit) >>>> being stored in java ints (jints). I would look at the diff between >> the >>>> CVS 2.1 SerialImp.c and RXTXPort.java files against 2.0. We >>>> did fix those issues. >>>> >>>> You have a .so file but the different pointer sizes will cause runtime >>>> errors. >>>> >>>> >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_readArray': >>>>> /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: >>>>> comparison is always false due to limited range of data type >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_readTerminatedArray': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: >>>>> comparison is always false due to limited range of data type >>>>> mkdir .libs >>>>> rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* >> .libs/librxtxSerial- >>>>> 2.0.7pre1.* >>>>> gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so-o >>>>> .libs/librxtxSerial-2.0.7pre1.so >>>>> (cd .libs && rm -f librxtxSerial.so && ln -s >> librxtxSerial-2.0.7pre1.so >>>>> librxtxSerial.so) >>>>> creating librxtxSerial.la >>>>> (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la >>>>> librxtxSerial.la) >>>>> gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu >> -I. >>>>> -I/usr/java/jdk1.5.0_13/include >> -I/usr/java/jdk1.5.0_13/include/./linux/ >>>> -g >>>>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o >>>>> /home/jboss/sources/rxtx- 2.0-7pre1 >>>> /x86_64-unknown-linux-gnu/ParallelImp.lo >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function >>>>> 'Java_javax_comm_LPRPort_readArray': >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: >>>>> comparison is always false due to limited range of data type >>>>> rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* >>>>> .libs/librxtxParallel-2.0.7pre1.* >>>>> gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so-o >>>>> .libs/librxtxParallel- 2.0.7pre1.so >>>>> (cd .libs && rm -f librxtxParallel.so && ln -s >>>> librxtxParallel-2.0.7pre1.so >>>>> librxtxParallel.so) >>>>> creating librxtxParallel.la >>>>> (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la >>>>> librxtxParallel.la) >>>>> make all-am >>>>> make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' >>>>> make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' >>>>> libtool: install: `x86_64-unknown-linux-gnu' must be an absolute >>>> directory >>>>> name >>>>> Try `libtool --help --mode=install' for more information. >>>>> make: *** [install] Error 1 >>>> >>>> A libtool change? Assuming you ran configure && make install in >>>> /home/jboss/sources/rxtx- 2.0-7pre1, libtool is looking for >>>> /home/jboss/sources/rxtx- >>>> 2.0-7pre1/x86_64-unknown-linux-gnu/.libs/librxtxSerial-2.0.7pre1.so. >>>> >>>> I think you have this? The file is just being copied to >>>> ~JAVA/jre/lib/$(JAVA_ARCH). >>>> >>>> -- >>>> Trent Jarvi >>>> tjarvi at qbang.org >>>> >>> >> > From guido.vogt at celsi.ch Tue Nov 13 00:28:01 2007 From: guido.vogt at celsi.ch (Guido Vogt) Date: Tue, 13 Nov 2007 08:28:01 +0100 Subject: [Rxtx] RTS Line can't be set Message-ID: <47395201.1050400@celsi.ch> I'm working on an Windows XP /SP2 System. Version of RXTX: 2.1.7. The serial line is connected to a modem. As I can see, the RTS-Line of the serial Port is inactive, when the port is opened (flowcontrol=none). Obviously, no data is coming from the modem. If I use the setRTS(true) command after open, the comport does not send out my data any more. This behaviour is regardless of flowcontrol. Anybody has an idea what do do? Thanks for help. From Martin.Oberhuber at windriver.com Tue Nov 13 08:58:23 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 13 Nov 2007 16:58:23 +0100 Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803880918@ism-mail03.corp.ad.wrs.com> Hi Trent, as said before, I like the idea of discussing such quality engineering issues, but why hide these away from the rest of the public? Anyways, if you do want to create a new mailing list for these kinds of things I'll happily subscribe. 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: Sunday, November 11, 2007 1:46 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: RE: [Rxtx] Quality Engineering with rxtx > > On Mon, 5 Nov 2007, Oberhuber, Martin wrote: > > > Hi Trent, > > > > are the interestes of hobbyists really so different > > from commercial ones? Both should be interested in > > high quality and innovation the like. > > > > I haven't seen too many Open Source projects from the > > "inside" but those that I have seen did not have > > separate mailing lists for quality/testing/qa > > versus innovation/development. > > > > What I have seen with the Open Source projects that > > one would call "successful" is a good deal of > > process around automated builds, automated unit > > tests, predictable release dates and milestones, > > and policies around commiting/contributing/reviewing > > changes. > > > > I think that all of these benefit commercial users > > and hobbyists the like. > > > > If you were just asking about who's interested in > > discussing changes to foster more quality, count > > me in. I'm just not sure whether discussing these > > on a separate mailing list or other channel is the > > right thing to do. > > > > Hi Martin, > > There are two issues I'm thinking about. The first is the > generic unit > testing and quality initiatives required to move rxtx > forward. The second > is the inevitable fact that rxtx connects to external hardware. The > discussion deals with a different set of problems. > > Here is a simple example of what I'm getting at. > > We have the capability of setting custom baud rates in rxtx. > We may be > interested in seeing regressions in rxtx, the C library or > the kernel. > Some people may be doing some tests with loopback > connections. These will > always work even if the baud rate is not set to the expected > value. Some > people may use null modems between two ports. This may be > able to catch > the problem but not always. > > Will the build machines be able to test this? (no - for a few reasons) > Will people be trying to catch these type of regressions? (yes) > What type of coverage does the community have in the end? (?) > > We could include the discussions in the same list or another > equally open > list that may be of interest to some folks that deal with > these types of > problems on a regular basis. > > -- > Trent Jarvi > tjarvi at qbang.org > From toupsz at cs.tamu.edu Tue Nov 13 10:33:03 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 13 Nov 2007 11:33:03 -0600 Subject: [Rxtx] [urgent] device's power off detection In-Reply-To: <4738F546.5010101@gatworks.com> References: <766782.10076.qm@web55803.mail.re3.yahoo.com> <4738F546.5010101@gatworks.com> Message-ID: Lacking any other specification on it...but can you set up the device to notify your software when it turns off? Send a message or somesuch? Maybe it can signal using RTS or DTR? -Zach On Nov 12, 2007 6:52 PM, U. George wrote: > Not sure what u are asking for. Are u asking for a way to detect if the > device is OFF? Are u asking how to power off the device - via software ? > Is it a Serial device? > is it a parallel device? > is it a usb device? > > Sara Hugh wrote: > > Hello all, > > I have a small application built on top of rxtx api. This application > > can retrieve the incoming data from a device through a port. The device > > can be powered off after the port get closed from the application. I > > have been trying a couple of hours to find a way to detect the power > > switching from device. If anyone knows how to handle it through rxtx, > > could you please give me a help? Thank you very much. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071113/e5859e4d/attachment-0002.html From tjarvi at qbang.org Tue Nov 13 20:02:03 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 13 Nov 2007 20:02:03 -0700 (MST) Subject: [Rxtx] #ifndef TIOCSERGETLSR In-Reply-To: <472E3AAF.7050709@gatworks.com> References: <472E3AAF.7050709@gatworks.com> Message-ID: On Sun, 4 Nov 2007, U. George wrote: > For Linux, it seems that you need the code for both *having* a > TIOCSERGETLSR, and *not having* a TIOCSERGETLSR. Maybe the ioctl exists > system wide, but not necessarily for the device driver itself ( always > returns -1 ) . > > Are there systems that have a *functioning* TIOCSERGETLSR for all their > devices? Then this would be the case where the "#ifndef TIOCSERGETLSR" > directive could be useful is eliminating the unnecessary code and tests. > > And for those systems that dont have a TIOCSERGETLSR, then the code for > TIOCSERGETLSR can be eliminated. > > It would be a simple case to have, as a foundation, all the code to > simulate the missing TIOCSERGETLSR ioctl. If the system does have the > ioctl, then that code can be ifdef'd in, and co-exist with the > functionality of the code that simulates the missing TIOCSERGETLSR ioctl. > Ah, there is the post. Sorry I was on vacation. Hi George, Yes there are systems that have functioning TIOCSERGETLSR for all of their devices. These are machines that just use traditional UARTs. If you mean operating systems, then probably not. Let me explain a bit about the history of those #ifdefs to help clear up a mess. RXTX aims to follow POSIX. TIOCSERGETLSR turns out to not be POSIX at all as I understand. It isn't in BSD, Solaris, AIX or HP-UX. It certainly provides access to important information. I assumed it was standard when I coded rxtx on a Linux system. Ya, laugh. Then I looked at Win32.. Oh you are still laughing? ..I could not navigate msft's web site at the time [still can't really find anything today]. So google pointed me to someones 'reverse documentation' of the w32 API and an example msft put together back in the win3.0 days. It was enough but maybe not 100% correct. They covered overlapped IO which was important for events in rxtx. Looking at Win32 and Linux, it made sense to implement TIOCSERGETLSR for win32 with the way rxtx works. That was how things matched up. But when I got feedback about other systems, it didn't match up. When people used multiport cards with money saving designs in Linux, it didn't match up. And today, there are drivers for unusual serial ports that don't match up. Now we have some ugly logic that mostly works for most serial ports. It isn't right though. The important aspect of TIOSERGETLSR is knowing when the output is really gone. But POSIX tcdrain tells us the same thing. So there is logic in the ifdefs to match that up as you suggest. Perhaps a more formal solution along those lines would be worth looking into. I would suggest the roles should be switched though. We should use POSIX calls on all systems and hide things that don't work on everything like we have with other undocumented calls. TIOSERGETLSR is nice and would be great if it was standard. It isn't as far as I can tell. In the end, many people write Java code because they want portability. The TIOSERGETLSR does not really fit. In someways, this is limiting to the least common denominator which is Solaris if you have seen it's serial kernel driver code. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 15 09:10:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 15 Nov 2007 17:10:59 +0100 Subject: [Rxtx] RXTX blocking on unconnected virtual port Message-ID: <460801A4097E3D4CA04CC64EE648584803919080@ism-mail03.corp.ad.wrs.com> Hello, we came across the following issue: * Set up a virtual serial port, e.g. with com0com: http://com0com.sourceforge.net/ * Connect RXTX to one end, e.g. cnc1a * Do not connect the other end, e.g. cnc1b * Have RXTX write data to the port --> Since the data is not being read, RXTX blocks - RXTXPort.SerialOutputStream.write increases the RXTXPort.IOLocked variable - it then calls the native writeByte or writeArray method (which blocks) closing the RXTXPort hangs for ever too: - RXTXPort.close() has a while( IOLocked > 0 ) {..Thread.sleep(500);...} which spins for ever ==> once the communication hangs, it cannot recover. Has anybody else seen such a problem before, or even got an idea how to solve it? When I connect Hyperterminal to the same half-open port, and type a character, it hangs for about 3 seconds but then times out and is available again. I guess that's what I'd like to see in RXTX as well, with a (configurable) timeout. Our big problem with the current situation is that once RXTX gets stuck, there is nothing at all we can do to make it go live again - that's why our original workaround of writing to the port in a background thread is not good enough. For more background information, the issue is being tracked in https://bugs.eclipse.org/bugs/show_bug.cgi?id=208185 Thanks for any hints or ideas, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From keithvz at verizon.net Thu Nov 1 08:08:58 2007 From: keithvz at verizon.net (Keith) Date: Thu, 01 Nov 2007 10:08:58 -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: <4729DDFA.7080206@verizon.net> Trent Jarvi wrote: > 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? Well, I honestly don't know how all this fits together. I think it's just a matter of enabling the right flow control option within the standard serial framework to tell the device driver, "HEY START USING DTR/DSR FOR FLOW CONTROL." If what UGeorge said,(about that type of nitty-gritty lead control being done within the device driver), is true, then this confirms my suspicion. I tried narrowing down within the Linux drivers what you are looking for, but I can't entirely tell wth I'm looking at. (virtual com port drivers -- they are included compiled by default with Ubuntu, source included) http://www.ftdichip.com/Drivers/VCP/Linux/ftdi_sio.tar.gz Hahahaa, they make a reference to DTR flow control being supported but say (UGH) in parenthesis. You can also use their direct device driver library on Ubuntu -- libftd2xx.so.0.4.13. No source code. http://www.ftdichip.com/Drivers/D2XX/Linux/libftd2xx0.4.13.tar.gz In that case, you make a call to their FT_SetFlowControl() function. FT_STATUS FT_SetFlowControl (FT_HANDLE ftHandle, USHORT usFlowControl, UCHAR uXon,UCHAR uXoff) Parameters ftHandle Handle of the device. usFlowControl Must be one of FT_FLOW_NONE, FT_FLOW_RTS_CTS, ****FT_FLOW_DTR_DSR**** or FT_FLOW_XON_XOFF. uXon Character used to signal Xon. Only used if flow control is FT_FLOW_XON_XOFF. uXoff Character used to signal Xoff. Only used if flow control is FT_FLOW_XON_XOFF. This is from their programming guide http://www.ftdichip.com/Documents/ProgramGuides/D2XXPG34.pdf I actually want to take this a step further and say that I think the flow control is actually handled right on the device itself in hardware/firmware. It's enabled through the device driver, but I think the maintaining of buffers, asserting/deasserting of leads, etc is handled by the device. For the time being, I've switched to jd2xx, https://jd2xx.dev.java.net/ and http://bleyer.org/jd2xx/ These are Java wrappers for the device driver libraries. It allows almost direct access to the well-documented device drivers from Java. I hope this helps Keith From tjarvi at qbang.org Thu Nov 1 11:09:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:09:51 -0600 (MDT) 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: Hi Martin, What I usually have done is allow changes that do not impact working software including changes to methods not documented in CommAPI (which remain undocumented in rxtx) and fixes to known problems in the documented portions. That way if you use the documented API, the releases should only become better with time. If you use the undocumented portions, the behavior is not as predictable but open for improvement. On Wed, 31 Oct 2007, 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 >> > From tjarvi at qbang.org Thu Nov 1 11:15:52 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:15:52 -0600 (MDT) 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: I too use rxtx in commercial products. The problem I've been trying to address while bringing the server back was how to make it possible for hobby folks to build the same software as companies so we can move rxtx along a little faster. Exposing internal tools is not an option at this time, the public rxtx builds have been done on my home machine which has drives hanging out of it all over the place dying one at a time. This isn't maintainable. I'm currently looking at the possibility of making an S3 image available on Amazon's EC. These are machines you can rent for ~10 cents an hour which is more than enough to build rxtx. The S3 image is not changed when people use it so everyone has the same starting point. With this, we could all build rxtx for ~20 platforms for a small price and eliminate tool issues. On Wed, 31 Oct 2007, Greg Johnson wrote: > 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 tjarvi at qbang.org Thu Nov 1 11:19:55 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:19:55 -0600 (MDT) 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: On Wed, 31 Oct 2007, 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. I was helping Dmitry do the Mac OS X port without access to a machine when we put that in. In the archives there is information (easily found with google on Apple's site) that describes how their API (and others) can determine if a port is used and ignore it. I think these changes are in CVS but need to confirm. The bottom line is that rxtx should not have used lock files on Mac. It was just ignorance of the system on my part. -- Trent Jarvi tjarvi at qbang.org From fabioanjos at gmail.com Thu Nov 1 12:35:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Thu, 1 Nov 2007 15:35:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Hi, I was using SerialEventListener in my project. But, as was said here, id doesnt work very well with virtual serial ports. So, I changed the strategy using the code posted here in this thread: try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > 0) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } The thing is that in my tests I could notice that in.read(buffer) never blocks. Even when there's nothing to read. Instead of blocking when there's nothing to read it returns 0. So, my questions are: 1. Am I doing something wrong? 2. If not, wouldnt this decrease performance? (the thread would be locked in a loop that does nothing.) 3. Is there a better way to do the job? Thanks in advance!! F?bio -------- On 10/31/07, Andre-John Mas wrote: > > > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/0aee59d0/attachment-0016.html From ajmas at sympatico.ca Thu Nov 1 16:07:55 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Nov 2007 18:07:55 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Message-ID: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From sarah_662005 at yahoo.com Thu Nov 1 17:10:05 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Thu, 1 Nov 2007 16:10:05 -0700 (PDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Message-ID: <351433.37166.qm@web55814.mail.re3.yahoo.com> Thank you very much for your help. Now the application works fine. the serialEvent gets triggered. Rxtx is cool! ----- Original Message ---- From: Andre-John Mas To: Sara Hugh ; RXTX Developers and Users Sent: Wednesday, October 31, 2007 9:55:45 AM Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered 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 __________________________________________________ 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/20071101/4a86bea6/attachment-0016.html From tjarvi at qbang.org Thu Nov 1 17:58:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 17:58:02 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx Message-ID: The rxtx.org site is primarily interested in the hobby aspects of rxtx. Obviously, there are some companies following the work too. These interests bring larger workflows and concerns about details hobby folks may not care about. They also bring many more users. I know the company I work for has a quality engineering effort going on which includes rxtx. While the server was down, I was contacted by another company that was missing the binaries for their testing. Several people have mentioned concerns about a stable release for like reasons. Would there be interest on the quality side of the coin to get together? It could be just sharing email's with each other or a seperate list for QE/QA. I can not say for sure, but we may be able to share some of our efforts/results that could help keep rxtx releases stable. -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Fri Nov 2 01:42:55 2007 From: scldad at sdc.com.au (Stephen Davies) Date: Fri, 2 Nov 2007 18:12:55 +1030 Subject: [Rxtx] Multiple modems Message-ID: <200711021812.56047.scldad@sdc.com.au> This may or may not be related to the Multiple Ports thread. I have an application which uses rxtx on Linux (via cron jobs) to connect multiple modems to remote sensing devices. The application works fine most of the time but occasionally fails to connect if two (or more) connection attempts happen at about the same time. When it fails, it looks as if it may get confused as to which port it is talking to. The app has a "base" component that looks for an available port, opens it and then creates an input thread and an output thread for the connection and data transfer. The "base" component uses this code: // loop round all known ports until one is available. Give up after three minutes Counter ptimeout = new Counter(); while(!portFound && ptimeout.elapsed() < 180000) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // special case. ttyS0 is not available to us on this server. if (!portId.isCurrentlyOwned() && !portId.getName().equals("/dev/ttyS0")) { gLog.debug(lognm + ": Found port " + portId.getName()); try { serialPort = (RXTXPort) portId.open("AguaModem", 10000); } catch (Exception e) { gLog.error(lognm + ": Port " + portId.getName() + " will not open."); gLog.error(e.getMessage()); continue; } AguaModem aguamodem = new AguaModem(); portFound = true; break; } gLog.debug(lognm + ": Port " + portId.getName() + " is busy"); } } } I am wondering about the isCurrentlyOwned method. Does this actually tell me whether a port is currently being used by another process? TIA, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From fabioanjos at gmail.com Fri Nov 2 04:59:58 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 07:59:58 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Message-ID: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/9009eb1d/attachment-0016.html From netbeans at gatworks.com Fri Nov 2 06:28:13 2007 From: netbeans at gatworks.com (U. George) Date: Fri, 02 Nov 2007 08:28:13 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <472B17DD.1050508@gatworks.com> It should normally block ( unless eof / event ) . so its a :{ whats the device ( to recreate if possible ) and how do u open. > My question is, is there a way to make in.read block the thead until > there's something to read? > From fabioanjos at gmail.com Fri Nov 2 06:34:46 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 09:34:46 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > On 11/1/07, Andre-John Mas wrote: > > > > Fabio, > > > > Turns out there was a small error in my example. The test should be: > > > > (numBytes = in.read(buffer)) > -1 > > > > This is because -1 indicates an end of file (end of data stream) > > > > Andre > > > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > > > Hi, > > > > > > I was using SerialEventListener in my project. But, as was said > > > here, id doesnt work very well with virtual serial ports. > > > So, I changed the strategy using the code posted here in this thread: > > > > > > try{ > > > in = port.getInputStream(); > > > out = port.getOutputStream(); > > > int numBytes = 0; > > > while(active){ > > > > > > byte[] buffer = new byte[10]; > > > > > > while ( (numBytes = in.read(buffer)) > 0) > > > { > > > String dataValue = new String(buffer,0,numBytes); > > > processInput(dataValue); > > > } > > > > > > if(numBytes==-1){ > > > break; > > > } > > > > > > Thread.sleep(50); > > > } > > > > > > }catch(IOException e){ > > > logger.info("falha de comunicacao "+ > > > getReceptor().getPort() ); > > > > > > }catch(InterruptedException e){ > > > logger.info ("Interrompendo leitura da porta "+ > > > getReceptor().getPort() ); > > > } > > > > > > The thing is that in my tests I could notice that in.read(buffer) > > > never blocks. Even when there's nothing to read. Instead of blocking > > > when there's nothing to read it returns 0. > > > > > > So, my questions are: > > > > > > 1. Am I doing something wrong? > > > 2. If not, wouldnt this decrease performance? (the thread would be > > > locked in a loop that does nothing.) > > > 3. Is there a better way to do the job? > > > > > > Thanks in advance!! > > > > > > F?bio > > > -------- > > > > > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > > 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 > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > > > > > -- > > > Atenciosamente, > > > F?bio Cristiano dos Anjos > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/5306c4b1/attachment-0016.html From nick.circelli at infrasafe.com Fri Nov 2 07:01:17 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Fri, 2 Nov 2007 08:01:17 -0500 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com><29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com><90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca><29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Message-ID: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> I'm pretty sure that not blocking has to do with you virtual ports. Cause it should block. Maybe you should try: while ((numBytes = in.available()) > 0) { If (numBytes > buffer.length) { numBytes = buffer.length; // in case you have buffer overflow } numBytes = in.read(buffer, 0 , numBytes)); String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } Also, just for optimization, I'd move that byte[] buffer = new byte[10]; out of the while since you don't need to reallocate it every iteration. ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of F?bio Cristiano dos Anjos Sent: Friday, November 02, 2007 8:35 AM To: RXTX Developers and Users Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream (); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas < ajmas at sympatico.ca > wrote: Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info ("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Atenciosamente, F?bio Cristiano dos Anjos -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/4de7f6a3/attachment-0016.html From fabioanjos at gmail.com Fri Nov 2 07:36:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 10:36:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> Message-ID: <29788b250711020636q1588c88fgaa5e27f5504164fb@mail.gmail.com> Hi Nick, Actually, it doesnt block for physical ports too. And, the method avaiable does not block either, so when there's nothing avaiable the loop ends and the thread stops lintening to the port. But I did some more test with serialEventListener, and now its working. I realy dont know what I've done to get it working. I just start woking as soon as I decided to test it again. It was said here that serialEventListener is not reliable for virtual serial ports. Is there another way to read it, without compromising performance? Tanks again!! F?bio ------- On 11/2/07, Nick Circelli wrote: > > I'm pretty sure that not blocking has to do with you virtual ports. > Cause it should block. > > Maybe you should try: > > > > while ((numBytes = in.available()) > 0) > > { > > If (numBytes > buffer.length) { > > numBytes = buffer.length; // in case you have buffer overflow > > } > > numBytes = in.read(buffer, 0 , numBytes)); > > String dataValue = new String(buffer,0,numBytes,"ASCII"); > > processInput(dataValue); > > } > > > > Also, just for optimization, I'd move that byte[] buffer = new > byte[10]; > > out of the while since you don't need to reallocate it every iteration. > > > ------------------------------ > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On Behalf > Of *F?bio Cristiano dos Anjos > *Sent:* Friday, November 02, 2007 8:35 AM > *To:* RXTX Developers and Users > *Subject:* Re: [Rxtx] serialEvent(SerialPortEvent event) never be > triggered > > > > Hi, > > I think i missunderstand something here. > The code you post here was meant to be used inside serialEvent method, > right? > > The think is, that i cannot user SerialEventListener to read serial ports, > because i need to read virual serial ports and id does not behaves well, as > said here before. serialEvent is never triggered. > > So what I quit using SerialEventListener and created a thread to listen to > the port: > > public void run(){ > try{ > in = port.getInputStream(); > out = port.getOutputStream (); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new > String(buffer,0,numBytes,"ASCII"); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ getReceptor().getPort() > ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > } > > > So, the problem is that in.read(buffer) always returns 0 when there is > nothing to read, instead of blocking the flow, and the thread becames locked > in the loop. > > I hope you can help me solve this. > > Thanks in advance! > > F?bio > -------- > > On 11/2/07, *F?bio Cristiano dos Anjos* wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > > > On 11/1/07, *Andre-John Mas* < ajmas at sympatico.ca> wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info ("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/571df6ea/attachment-0015.html From tjarvi at qbang.org Fri Nov 2 08:32:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Nov 2007 08:32:15 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: References: Message-ID: On Fri, 2 Nov 2007, Greg Johnson wrote: > Hi Trent, folks, > Having a single rxtx that is suitable for commercial uses and hobbyists both > would be a great idea? Perhaps it would be worth submitting rxtx as a > proposal to Codehaus - they not only provide excellent tools (Jira (bug > tracker), Confluence (wiki)) but also support build management ( > maestro, continuum, bamboo). Relying on your personal machine (btw, frii.com > / rxtx.org is down again?) seems like a burden you shouldn't have to shoulder > alone. Hi Greg, There may be a little confusion here. There is no need to have two seperate rxtx releases. What I'm trying to encourage is a discussion between some of the people responsible for making sure rxtx does not break their products each release. Usually these people are interested in testing a set of functionality their product depends upon. They do not work with rxtx code but rather traps to catch when rxtx developers break something. This goes on all the time in isolated labs. There are many services that offer to do various pieces of a project for you if you... Anyone is free to do the 'if you' portion with rxtx and see how it goes. I'm actually interested in doing less of that than more. The rxtx.org work I do just happens to overlap with other things I do for personal/family use. The reason I suggest the amazon solution is that anyone can take full control of the environment for a day and it costs less than a package of gum without causing harm to what anyone else is doing. I assume the down question was with respect to a mod_security setting that has been resolved. If not, please post a url to the problem. -- Trent Jarvi tjarvi at qbang.org From nsayer at kfu.com Sat Nov 3 20:17:49 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 19:17:49 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? Message-ID: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Has anyone got RXTX working with an app under Leopard? My app hangs on port open (it works fine with Tiger). The relevant thread looks like this in the activity monitor: 1536 JVM_InvokeMethod 1536 0x48ccd0 1536 0x46f8a0 1536 0x4c3ff4 1536 0x4c4284 1536 0x357d160 1536 0x357faac 1536 Java_gnu_io_RXTXPort_open 1536 open $NOCANCEL$UNIX2003 1536 open $NOCANCEL$UNIX2003 From ajmas at sympatico.ca Sat Nov 3 22:02:04 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 00:02:04 -0400 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> RXTX works for me with Leopard. I am currently using it communicate with a Bluetooth GPS. What computer and device are you trying to use? Is the driver for your serial device compatible with MacOS X 10.5? Andre On 3-Nov-07, at 22:17 , Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From nsayer at kfu.com Sat Nov 3 22:17:47 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 21:17:47 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> Message-ID: <1720F723-3643-438C-B3AB-E09A67536977@kfu.com> On Nov 3, 2007, at 9:02 PM, Andre-John Mas wrote: > RXTX works for me with Leopard. I am currently using it communicate > with a Bluetooth GPS. > > What computer and device are you trying to use? Is the driver for > your serial device compatible with MacOS X 10.5? An Intel mac mini The FTDI USB serial driver an XMPCR, which is just a fancy serial controlled radio and an FTDI usb-to-serial chip I've successfully used the FTDI driver with another FTDI device in another context. > > > Andre > > On 3-Nov-07, at 22:17 , Nick Sayer wrote: > >> Has anyone got RXTX working with an app under Leopard? >> >> My app hangs on port open (it works fine with Tiger). The relevant >> thread looks like this in the activity monitor: >> >> 1536 JVM_InvokeMethod >> 1536 0x48ccd0 >> 1536 0x46f8a0 >> 1536 0x4c3ff4 >> 1536 0x4c4284 >> 1536 0x357d160 >> 1536 0x357faac >> 1536 >> Java_gnu_io_RXTXPort_open >> 1536 open >> $NOCANCEL$UNIX2003 >> 1536 open >> $NOCANCEL$UNIX2003 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From racecar at gmail.com Sat Nov 3 22:25:53 2007 From: racecar at gmail.com (Kevin Mateo Lim) Date: Sat, 3 Nov 2007 21:25:53 -0700 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: Message-ID: I am alternating between two errors. After i run the macosx_setup.command, "everyone" is set to Read only in /var/lock. I notice in the terminal that the group for these perms is _uucp, not uucp. In that state, I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 check_group_uucp(): error testing lock file creation Error details:Permission deniedcheck_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException : Error inside Serial.() at processing.serial.Serial.errorMessage(Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.( Serial.java:102) at Temporary_829_3245.setup(Temporary_829_3245.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java :690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) Then, I hand edit the "everyone" permissions for /var/lock/ to Read and Write (note /var/spool/uucp is Read/Write in all cases, and doesn't change). I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX uucp_lock() /var/lock/LK.003.009.000 is there gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException: Error inside Serial.() at processing.serial.Serial.errorMessage (Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.(Serial.java:102) at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java:690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) See here: http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071103/f1a2c467/attachment-0014.html From greg.johnson at manchester.ac.uk Sun Nov 4 02:31:13 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sun, 4 Nov 2007 10:31:13 +0100 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <28B5E0A0-0802-4C74-AC21-87ED35F3B9A2@manchester.ac.uk> Hi Nick, I also had problems initially with Leopard, but it was resolved by reinstalling the serial USB driver (FTDI in my case). The symptoms were a non-detection of any ports (but I twigged when I tried ZTerm and it had the same problem). Good luck! Cheers, greg PS I did a "Archive and install" which may be the reason my FTDI driver had disappeared - I don't think the driver has changed for 10.5 ------------------------------------------------------------------------- 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 4 Nov 2007, at 03:17, Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Sun Nov 4 13:01:12 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 15:01:12 -0500 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: Message-ID: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Hi, You will need to get the 2.1-8 code from CVS. See the FAQ for more information: http://rxtx.qbang.org/wiki/index.php/FAQ Andre On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > I am alternating between two errors. > > After i run the macosx_setup.command, "everyone" is set to Read only > in /var/lock. I notice in the terminal that the group for these > perms is _uucp, not uucp. > > In that state, I get this error: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > check_group_uucp(): error testing lock file creation Error > details:Permission deniedcheck_lock_status: No permission to create > lock file. > please see: How can I use Lock Files with rxtx? in INSTALL > gnu.io.PortInUseException: Unknown Application > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > java.lang.RuntimeException : Error inside Serial.() > > at processing.serial.Serial.errorMessage(Serial.java:583) > > at processing.serial.Serial.(Serial.java:148) > > at processing.serial.Serial.( Serial.java:102) > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > at processing.core.PApplet.run(PApplet.java:1556) > > at java.lang.Thread.run(Thread.java:613) > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > and Write (note /var/spool/uucp is Read/Write in all cases, and > doesn't change). I get this error: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > gnu.io.PortInUseException: Unknown Application > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > java.lang.RuntimeException: Error inside Serial.() > > at processing.serial.Serial.errorMessage (Serial.java:583) > > at processing.serial.Serial.(Serial.java:148) > > at processing.serial.Serial.(Serial.java:102) > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > at processing.core.PApplet.run(PApplet.java:1556) > > at java.lang.Thread.run(Thread.java:613) > > See here: > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From netbeans at gatworks.com Sun Nov 4 14:33:35 2007 From: netbeans at gatworks.com (U. George) Date: Sun, 04 Nov 2007 16:33:35 -0500 Subject: [Rxtx] #ifndef TIOCSERGETLSR Message-ID: <472E3AAF.7050709@gatworks.com> For Linux, it seems that you need the code for both *having* a TIOCSERGETLSR, and *not having* a TIOCSERGETLSR. Maybe the ioctl exists system wide, but not necessarily for the device driver itself ( always returns -1 ) . Are there systems that have a *functioning* TIOCSERGETLSR for all their devices? Then this would be the case where the "#ifndef TIOCSERGETLSR" directive could be useful is eliminating the unnecessary code and tests. And for those systems that dont have a TIOCSERGETLSR, then the code for TIOCSERGETLSR can be eliminated. It would be a simple case to have, as a foundation, all the code to simulate the missing TIOCSERGETLSR ioctl. If the system does have the ioctl, then that code can be ifdef'd in, and co-exist with the functionality of the code that simulates the missing TIOCSERGETLSR ioctl. From racecar at gmail.com Sun Nov 4 17:30:19 2007 From: racecar at gmail.com (Kevin Mateo Lim) Date: Sun, 4 Nov 2007 17:30:19 -0700 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: the README.OSX reads: Put libSerial.jnilib in the directory of the application (the JavaVM will find it there). Add RXTXComm.jar to the application classpath or include the classes in the application jar. (Some applications already include the RXTX classes in their application jar, in which case only the file libSerial.jnilib is required). I can't find libSerial.jnilib I put librxtxSerial.jnilib into my Processing /libraries/serial/library/ directory. Yet it still sees the old version: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 On 11/4/07, Andre-John Mas wrote: > > Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > 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/20071104/c0a83f91/attachment-0013.html From ajmas at sympatico.ca Sun Nov 4 17:41:47 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 19:41:47 -0500 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> If you are wanting it to be available for all applications, - for all users: /Library/Java/Extensions - for your user: ~/Library/Java/Extensions Or just for your application, then it should be in the same directory from which yo are launching your application. If you are getting the 2.1-8 source, then the library built is called: librxtxSerial.jnilib despite what the docs say. Andre On 4-Nov-07, at 19:30 , Kevin Mateo Lim wrote: > > the README.OSX reads: > Put > libSerial.jnilib > in the directory of the application (the JavaVM will find it there). > Add > RXTXComm.jar > to the application classpath or include the classes in the > application jar. > (Some applications already include the RXTX classes in their > application jar, > in which case only the file libSerial.jnilib is required). > > > I can't find libSerial.jnilib > I put librxtxSerial.jnilib into my Processing /libraries/serial/ > library/ directory. > > Yet it still sees the old version: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > On 11/4/07, Andre-John Mas wrote: Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial .(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay (PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > From bschlining at gmail.com Sun Nov 4 19:46:23 2007 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 4 Nov 2007 18:46:23 -0800 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> Message-ID: > > Or just for your application, then it should be in the same directory > from which yo are launching your application. Just wanted to add one more way of specifying the native lib location... If you don't want to define it globally by putting it in /Library/Java/Extensions (and you don't, it's a very very bad practice) you can also specify the location of the native library when starting the JVM by specifying the 'java.library.path' property. For example: java -Djava.library.path=/Path/To/Directory/With/RXTX/Library YourMainClass -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071104/c5af6980/attachment-0013.html From greg.johnson at manchester.ac.uk Mon Nov 5 01:39:02 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Mon, 5 Nov 2007 09:39:02 +0100 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: The 2.1-8 code reports 2.1-7, hence your (and my) confusion. But as long as you've removed all traces of the old library, it really _is_ 2.1-8. And if you specify the library path to the VM, don't make my mistake (on OSX at least) - you need to respecify the entire library path it had by default, as the command line argument replaces the path, rather than appending to it. 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 5 Nov 2007, at 01:30, Kevin Mateo Lim wrote: > > the README.OSX reads: > Put > libSerial.jnilib > in the directory of the application (the JavaVM will find it there). > Add > RXTXComm.jar > to the application classpath or include the classes in the > application jar. > (Some applications already include the RXTX classes in their > application jar, > in which case only the file libSerial.jnilib is required). > > > I can't find libSerial.jnilib > I put librxtxSerial.jnilib into my Processing /libraries/serial/ > library/ directory. > > Yet it still sees the old version: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > On 11/4/07, Andre-John Mas wrote: > Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial .(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay (PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > 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 HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071105/7f50506d/attachment-0013.html From cyrille.dumont at tatexpress.fr Mon Nov 5 05:46:03 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 05 Nov 2007 13:46:03 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: References: <472727F1.1000704@tatexpress.fr> Message-ID: <472F108B.2090101@tatexpress.fr> Thanks a lot for your solution ... but I'm not a expert in JAVA ... (sorry) For the moment I've this function : """ public void serialEvent(SerialPortEvent e) { StringBuffer inputBuffer = new StringBuffer(); int newData = 0; switch (e.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } //-- Manag. Data from Scanner this.MngDataScanner(inputBuffer.toString()); break; case SerialPortEvent.BI:; //-- Break Received } } """ How can I do what you write ? ( maybe a simple ex ? ) PS : I don't know the PDF417 size (could be, for example, 338 char, or 500 ... ; what I know is that it can't be more than 800 char) Thanks in advance. Best regards. Trent Jarvi a ?crit : > 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 Martin.Oberhuber at windriver.com Mon Nov 5 08:47:50 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 5 Nov 2007 16:47:50 +0100 Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> Hi Trent, are the interestes of hobbyists really so different from commercial ones? Both should be interested in high quality and innovation the like. I haven't seen too many Open Source projects from the "inside" but those that I have seen did not have separate mailing lists for quality/testing/qa versus innovation/development. What I have seen with the Open Source projects that one would call "successful" is a good deal of process around automated builds, automated unit tests, predictable release dates and milestones, and policies around commiting/contributing/reviewing changes. I think that all of these benefit commercial users and hobbyists the like. If you were just asking about who's interested in discussing changes to foster more quality, count me in. I'm just not sure whether discussing these on a separate mailing list or other channel is the right thing to do. Cheers, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From toupsz at cs.tamu.edu Tue Nov 6 14:27:04 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 15:27:04 -0600 Subject: [Rxtx] reading TTL level signals from serial? Message-ID: Dear RXTX community- I've been using RXTX to handle communicating with several hardware devices in Java (a GPS and some custom audio circuitry for my dissertation work). I have a new, high-accuracy GPS which only communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there any way to communicate with this device using RXTX, perhaps by modding the native code for Windows? If so, does anyone have any tips on how to do it? Has it perhaps already been done? Another option is for me to invert / amplify the signal in hardware, but this is difficult for me to pull off due to the sensitivity of the electronics involved...I'll likely end up using a much less accurate piece of equipment rather than go that far! If anyone could help out, I'd really appreciate it! Thanks! -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/b6c59c2b/attachment-0011.html From netbeans at gatworks.com Tue Nov 6 14:55:22 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 06 Nov 2007 16:55:22 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: Message-ID: <4730E2CA.3090009@gatworks.com> This is really a hardware issue. Is there any device ( ie the serial port ) on your computer that will accept the voltage signals ( and load ) that your device produces? Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it happen safely ( ie u dont cook the GPS device ) I have a new, high-accuracy GPS which only > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there > any way to communicate with this device using RXTX, From toupsz at cs.tamu.edu Tue Nov 6 15:14:01 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 16:14:01 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4730E2CA.3090009@gatworks.com> References: <4730E2CA.3090009@gatworks.com> Message-ID: Actually, the device runs over USB, but shows up as a virtual serial port and is outputting these signals. The software that comes with the device (a u-blox ANTARIS 4 eval kit) is able to communicate. RXTX is able to detect and properly configure the port, but does not get any of the data from it. :-/ It seems like there must be some way to do it (obviously, ublox knows how)... -Zach On Nov 6, 2007 3:55 PM, U. George wrote: > This is really a hardware issue. > Is there any device ( ie the serial port ) on your computer that will > accept the voltage signals ( and load ) that your device produces? > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it > happen safely ( ie u dont cook the GPS device ) > > > I have a new, high-accuracy GPS which only > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there > > any way to communicate with this device using RXTX, > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/15ae7a0b/attachment-0011.html From keithvz at verizon.net Tue Nov 6 16:16:55 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 06 Nov 2007 18:16:55 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> Message-ID: <4730F5E7.1030704@verizon.net> Zach Toups wrote: > On Nov 6, 2007 3:55 PM, U. George > wrote: > > This is really a hardware issue. > Is there any device ( ie the serial port ) on your computer that will > accept the voltage signals ( and load ) that your device produces? > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it > happen safely ( ie u dont cook the GPS device ) > > > I have a new, high-accuracy GPS which only > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is > there > > any way to communicate with this device using RXTX, > _______________________________________________ As UGeorge intimated, it's a hardware issue. If your device outputs TTL level voltages, and your USB to serial converter is RS-232, then you've got a physical hardware differences. Inverted leads and voltage issues are mainly the problem. MAXIM makes a neat little chip called the MAX233 (better than the 232, no extern caps required) You can't solve this in software. Now, there are TTL level compatible USB to serial converters available, I happen to be using one right now. This unit below is from a UK company (there might be sources in the US) http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm Parallax makes one that does 3.3 and 5v http://www.parallax.com/detail.asp?product_id=32201 (but only supports RX, TX, GND, AND DTR towards device) (i've tested a variant of the unit above, and it works with RXTX) In both cases, you'll need some creative wiring depending on the interface on your GPS. Hope this helps Keith From toupsz at cs.tamu.edu Tue Nov 6 16:53:01 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 17:53:01 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4730F5E7.1030704@verizon.net> References: <4730E2CA.3090009@gatworks.com> <4730F5E7.1030704@verizon.net> Message-ID: Yeah...I used an FTDI chip to handle USB/serial conversion on the audio equipment I built. I'm leery of trying to build a board for this ublox GPS due to all the grounding/shielding issues around it. Anyway, I apreciate the help...just sad that I can't handle the problem in software! Ublox did send me the source code for their USB drivers...but as a Java programmer, it's a bit tough for me to sort out. ;) Thanks again! -Zach On Nov 6, 2007 5:16 PM, Keith Monahan wrote: > Zach Toups wrote: > > > On Nov 6, 2007 3:55 PM, U. George > > wrote: > > > > This is really a hardware issue. > > Is there any device ( ie the serial port ) on your computer that > will > > accept the voltage signals ( and load ) that your device produces? > > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make > it > > happen safely ( ie u dont cook the GPS device ) > > > > > > I have a new, high-accuracy GPS which only > > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is > > there > > > any way to communicate with this device using RXTX, > > _______________________________________________ > > As UGeorge intimated, it's a hardware issue. > > If your device outputs TTL level voltages, and your USB to serial > converter is RS-232, then you've got a physical hardware differences. > Inverted leads and voltage issues are mainly the problem. MAXIM makes a > neat little chip called the MAX233 (better than the 232, no extern caps > required) > > You can't solve this in software. > > Now, there are TTL level compatible USB to serial converters available, > I happen to be using one right now. > > This unit below is from a UK company (there might be sources in the US) > > http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm > > Parallax makes one that does 3.3 and 5v > > http://www.parallax.com/detail.asp?product_id=32201 > (but only supports RX, TX, GND, AND DTR towards device) > > (i've tested a variant of the unit above, and it works with RXTX) > > In both cases, you'll need some creative wiring depending on the > interface on your GPS. > > Hope this helps > > Keith > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/06e88ad4/attachment-0011.html From netbeans at gatworks.com Tue Nov 6 17:14:01 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 06 Nov 2007 19:14:01 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> <4730F5E7.1030704@verizon.net> Message-ID: <47310349.5000406@gatworks.com> what gps chipset do u have? > Ublox did send me the source code for their USB drivers...but as a Java > programmer, it's a bit tough for me to sort out. ;) From Steffen.DETTMER at ingenico.com Wed Nov 7 03:10:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 7 Nov 2007 11:10:01 +0100 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> Message-ID: <20071107101000.GN10978@elberon.bln.de.ingenico.com> * Zach Toups wrote on Tue, Nov 06, 2007 at 16:14 -0600: > Actually, the device runs over USB, but shows up as a virtual > serial port and is outputting these signals. Ahh, so what you want is to use rxtx on the serial port that is created by the driver and mapped maybe as some COM8 or whatever? I this case then IMHO it would be no hardware question but maybe a problem in your application, or some driver or indeed a rxtx issue. > The software that > comes with the device (a u-blox ANTARIS 4 eval kit) is able to > communicate. Is it sure that this software is really using the virtual serial port and only this port? oki, Steffen -- About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Wed Nov 7 04:59:10 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 06:59:10 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <20071107101000.GN10978@elberon.bln.de.ingenico.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> Message-ID: <4731A88E.6080705@gatworks.com> >> The software that >> comes with the device (a u-blox ANTARIS 4 eval kit) is able to >> communicate. > > Is it sure that this software is really using the virtual serial > port and only this port? > I have tried to read the docs. I have yet to find any explanation on a (windoz) device driver for this device ( the usb device ). That magic is not explained. For a developer thats important magic. Maybe a call to their support team is in order? From netbeans at gatworks.com Wed Nov 7 05:01:38 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 07:01:38 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <20071107101000.GN10978@elberon.bln.de.ingenico.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> Message-ID: <4731A922.7@gatworks.com> Steffen DETTMER wrote: > * Zach Toups wrote on Tue, Nov 06, 2007 at 16:14 -0600: >> Actually, the device runs over USB, but shows up as a virtual BTW: it seems that I am not getting all the Rxtx mail. Is there still a problem? From toupsz at cs.tamu.edu Wed Nov 7 07:36:20 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Wed, 7 Nov 2007 08:36:20 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4731A88E.6080705@gatworks.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> <4731A88E.6080705@gatworks.com> Message-ID: When I emailed them about this issue, they sent me their WinCE drivers, which are apparently based on this open source driver: http://www.yetanotherhomepage.com/j7xx/j7xx.html?/j7xx/software/util/usbdriver.html These include srcdll, and x86 subfolders, though it's not 100% clear to me that these are useful. The ublox communication suite appears to only communicate with serial ports...I've communicated with the ublox on two different comm ports (one with the serial adapter plugged into the serial port, one with the main USB connection), as well as a Garmin bluetooth GPS (which comes up as a bluetooth serial device). I'm not well versed in code this close to the hardware, but it seems to me that if you're running a virtual serial port, then you're virtually controlling the "voltages" that come in on this "port"...so why would they be "ttl level"? :-/ Shouldn't the USB driver be able to interpret the signals in whatever way it wants and just supply software with the binary interpretation? Thanks for all the help, guys, it's really appreciated! -Zach On Nov 7, 2007 5:59 AM, U. George wrote: > > >> The software that > >> comes with the device (a u-blox ANTARIS 4 eval kit) is able to > >> communicate. > > > > Is it sure that this software is really using the virtual serial > > port and only this port? > > > > I have tried to read the docs. I have yet to find any explanation on a > (windoz) device driver for this device ( the usb device ). That magic > is not explained. For a developer thats important magic. Maybe a call > to their support team is in order? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071107/18a13314/attachment-0010.html From netbeans at gatworks.com Wed Nov 7 08:55:55 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 10:55:55 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> <4731A88E.6080705@gatworks.com> Message-ID: <4731E00B.9030902@gatworks.com> There are 2 components to talking to hardware. There is the electrical specification, and then there is the software specification. there is the rs232 specification, parallel port specification, and the USB electrical specification. Generally these are used to plug in the various devices, and hook up electrically. Then there is the software side. There is the device driver, a software component that sits somewhere in the kernel that handles the USB ( in your case ) controller. The device driver generally does not care about the electrical component. There are various chips that handle USB signals, and these chips have I/O addresses so that signals and data can be properly routed. There is also the side that communicates to the user via the COM port device-name. The device driver that you mentioned is for the "Support PL2303 serial chip". This device driver, which hopefully works, handles the USB chip, and eventually recognzes the gps device, and hopefully creates an COM port so the user can open up and communicate. These are a lot of "HOPES". Since u have the web address of the device driver, and developer, I would think that the developer, and any docs, might be better able to help u to first determine if the GPS device is recognized, and the COM port ( maybe its called by another name ) is created, as per documentation. > > These include srcdll, and x86 subfolders, though it's not 100% clear to > me that these are useful. From tjarvi at qbang.org Sat Nov 10 17:46:13 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Nov 2007 17:46:13 -0700 (MST) Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 5 Nov 2007, Oberhuber, Martin wrote: > Hi Trent, > > are the interestes of hobbyists really so different > from commercial ones? Both should be interested in > high quality and innovation the like. > > I haven't seen too many Open Source projects from the > "inside" but those that I have seen did not have > separate mailing lists for quality/testing/qa > versus innovation/development. > > What I have seen with the Open Source projects that > one would call "successful" is a good deal of > process around automated builds, automated unit > tests, predictable release dates and milestones, > and policies around commiting/contributing/reviewing > changes. > > I think that all of these benefit commercial users > and hobbyists the like. > > If you were just asking about who's interested in > discussing changes to foster more quality, count > me in. I'm just not sure whether discussing these > on a separate mailing list or other channel is the > right thing to do. > Hi Martin, There are two issues I'm thinking about. The first is the generic unit testing and quality initiatives required to move rxtx forward. The second is the inevitable fact that rxtx connects to external hardware. The discussion deals with a different set of problems. Here is a simple example of what I'm getting at. We have the capability of setting custom baud rates in rxtx. We may be interested in seeing regressions in rxtx, the C library or the kernel. Some people may be doing some tests with loopback connections. These will always work even if the baud rate is not set to the expected value. Some people may use null modems between two ports. This may be able to catch the problem but not always. Will the build machines be able to test this? (no - for a few reasons) Will people be trying to catch these type of regressions? (yes) What type of coverage does the community have in the end? (?) We could include the discussions in the same list or another equally open list that may be of interest to some folks that deal with these types of problems on a regular basis. -- Trent Jarvi tjarvi at qbang.org From timlow84 at gmail.com Mon Nov 12 00:31:17 2007 From: timlow84 at gmail.com (Timothy Low) Date: Mon, 12 Nov 2007 15:31:17 +0800 Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> Message-ID: <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> ---------- Forwarded message ---------- From: Timothy Low Date: Nov 12, 2007 3:02 PM Subject: Building RXTX From Source To: taj at www.linux.org.uk Cc: ferdinand.tang at tangs.net, Timothy Low , chweehuat.ng at tangs.net Hi Trent, I tried building RXTX from source, and I got this error. I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm trying to get the necessary ".so" files to use for my serial port communication through java. My linux kernal information is: *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 x86_64 x86_64 x86_64 GNU/Linux* I'll most glad if you can provide me some direction on this. Thanks ! ---------------- [root at smsgateway rxtx-2.0-7pre1]# ./configure checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu configure: WARNING: Trying libtool. If the following fails install libtool checking for gcc... gcc checking for C compiler default output... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking for ld used by GCC... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking for a sed that does not truncate output... /bin/sed checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking command to parse /usr/bin/nm -B output... ok checking how to run the C preprocessor... gcc -E checking for egrep... grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for ranlib... ranlib checking for strip... strip checking for objdir... .libs checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.lo... yes checking if gcc supports -fno-rtti -fno-exceptions... yes checking whether the linker (/usr/bin/ld) supports shared libraries... yes checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking dynamic linker characteristics... GNU/Linux ld.so checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no checking whether -lc should be explicitly linked in... no creating libtool checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking for style of include used by make... GNU checking dependency style of gcc... none checking fcntl.h usability... yes checking fcntl.h presence... yes checking for fcntl.h... yes checking sys/fcntl.h usability... yes checking sys/fcntl.h presence... yes checking for sys/fcntl.h... yes checking sys/file.h usability... yes checking sys/file.h presence... yes checking for sys/file.h... yes checking sys/time.h usability... yes checking sys/time.h presence... yes checking for sys/time.h... yes checking sys/signal.h usability... yes checking sys/signal.h presence... yes checking for sys/signal.h... yes checking signal.h usability... yes checking signal.h presence... yes checking for signal.h.. . yes checking termios.h usability... yes checking termios.h presence... yes checking for termios.h... yes checking asm/termbits.h usability... yes checking asm/termbits.h presence... yes checking for asm/termbits.h... yes checking grp.h usability... yes checking grp.h presence... yes checking for grp.h... yes checking pwd.h usability... yes checking pwd.h presence... yes checking for pwd.h... yes checking whether gcc needs -traditional... no checking whether to enable maintainer-specific portions of Makefiles... no /usr/java/jdk1.5.0_13 configure: WARNING: using JAVA_HOME environmental variable adjusted java.home is /usr/java/jdk1.5.0_13 checking os.name Linux checking os.arch i386 checking java.vendor Sun Microsystems Inc. checking java.version 1.5.0_13 checking os.version 2.6.18-8.el5xen comm.jar appears to be installed already. conftest.c: In function 'main': conftest.c:6: warning: incompatible implicit declaration of built-in function 'printf' conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:6: error: (Each undeclared identifier is reported only once conftest.c:6: error: for each function it appears in.) conftest.c:6: error: expected ')' before string constant conftest.c:7: warning: incompatible implicit declaration of built-in function 'exit' ./configure: line 9649: ./conftest: No such file or directory ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected conftest.c: In function 'main': conftest.c:5: warning: incompatible implicit declaration of built-in function 'printf' conftest.c:10: warning: incompatible implicit declaration of built-in function 'exit' configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status : config.h is unchanged config.status: executing depfiles commands [root at smsgateway rxtx-2.0-7pre1]# make install /usr/java/jdk1.5.0_13/bin/javac -classpath .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d /home/jboss/sources/rxtx- 2.0-7pre1/ -O /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java /home/jboss/sources/rxtx-2.0-7pre1/./src/UnSupportedLoggerException.java /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o /home/jboss/sources/rxtx-2.0-7pre1/x86_64-unknown-linux-gnu/SerialImp.lo /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'init_threads': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: cast from pointer to integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_nativeDrain': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: cast to pointer from integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'read_byte_array': /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: cast to pointer from integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_readArray': /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: comparison is always false due to limited range of data type /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_readTerminatedArray': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: comparison is always false due to limited range of data type mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial- 2.0.7pre1.* gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so -o .libs/librxtxSerial-2.0.7pre1.so (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.0.7pre1.so librxtxSerial.so) creating librxtxSerial.la (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la librxtxSerial.la) gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/ParallelImp.lo /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function 'Java_javax_comm_LPRPort_readArray': /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: comparison is always false due to limited range of data type rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* .libs/librxtxParallel-2.0.7pre1.* gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so -o .libs/librxtxParallel- 2.0.7pre1.so (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.0.7pre1.so librxtxParallel.so) creating librxtxParallel.la (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la librxtxParallel.la) make all-am make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' libtool: install: `x86_64-unknown-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 ------------- Regards, Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071112/27758c3c/attachment-0006.html From tjarvi at qbang.org Mon Nov 12 01:02:09 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Nov 2007 01:02:09 -0700 (MST) Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> Message-ID: On Mon, 12 Nov 2007, Timothy Low wrote: > > Hi Trent, Hi Tim, Comments are inline. As I mentioned off the list, rxtx 2.0 is on the edge of deprecation. We can get it working but this is not the path of least resistance for future work. You will probably need to bounce another round of questions off the list. The following is intended to isolate the problem. > > I tried building RXTX from source, and I got this error. > > > I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm trying > to get the necessary ".so" files to use for my serial port communication > through java. > My linux kernal information is: > > *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 x86_64 > x86_64 x86_64 GNU/Linux* > > I'll most glad if you can provide me some direction on this. Thanks ! > > ---------------- > [root at smsgateway rxtx-2.0-7pre1]# ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > checking for C compiler default output... a.out > checking whether the C compiler works... yes > checking whether we are cross compiling... no > checking for suffix of executables... > checking for suffix of object files... o > checking whether we are using the GNU C compiler... yes > checking whether gcc accepts -g... yes > checking for gcc option to accept ANSI C... none needed > checking for ld used by GCC... /usr/bin/ld > checking if the linker (/usr/bin/ld) is GNU ld... yes > checking for /usr/bin/ld option to reload object files... -r > checking for BSD-compatible nm... /usr/bin/nm -B > checking for a sed that does not truncate output... /bin/sed > checking whether ln -s works... yes > checking how to recognise dependent libraries... pass_all > checking command to parse /usr/bin/nm -B output... ok > checking how to run the C preprocessor... gcc -E > checking for egrep... grep -E > checking for ANSI C header files... yes > checking for sys/types.h... yes > checking for sys/stat.h... yes > checking for stdlib.h... yes > checking for string.h... yes > checking for memory.h... yes > checking for strings.h... yes > checking for inttypes.h... yes > checking for stdint.h... yes > checking for unistd.h... yes > checking dlfcn.h usability... yes > checking dlfcn.h presence... yes > checking for dlfcn.h... yes > checking for ranlib... ranlib > checking for strip... strip > checking for objdir... .libs > checking for gcc option to produce PIC... -fPIC > checking if gcc PIC flag -fPIC works... yes > checking if gcc static flag -static works... yes > checking if gcc supports -c -o file.o... yes > checking if gcc supports -c -o file.lo... yes > checking if gcc supports -fno-rtti -fno-exceptions... yes > checking whether the linker (/usr/bin/ld) supports shared libraries... yes > checking how to hardcode library paths into programs... immediate > checking whether stripping libraries is possible... yes > checking dynamic linker characteristics... GNU/Linux ld.so > checking if libtool supports shared libraries... yes > checking whether to build shared libraries... yes > checking whether to build static libraries... no > checking whether -lc should be explicitly linked in... no > creating libtool > checking for a BSD-compatible install... /usr/bin/install -c > checking whether build environment is sane... yes > checking for gawk... gawk > checking whether make sets $(MAKE)... yes > checking for style of include used by make... GNU > checking dependency style of gcc... none > checking fcntl.h usability... yes > checking fcntl.h presence... yes > checking for fcntl.h... yes > checking sys/fcntl.h usability... yes > checking sys/fcntl.h presence... yes > checking for sys/fcntl.h... yes > checking sys/file.h usability... yes > checking sys/file.h presence... yes > checking for sys/file.h... yes > checking sys/time.h usability... yes > checking sys/time.h presence... yes > checking for sys/time.h... yes > checking sys/signal.h usability... yes > checking sys/signal.h presence... yes > checking for sys/signal.h... yes > checking signal.h usability... yes > checking signal.h presence... yes > checking for signal.h.. . yes > checking termios.h usability... yes > checking termios.h presence... yes > checking for termios.h... yes > checking asm/termbits.h usability... yes > checking asm/termbits.h presence... yes > checking for asm/termbits.h... yes > checking grp.h usability... yes > checking grp.h presence... yes > checking for grp.h... yes > checking pwd.h usability... yes > checking pwd.h presence... yes > checking for pwd.h... yes > checking whether gcc needs -traditional... no > checking whether to enable maintainer-specific portions of Makefiles... no > /usr/java/jdk1.5.0_13 > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /usr/java/jdk1.5.0_13 > checking os.name Linux > checking os.arch i386 > checking java.vendor Sun Microsystems Inc. > checking java.version 1.5.0_13 > checking os.version 2.6.18-8.el5xen > comm.jar appears to be installed already. > conftest.c: In function 'main': > conftest.c:6: warning: incompatible implicit declaration of built-in > function 'printf' > conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:6: error: (Each undeclared identifier is reported only once > conftest.c:6: error: for each function it appears in.) > conftest.c:6: error: expected ')' before string constant This is an outdated kernel version check for when headers and kernels could cause problems for rxtx. If we made it past this, then you are OK. > conftest.c:7: warning: incompatible implicit declaration of built-in > function 'exit' > ./configure: line 9649: ./conftest: No such file or directory > ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected It blew up but continues.. > conftest.c: In function 'main': > conftest.c:5: warning: incompatible implicit declaration of built-in > function 'printf' > conftest.c:10: warning: incompatible implicit declaration of built-in > function 'exit' > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status : config.h is unchanged > config.status: executing depfiles commands > [root at smsgateway rxtx-2.0-7pre1]# make install > /usr/java/jdk1.5.0_13/bin/javac -classpath > .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d > /home/jboss/sources/rxtx- 2.0-7pre1/ -O > /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java > /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/UnSupportedLoggerException.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java > Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or > overrides a deprecated API. > Note: Recompile with -Xlint:deprecation for details. > /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* The java jar should be fine now. You may need to change the source files as mentioned below. > gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. > -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g > -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o > /home/jboss/sources/rxtx-2.0-7pre1/x86_64-unknown-linux-gnu/SerialImp.lo > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'init_threads': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: cast > from pointer to integer of different size > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_nativeDrain': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: cast to > pointer from integer of different size > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'read_byte_array': > /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: cast to > pointer from integer of different size As I recall, this was caused by pointers (now 64 bit rather than 32 bit) being stored in java ints (jints). I would look at the diff between the CVS 2.1 SerialImp.c and RXTXPort.java files against 2.0. We did fix those issues. You have a .so file but the different pointer sizes will cause runtime errors. > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_readArray': > /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: > comparison is always false due to limited range of data type > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_readTerminatedArray': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: > comparison is always false due to limited range of data type > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial- > 2.0.7pre1.* > gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so -o > .libs/librxtxSerial-2.0.7pre1.so > (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.0.7pre1.so > librxtxSerial.so) > creating librxtxSerial.la > (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la > librxtxSerial.la) > gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. > -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g > -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o > /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/ParallelImp.lo > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function > 'Java_javax_comm_LPRPort_readArray': > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: > comparison is always false due to limited range of data type > rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* > .libs/librxtxParallel-2.0.7pre1.* > gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so -o > .libs/librxtxParallel- 2.0.7pre1.so > (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.0.7pre1.so > librxtxParallel.so) > creating librxtxParallel.la > (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la > librxtxParallel.la) > make all-am > make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' > make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' > libtool: install: `x86_64-unknown-linux-gnu' must be an absolute directory > name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 A libtool change? Assuming you ran configure && make install in /home/jboss/sources/rxtx- 2.0-7pre1, libtool is looking for /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/.libs/librxtxSerial-2.0.7pre1.so. I think you have this? The file is just being copied to ~JAVA/jre/lib/$(JAVA_ARCH). -- Trent Jarvi tjarvi at qbang.org From sarah_662005 at yahoo.com Mon Nov 12 16:10:28 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Mon, 12 Nov 2007 15:10:28 -0800 (PST) Subject: [Rxtx] [urgent] device's power off detection Message-ID: <766782.10076.qm@web55803.mail.re3.yahoo.com> Hello all, I have a small application built on top of rxtx api. This application can retrieve the incoming data from a device through a port. The device can be powered off after the port get closed from the application. I have been trying a couple of hours to find a way to detect the power switching from device. If anyone knows how to handle it through rxtx, could you please give me a help? Thank you very much. r, Sara ____________________________________________________________________________________ Get easy, one-click access to your favorites. Make Yahoo! your homepage. http://www.yahoo.com/r/hs -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071112/4599f3ec/attachment-0005.html From netbeans at gatworks.com Mon Nov 12 17:52:22 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 12 Nov 2007 19:52:22 -0500 Subject: [Rxtx] [urgent] device's power off detection In-Reply-To: <766782.10076.qm@web55803.mail.re3.yahoo.com> References: <766782.10076.qm@web55803.mail.re3.yahoo.com> Message-ID: <4738F546.5010101@gatworks.com> Not sure what u are asking for. Are u asking for a way to detect if the device is OFF? Are u asking how to power off the device - via software ? Is it a Serial device? is it a parallel device? is it a usb device? Sara Hugh wrote: > Hello all, > I have a small application built on top of rxtx api. This application > can retrieve the incoming data from a device through a port. The device > can be powered off after the port get closed from the application. I > have been trying a couple of hours to find a way to detect the power > switching from device. If anyone knows how to handle it through rxtx, > could you please give me a help? Thank you very much. From tjarvi at qbang.org Mon Nov 12 22:48:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Nov 2007 22:48:11 -0700 (MST) Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711120225x562db8cbxb750767ade3b0d73@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> <900c6ba90711120031p66edc001ted76f7ba24e34b98@mail.gmail.com> <900c6ba90711120225x562db8cbxb750767ade3b0d73@mail.gmail.com> Message-ID: Hi Tim, The gnu.io namespace looks just like the javax.comm 2.0 namespace. There are additional (discouraged) undocumented methods in gnu.io that you need not use. We just used the different namespace to avoid poluting Sun's by mistake and to make sure we stayed off any potential licensing related radar. Usuaully, you just change your imports and make sure you do not use the javax.comm namespace for anything like exception handling. As I mentioned off the list, there are no issues with rxtx going through the JSR process to be more Sun friendly other than time. rxtx has no hidden intentions there; anything that does not work like CommAPI 2.0 documented is a bug. The reason we do not support CommAPI 2.1 is technical in nature and is in the list archives as well as the front page of www.rxtx.org. On Mon, 12 Nov 2007, Timothy Low wrote: > Hi Trent, > > I'll move to use a JDK1.5 64-bit version... but do I need to make any source > code changes to use the package (gnu.io) in the RTXTcomm.jar instead of the > ones from the javacomm api ? > > > Regards, > Tim > > On Nov 12, 2007 5:22 PM, Trent Jarvi wrote: > >> >> Hi Tim, >> >> I see a couple things here. >> >> First your jdk is for i686 yet the library is compiled on a x86_64 >> machine. You may try passing configure the --target=i686-unknown-linux to >> try using the i686 backend to gcc if it is available. Or move to the 64 >> bit jdk. >> >> The other error I see is again the moved UTF_RELEASE define that we need >> to fix. You can probably get around that with: >> >> make -DUTF_RELEASE=`uname -r` >> >> even more simple would be to just specify the serial library which should >> be in configure --help. >> >> You can remove the UTF_RELEASE check from configure by editing >> configure.in, searching for the simple C program check and deleting it. >> Running autoconf after that will regenerate a new configure without the >> check. >> >> Note that you should remove the previous native libraries >> (librxtxSerial.so) when moving from rxtx 2.0 to 2.1. These are compiled >> for different namespaces (javax.comm/gnu.io). >> >> On Mon, 12 Nov 2007, Timothy Low wrote: >> >>> *Hi Trent, >>> >>> I moved on to rxtx 2.1.7r2, and updated my jre to 1.6.0 (64-bit)... I >> tried >>> the following 2 methods: >>> >>> (1) using the rxtx 2.1.7 binaries from the RXTX website* >>> *Are these binaries suitable for a 64-bit OS ? There mentioning of the >>> gnu.io that you've talked about previously...* >>> ------ >>> [root at smsgateway sources]# java -Djava.library.path=/usr/lib PortLister >>> Experimental: JNI_OnLoad called. >>> >>> java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion >>> ()Ljava/lang/String; >>> at gnu.io.RXTXCommDriver.nativeGetVersion(Native Method) >>> at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:85) >>> at java.lang.Class.forName0(Native Method) >>> at java.lang.Class.forName(Unknown Source) >>> at javax.comm.CommPortIdentifier.loadDriver( >> CommPortIdentifier.java >>> :237) >>> at javax.comm.CommPortIdentifier.(CommPortIdentifier.java >>> :109) >>> at PortLister.(PortLister.java:6) >>> at PortLister.main(PortLister.java:25) >>> Exception in thread "main" java.lang.UnsatisfiedLinkError: >>> com.sun.comm.SunrayInfo.isSessionActive()Z >>> at com.sun.comm.SunrayInfo.isSessionActive(Native Method) >>> at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java >> :155) >>> at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java >>> :100) >>> at javax.comm.CommPortIdentifier.(CommPortIdentifier.java >>> :138) >>> at PortLister.(PortLister.java:6) >>> at PortLister.main(PortLister.java:25) >>> >>> ------ >>> >>> (2) compiling the rxtx 2.1.7 from source >>> *but i got the following error while running ./configure and make all* >>> >>> ------ >>> [root at smsgateway rxtx-2.1-7r2]# ./configure >>> checking build system type... x86_64-unknown-linux-gnu >>> checking host system type... x86_64-unknown-linux-gnu >>> checking target system type... x86_64-unknown-linux-gnu >>> configure: WARNING: Trying libtool. If the following fails install >> libtool >>> checking for gcc... gcc >>> checking for C compiler default output file name... a.out >>> checking whether the C compiler works... yes >>> checking whether we are cross compiling... no >>> checking for suffix of executables... >>> checking for suffix of object files... o >>> checking whether we are using the GNU C compiler... yes >>> checking whether gcc accepts -g... yes >>> checking for gcc option to accept ANSI C... none needed >>> checking for a sed that does not truncate output... /bin/sed >>> checking for egrep... grep -E >>> checking for ld used by gcc... /usr/bin/ld >>> checking if the linker (/usr/bin/ld) is GNU ld... yes >>> checking for /usr/bin/ld option to reload object files... -r >>> checking for BSD-compatible nm... /usr/bin/nm -B >>> checking whether ln -s works... yes >>> checking how to recognise dependent libraries... pass_all >>> checking how to run the C preprocessor... gcc -E >>> checking for ANSI C header files... yes >>> checking for sys/types.h... yes >>> checking for sys/stat.h... yes >>> checking for stdlib.h... yes >>> checking for string.h... yes >>> checking for memory.h... yes >>> checking for strings.h... yes >>> checking for inttypes.h... yes >>> checking for stdint.h... yes >>> checking for unistd.h... yes >>> checking dlfcn.h usability... yes >>> checking dlfcn.h presence... yes >>> checking for dlfcn.h... yes >>> checking for g++... g++ >>> checking whether we are using the GNU C++ compiler... yes >>> checking whether g++ accepts -g... yes >>> checking how to run the C++ preprocessor... g++ -E >>> checking for g77... no >>> checking for f77... no >>> checking for xlf... no >>> checking for frt... no >>> checking for pgf77... no >>> checking for fort77... no >>> checking for fl32... no >>> checking for af77... no >>> checking for f90... no >>> checking for xlf90... no >>> checking for pgf90... no >>> checking for epcf90... no >>> checking for f95... f95 >>> checking whether we are using the GNU Fortran 77 compiler... yes >>> checking whether f95 accepts -g... yes >>> checking the maximum length of command line arguments... 32768 >>> checking command to parse /usr/bin/nm -B output from gcc object... ok >>> checking for objdir... .libs >>> checking for ar... ar >>> checking for ranlib... ranlib >>> checking for strip... strip >>> checking if gcc static flag works... yes >>> checking if gcc supports -fno-rtti -fno-exceptions... no >>> checking for gcc option to produce PIC... -fPIC >>> checking if gcc PIC flag -fPIC works... yes >>> checking if gcc supports -c -o file.o... yes >>> checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking whether -lc should be explicitly linked in... no >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> checking if libtool supports shared libraries... yes >>> checking whether to build shared libraries... yes >>> checking whether to build static libraries... no >>> configure: creating libtool >>> appending configuration tag "CXX" to libtool >>> checking for ld used by g++... /usr/bin/ld -m elf_x86_64 >>> checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes >>> checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking for g++ option to produce PIC... -fPIC >>> checking if g++ PIC flag -fPIC works... yes >>> checking if g++ supports -c -o file.o... yes >>> checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> appending configuration tag "F77" to libtool >>> checking if libtool supports shared libraries... yes >>> checking whether to build shared libraries... yes >>> checking whether to build static libraries... no >>> checking for f95 option to produce PIC... -fPIC >>> checking if f95 PIC flag -fPIC works... yes >>> checking if f95 supports -c -o file.o... yes >>> checking whether the f95 linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> checking for a BSD-compatible install... /usr/bin/install -c >>> checking whether build environment is sane... yes >>> checking for gawk... gawk >>> checking whether make sets $(MAKE)... yes >>> checking for style of include used by make... GNU >>> checking dependency style of gcc... none >>> checking dependency style of g++... none >>> checking fcntl.h usability... yes >>> checking fcntl.h presence... yes >>> checking for fcntl.h... yes >>> checking sys/fcntl.h usability... yes >>> checking sys/fcntl.h presence... yes >>> checking for sys/fcntl.h... yes >>> checking sys/file.h usability... yes >>> checking sys/file.h presence... yes >>> checking for sys/file.h... yes >>> checking sys/time.h usability... yes >>> checking sys/time.h presence... yes >>> checking for sys/time.h... yes >>> checking sys/signal.h usability... yes >>> checking sys/signal.h presence... yes >>> checking for sys/signal.h... yes >>> checking signal.h usability... yes >>> checking signal.h presence... yes >>> checking for signal.h... yes >>> checking termios.h usability... yes >>> checking termios.h presence... yes >>> checking for termios.h... yes >>> checking grp.h usability... yes >>> checking grp.h presence... yes >>> checking for grp.h... yes >>> checking pwd.h usability... yes >>> checking pwd.h presence... yes >>> checking for pwd.h... yes >>> checking whether gcc needs -traditional... no >>> checking whether to enable maintainer-specific portions of Makefiles... >> no >>> /usr/java/jdk1.5.0_13 >>> configure: WARNING: using JAVA_HOME environmental variable >>> adjusted java.home is /usr/java/jdk1.5.0_13 >>> checking os.name Linux >>> checking os.arch i386 >>> checking java.vendor Sun Microsystems Inc. >>> checking java.version 1.5.0_13 >>> checking os.version 2.6.18-8.el5xen >>> conftest.c: In function 'main': >>> conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this >> function) >>> conftest.c:8: error: (Each undeclared identifier is reported only once >>> conftest.c:8: error: for each function it appears in.) >>> conftest.c:8: error: expected ')' before string constant >>> ./configure: line 21462: ./conftest: No such file or directory >>> ./configure: line 21462: test: 2.6.18-8.el5xen: unary operator expected >>> configure: creating ./config.status >>> config.status: creating Makefile >>> config.status: creating config.h >>> config.status: executing depfiles commands >>> [root at smsgateway rxtx-2.1-7r2]# make install >>> /usr/java/jdk1.5.0_13/bin/javac -classpath .:/home/jboss/sources/rxtx- >>> >> 2.1-7r2:/home/jboss/sources/rxtx-2.1-7r2/src:/usr/java/jdk1.5.0_13/jre/lib/ext/RXTXcomm.jar-d >>> /home/jboss/sources/rxtx- >>> 2.1-7r2/ -O -source 1.3 -target 1.3 >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommDriver.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortEnumerator.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortIdentifier.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortOwnershipListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Configure.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2C.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/I2CPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/LPRPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/NoSuchPortException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/PortInUseException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Raw.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/RawPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RawPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RawPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/RS485PortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485PortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485Port.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXCommDriver.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXVersion.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPort.java >>> /home/jboss/sources/rxtx-2.1-7r2 >> /./src/UnsupportedCommOperationException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/UnSupportedLoggerException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Zystem.java >>> /usr/java/jdk1.5.0_13/bin/javah -classpath .:/home/jboss/sources/rxtx- >>> >> 2.1-7r2:/home/jboss/sources/rxtx-2.1-7r2/src:/usr/java/jdk1.5.0_13/jre/lib/ext/RXTXcomm.jar-d >>> x86_64-unknown-linux-gnu -jni `(for i in CommDriver CommPortEnumerator >>> CommPortIdentifier CommPort CommPortOwnershipListener Configure I2C >>> I2CPortEvent I2CPortEventListener I2CPort LPRPort NoSuchPortException >>> ParallelPortEvent ParallelPortEventListener ParallelPort >> PortInUseException >>> Raw RawPortEvent RawPortEventListener RawPort RS485 RS485PortEvent >>> RS485PortEventListener RS485Port RXTXCommDriver RXTXPort RXTXVersion >>> SerialPortEvent SerialPortEventListener SerialPort >>> UnsupportedCommOperationException UnSupportedLoggerException Zystem;do \ >>> if grep > /dev/null native.*\( /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/$i.java; then \ >>> echo gnu.io.$i; \ >>> fi; \ >>> done)` >>> /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialImp.c -o >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo; >>> \ >>> if [ "Serial" = "Serial" ]; >>> then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxSerial.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxSerial.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo; >> \ >>> fi; \ >>> ) >>> mkdir /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/.libs >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/SerialImp.o >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/fuserImp.o >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c: In function >> 'show_user': >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c:238: warning: cast >> from >>> pointer to integer of different size >>> gcc -shared /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/SerialImp.o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/fuserImp.o >>> -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7.so -o >> .libs/librxtxSerial- >>> 2.1-7.so >>> (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.1-7.so >>> librxtxSerial.so) >>> creating librxtxSerial.la >>> (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la >>> librxtxSerial.la) >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelImp.c -o >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/ParallelImp.lo; >>> \ >>> if [ "Parallel" = "Serial" ]; >>> then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxParallel.la -rpath >>> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/ParallelImp.lo >>> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxParallel.la -rpath >>> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/ParallelImp.lo; >>> \ >>> fi; \ >>> ) >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >>> /x86_64-unknown-linux-gnu/.libs/ParallelImp.o >>> gcc -shared /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/ParallelImp.o >>> -lpthread -Wl,-soname -Wl,librxtxParallel-2.1-7.so -o >>> .libs/librxtxParallel-2.1-7.so >>> (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.1-7.so >>> librxtxParallel.so) >>> creating librxtxParallel.la >>> (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la >>> librxtxParallel.la) >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo; >>> \ >>> if [ "I2C" = "Serial" ]; then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxI2C.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo >>> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxI2C.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo; >>> \ >>> fi; \ >>> ) >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/.libs/I2CImp.o >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c: In function >>> 'Java_gnu_io_I2CPort_Initialize': >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: 'UTS_RELEASE' >>> undeclared (first use in this function) >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: (Each >> undeclared >>> identifier is reported only once >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: for each >> function >>> it appears in.) >>> libtool: link: `/home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/I2CImp.lo' >>> is not a valid libtool object >>> make: *** [x86_64-unknown-linux-gnu/librxtxI2C.la] Error 1 >>> >>> ------ >>> >>> >>> >>> On Nov 12, 2007 4:02 PM, Trent Jarvi wrote: >>> >>>> On Mon, 12 Nov 2007, Timothy Low wrote: >>>>> >>>>> Hi Trent, >>>> >>>> Hi Tim, >>>> >>>> Comments are inline. As I mentioned off the list, rxtx 2.0 is on the >> edge >>>> of deprecation. We can get it working but this is not the path of >> least >>>> resistance for future work. >>>> >>>> You will probably need to bounce another round of questions off the >> list. >>>> The following is intended to isolate the problem. >>>> >>>>> >>>>> I tried building RXTX from source, and I got this error. >>>>> >>>>> >>>>> I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm >>>> trying >>>>> to get the necessary ".so" files to use for my serial port >> communication >>>>> through java. >>>>> My linux kernal information is: >>>>> >>>>> *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 >>>> x86_64 >>>>> x86_64 x86_64 GNU/Linux* >>>>> >>>>> I'll most glad if you can provide me some direction on this. Thanks ! >>>>> >>>>> ---------------- >>>>> [root at smsgateway rxtx-2.0-7pre1]# ./configure >>>>> checking build system type... x86_64-unknown-linux-gnu >>>>> checking host system type... x86_64-unknown-linux-gnu >>>>> checking target system type... x86_64-unknown-linux-gnu >>>>> configure: WARNING: Trying libtool. If the following fails install >>>> libtool >>>>> checking for gcc... gcc >>>>> checking for C compiler default output... a.out >>>>> checking whether the C compiler works... yes >>>>> checking whether we are cross compiling... no >>>>> checking for suffix of executables... >>>>> checking for suffix of object files... o >>>>> checking whether we are using the GNU C compiler... yes >>>>> checking whether gcc accepts -g... yes >>>>> checking for gcc option to accept ANSI C... none needed >>>>> checking for ld used by GCC... /usr/bin/ld >>>>> checking if the linker (/usr/bin/ld) is GNU ld... yes >>>>> checking for /usr/bin/ld option to reload object files... -r >>>>> checking for BSD-compatible nm... /usr/bin/nm -B >>>>> checking for a sed that does not truncate output... /bin/sed >>>>> checking whether ln -s works... yes >>>>> checking how to recognise dependent libraries... pass_all >>>>> checking command to parse /usr/bin/nm -B output... ok >>>>> checking how to run the C preprocessor... gcc -E >>>>> checking for egrep... grep -E >>>>> checking for ANSI C header files... yes >>>>> checking for sys/types.h... yes >>>>> checking for sys/stat.h... yes >>>>> checking for stdlib.h... yes >>>>> checking for string.h... yes >>>>> checking for memory.h... yes >>>>> checking for strings.h... yes >>>>> checking for inttypes.h... yes >>>>> checking for stdint.h... yes >>>>> checking for unistd.h... yes >>>>> checking dlfcn.h usability... yes >>>>> checking dlfcn.h presence... yes >>>>> checking for dlfcn.h... yes >>>>> checking for ranlib... ranlib >>>>> checking for strip... strip >>>>> checking for objdir... .libs >>>>> checking for gcc option to produce PIC... -fPIC >>>>> checking if gcc PIC flag -fPIC works... yes >>>>> checking if gcc static flag -static works... yes >>>>> checking if gcc supports -c -o file.o... yes >>>>> checking if gcc supports -c -o file.lo... yes >>>>> checking if gcc supports -fno-rtti -fno-exceptions... yes >>>>> checking whether the linker (/usr/bin/ld) supports shared libraries... >>>> yes >>>>> checking how to hardcode library paths into programs... immediate >>>>> checking whether stripping libraries is possible... yes >>>>> checking dynamic linker characteristics... GNU/Linux ld.so >>>>> checking if libtool supports shared libraries... yes >>>>> checking whether to build shared libraries... yes >>>>> checking whether to build static libraries... no >>>>> checking whether -lc should be explicitly linked in... no >>>>> creating libtool >>>>> checking for a BSD-compatible install... /usr/bin/install -c >>>>> checking whether build environment is sane... yes >>>>> checking for gawk... gawk >>>>> checking whether make sets $(MAKE)... yes >>>>> checking for style of include used by make... GNU >>>>> checking dependency style of gcc... none >>>>> checking fcntl.h usability... yes >>>>> checking fcntl.h presence... yes >>>>> checking for fcntl.h... yes >>>>> checking sys/fcntl.h usability... yes >>>>> checking sys/fcntl.h presence... yes >>>>> checking for sys/fcntl.h... yes >>>>> checking sys/file.h usability... yes >>>>> checking sys/file.h presence... yes >>>>> checking for sys/file.h... yes >>>>> checking sys/time.h usability... yes >>>>> checking sys/time.h presence... yes >>>>> checking for sys/time.h... yes >>>>> checking sys/signal.h usability... yes >>>>> checking sys/signal.h presence... yes >>>>> checking for sys/signal.h... yes >>>>> checking signal.h usability... yes >>>>> checking signal.h presence... yes >>>>> checking for signal.h.. . yes >>>>> checking termios.h usability... yes >>>>> checking termios.h presence... yes >>>>> checking for termios.h... yes >>>>> checking asm/termbits.h usability... yes >>>>> checking asm/termbits.h presence... yes >>>>> checking for asm/termbits.h... yes >>>>> checking grp.h usability... yes >>>>> checking grp.h presence... yes >>>>> checking for grp.h... yes >>>>> checking pwd.h usability... yes >>>>> checking pwd.h presence... yes >>>>> checking for pwd.h... yes >>>>> checking whether gcc needs -traditional... no >>>>> checking whether to enable maintainer-specific portions of >> Makefiles... >>>> no >>>>> /usr/java/jdk1.5.0_13 >>>>> configure: WARNING: using JAVA_HOME environmental variable >>>>> adjusted java.home is /usr/java/jdk1.5.0_13 >>>>> checking os.name Linux >>>>> checking os.arch i386 >>>>> checking java.vendor Sun Microsystems Inc. >>>>> checking java.version 1.5.0_13 >>>>> checking os.version 2.6.18-8.el5xen >>>>> comm.jar appears to be installed already. >>>>> conftest.c: In function 'main': >>>>> conftest.c:6: warning: incompatible implicit declaration of built-in >>>>> function 'printf' >>>>> conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this >>>> function) >>>>> conftest.c:6: error: (Each undeclared identifier is reported only once >>>>> conftest.c:6: error: for each function it appears in.) >>>>> conftest.c:6: error: expected ')' before string constant >>>> >>>> >>>> This is an outdated kernel version check for when headers and kernels >>>> could cause problems for rxtx. If we made it past this, then you are >> OK. >>>> >>>> >>>>> conftest.c:7: warning: incompatible implicit declaration of built-in >>>>> function 'exit' >>>>> ./configure: line 9649: ./conftest: No such file or directory >>>>> ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected >>>> >>>> It blew up but continues.. >>>> >>>>> conftest.c: In function 'main': >>>>> conftest.c:5: warning: incompatible implicit declaration of built-in >>>>> function 'printf' >>>>> conftest.c:10: warning: incompatible implicit declaration of built-in >>>>> function 'exit' >>>>> configure: creating ./config.status >>>>> config.status: creating Makefile >>>>> config.status: creating config.h >>>>> config.status : config.h is unchanged >>>>> config.status: executing depfiles commands >>>>> [root at smsgateway rxtx-2.0-7pre1]# make install >>>>> /usr/java/jdk1.5.0_13/bin/javac -classpath >>>>> .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/ -O >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1 >> /./src/UnSupportedLoggerException.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java >>>>> Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or >>>>> overrides a deprecated API. >>>>> Note: Recompile with -Xlint:deprecation for details. >>>>> /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* >>>> >>>> >>>> The java jar should be fine now. You may need to change the source >> files >>>> as mentioned below. >>>> >>>>> gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu >> -I. >>>>> -I/usr/java/jdk1.5.0_13/include >> -I/usr/java/jdk1.5.0_13/include/./linux/ >>>> -g >>>>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o >>>>> /home/jboss/sources/rxtx-2.0-7pre1 >> /x86_64-unknown-linux-gnu/SerialImp.lo >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'init_threads': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: >>>> cast >>>>> from pointer to integer of different size >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_nativeDrain': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: >>>> cast to >>>>> pointer from integer of different size >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'read_byte_array': >>>>> /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: >>>> cast to >>>>> pointer from integer of different size >>>> >>>> >>>> As I recall, this was caused by pointers (now 64 bit rather than 32 >> bit) >>>> being stored in java ints (jints). I would look at the diff between >> the >>>> CVS 2.1 SerialImp.c and RXTXPort.java files against 2.0. We >>>> did fix those issues. >>>> >>>> You have a .so file but the different pointer sizes will cause runtime >>>> errors. >>>> >>>> >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_readArray': >>>>> /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: >>>>> comparison is always false due to limited range of data type >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_readTerminatedArray': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: >>>>> comparison is always false due to limited range of data type >>>>> mkdir .libs >>>>> rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* >> .libs/librxtxSerial- >>>>> 2.0.7pre1.* >>>>> gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so-o >>>>> .libs/librxtxSerial-2.0.7pre1.so >>>>> (cd .libs && rm -f librxtxSerial.so && ln -s >> librxtxSerial-2.0.7pre1.so >>>>> librxtxSerial.so) >>>>> creating librxtxSerial.la >>>>> (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la >>>>> librxtxSerial.la) >>>>> gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu >> -I. >>>>> -I/usr/java/jdk1.5.0_13/include >> -I/usr/java/jdk1.5.0_13/include/./linux/ >>>> -g >>>>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o >>>>> /home/jboss/sources/rxtx- 2.0-7pre1 >>>> /x86_64-unknown-linux-gnu/ParallelImp.lo >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function >>>>> 'Java_javax_comm_LPRPort_readArray': >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: >>>>> comparison is always false due to limited range of data type >>>>> rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* >>>>> .libs/librxtxParallel-2.0.7pre1.* >>>>> gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so-o >>>>> .libs/librxtxParallel- 2.0.7pre1.so >>>>> (cd .libs && rm -f librxtxParallel.so && ln -s >>>> librxtxParallel-2.0.7pre1.so >>>>> librxtxParallel.so) >>>>> creating librxtxParallel.la >>>>> (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la >>>>> librxtxParallel.la) >>>>> make all-am >>>>> make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' >>>>> make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' >>>>> libtool: install: `x86_64-unknown-linux-gnu' must be an absolute >>>> directory >>>>> name >>>>> Try `libtool --help --mode=install' for more information. >>>>> make: *** [install] Error 1 >>>> >>>> A libtool change? Assuming you ran configure && make install in >>>> /home/jboss/sources/rxtx- 2.0-7pre1, libtool is looking for >>>> /home/jboss/sources/rxtx- >>>> 2.0-7pre1/x86_64-unknown-linux-gnu/.libs/librxtxSerial-2.0.7pre1.so. >>>> >>>> I think you have this? The file is just being copied to >>>> ~JAVA/jre/lib/$(JAVA_ARCH). >>>> >>>> -- >>>> Trent Jarvi >>>> tjarvi at qbang.org >>>> >>> >> > From guido.vogt at celsi.ch Tue Nov 13 00:28:01 2007 From: guido.vogt at celsi.ch (Guido Vogt) Date: Tue, 13 Nov 2007 08:28:01 +0100 Subject: [Rxtx] RTS Line can't be set Message-ID: <47395201.1050400@celsi.ch> I'm working on an Windows XP /SP2 System. Version of RXTX: 2.1.7. The serial line is connected to a modem. As I can see, the RTS-Line of the serial Port is inactive, when the port is opened (flowcontrol=none). Obviously, no data is coming from the modem. If I use the setRTS(true) command after open, the comport does not send out my data any more. This behaviour is regardless of flowcontrol. Anybody has an idea what do do? Thanks for help. From Martin.Oberhuber at windriver.com Tue Nov 13 08:58:23 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 13 Nov 2007 16:58:23 +0100 Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803880918@ism-mail03.corp.ad.wrs.com> Hi Trent, as said before, I like the idea of discussing such quality engineering issues, but why hide these away from the rest of the public? Anyways, if you do want to create a new mailing list for these kinds of things I'll happily subscribe. 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: Sunday, November 11, 2007 1:46 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: RE: [Rxtx] Quality Engineering with rxtx > > On Mon, 5 Nov 2007, Oberhuber, Martin wrote: > > > Hi Trent, > > > > are the interestes of hobbyists really so different > > from commercial ones? Both should be interested in > > high quality and innovation the like. > > > > I haven't seen too many Open Source projects from the > > "inside" but those that I have seen did not have > > separate mailing lists for quality/testing/qa > > versus innovation/development. > > > > What I have seen with the Open Source projects that > > one would call "successful" is a good deal of > > process around automated builds, automated unit > > tests, predictable release dates and milestones, > > and policies around commiting/contributing/reviewing > > changes. > > > > I think that all of these benefit commercial users > > and hobbyists the like. > > > > If you were just asking about who's interested in > > discussing changes to foster more quality, count > > me in. I'm just not sure whether discussing these > > on a separate mailing list or other channel is the > > right thing to do. > > > > Hi Martin, > > There are two issues I'm thinking about. The first is the > generic unit > testing and quality initiatives required to move rxtx > forward. The second > is the inevitable fact that rxtx connects to external hardware. The > discussion deals with a different set of problems. > > Here is a simple example of what I'm getting at. > > We have the capability of setting custom baud rates in rxtx. > We may be > interested in seeing regressions in rxtx, the C library or > the kernel. > Some people may be doing some tests with loopback > connections. These will > always work even if the baud rate is not set to the expected > value. Some > people may use null modems between two ports. This may be > able to catch > the problem but not always. > > Will the build machines be able to test this? (no - for a few reasons) > Will people be trying to catch these type of regressions? (yes) > What type of coverage does the community have in the end? (?) > > We could include the discussions in the same list or another > equally open > list that may be of interest to some folks that deal with > these types of > problems on a regular basis. > > -- > Trent Jarvi > tjarvi at qbang.org > From toupsz at cs.tamu.edu Tue Nov 13 10:33:03 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 13 Nov 2007 11:33:03 -0600 Subject: [Rxtx] [urgent] device's power off detection In-Reply-To: <4738F546.5010101@gatworks.com> References: <766782.10076.qm@web55803.mail.re3.yahoo.com> <4738F546.5010101@gatworks.com> Message-ID: Lacking any other specification on it...but can you set up the device to notify your software when it turns off? Send a message or somesuch? Maybe it can signal using RTS or DTR? -Zach On Nov 12, 2007 6:52 PM, U. George wrote: > Not sure what u are asking for. Are u asking for a way to detect if the > device is OFF? Are u asking how to power off the device - via software ? > Is it a Serial device? > is it a parallel device? > is it a usb device? > > Sara Hugh wrote: > > Hello all, > > I have a small application built on top of rxtx api. This application > > can retrieve the incoming data from a device through a port. The device > > can be powered off after the port get closed from the application. I > > have been trying a couple of hours to find a way to detect the power > > switching from device. If anyone knows how to handle it through rxtx, > > could you please give me a help? Thank you very much. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071113/e5859e4d/attachment-0003.html From tjarvi at qbang.org Tue Nov 13 20:02:03 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 13 Nov 2007 20:02:03 -0700 (MST) Subject: [Rxtx] #ifndef TIOCSERGETLSR In-Reply-To: <472E3AAF.7050709@gatworks.com> References: <472E3AAF.7050709@gatworks.com> Message-ID: On Sun, 4 Nov 2007, U. George wrote: > For Linux, it seems that you need the code for both *having* a > TIOCSERGETLSR, and *not having* a TIOCSERGETLSR. Maybe the ioctl exists > system wide, but not necessarily for the device driver itself ( always > returns -1 ) . > > Are there systems that have a *functioning* TIOCSERGETLSR for all their > devices? Then this would be the case where the "#ifndef TIOCSERGETLSR" > directive could be useful is eliminating the unnecessary code and tests. > > And for those systems that dont have a TIOCSERGETLSR, then the code for > TIOCSERGETLSR can be eliminated. > > It would be a simple case to have, as a foundation, all the code to > simulate the missing TIOCSERGETLSR ioctl. If the system does have the > ioctl, then that code can be ifdef'd in, and co-exist with the > functionality of the code that simulates the missing TIOCSERGETLSR ioctl. > Ah, there is the post. Sorry I was on vacation. Hi George, Yes there are systems that have functioning TIOCSERGETLSR for all of their devices. These are machines that just use traditional UARTs. If you mean operating systems, then probably not. Let me explain a bit about the history of those #ifdefs to help clear up a mess. RXTX aims to follow POSIX. TIOCSERGETLSR turns out to not be POSIX at all as I understand. It isn't in BSD, Solaris, AIX or HP-UX. It certainly provides access to important information. I assumed it was standard when I coded rxtx on a Linux system. Ya, laugh. Then I looked at Win32.. Oh you are still laughing? ..I could not navigate msft's web site at the time [still can't really find anything today]. So google pointed me to someones 'reverse documentation' of the w32 API and an example msft put together back in the win3.0 days. It was enough but maybe not 100% correct. They covered overlapped IO which was important for events in rxtx. Looking at Win32 and Linux, it made sense to implement TIOCSERGETLSR for win32 with the way rxtx works. That was how things matched up. But when I got feedback about other systems, it didn't match up. When people used multiport cards with money saving designs in Linux, it didn't match up. And today, there are drivers for unusual serial ports that don't match up. Now we have some ugly logic that mostly works for most serial ports. It isn't right though. The important aspect of TIOSERGETLSR is knowing when the output is really gone. But POSIX tcdrain tells us the same thing. So there is logic in the ifdefs to match that up as you suggest. Perhaps a more formal solution along those lines would be worth looking into. I would suggest the roles should be switched though. We should use POSIX calls on all systems and hide things that don't work on everything like we have with other undocumented calls. TIOSERGETLSR is nice and would be great if it was standard. It isn't as far as I can tell. In the end, many people write Java code because they want portability. The TIOSERGETLSR does not really fit. In someways, this is limiting to the least common denominator which is Solaris if you have seen it's serial kernel driver code. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 15 09:10:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 15 Nov 2007 17:10:59 +0100 Subject: [Rxtx] RXTX blocking on unconnected virtual port Message-ID: <460801A4097E3D4CA04CC64EE648584803919080@ism-mail03.corp.ad.wrs.com> Hello, we came across the following issue: * Set up a virtual serial port, e.g. with com0com: http://com0com.sourceforge.net/ * Connect RXTX to one end, e.g. cnc1a * Do not connect the other end, e.g. cnc1b * Have RXTX write data to the port --> Since the data is not being read, RXTX blocks - RXTXPort.SerialOutputStream.write increases the RXTXPort.IOLocked variable - it then calls the native writeByte or writeArray method (which blocks) closing the RXTXPort hangs for ever too: - RXTXPort.close() has a while( IOLocked > 0 ) {..Thread.sleep(500);...} which spins for ever ==> once the communication hangs, it cannot recover. Has anybody else seen such a problem before, or even got an idea how to solve it? When I connect Hyperterminal to the same half-open port, and type a character, it hangs for about 3 seconds but then times out and is available again. I guess that's what I'd like to see in RXTX as well, with a (configurable) timeout. Our big problem with the current situation is that once RXTX gets stuck, there is nothing at all we can do to make it go live again - that's why our original workaround of writing to the port in a background thread is not good enough. For more background information, the issue is being tracked in https://bugs.eclipse.org/bugs/show_bug.cgi?id=208185 Thanks for any hints or ideas, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From keithvz at verizon.net Thu Nov 1 08:08:58 2007 From: keithvz at verizon.net (Keith) Date: Thu, 01 Nov 2007 10:08:58 -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: <4729DDFA.7080206@verizon.net> Trent Jarvi wrote: > 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? Well, I honestly don't know how all this fits together. I think it's just a matter of enabling the right flow control option within the standard serial framework to tell the device driver, "HEY START USING DTR/DSR FOR FLOW CONTROL." If what UGeorge said,(about that type of nitty-gritty lead control being done within the device driver), is true, then this confirms my suspicion. I tried narrowing down within the Linux drivers what you are looking for, but I can't entirely tell wth I'm looking at. (virtual com port drivers -- they are included compiled by default with Ubuntu, source included) http://www.ftdichip.com/Drivers/VCP/Linux/ftdi_sio.tar.gz Hahahaa, they make a reference to DTR flow control being supported but say (UGH) in parenthesis. You can also use their direct device driver library on Ubuntu -- libftd2xx.so.0.4.13. No source code. http://www.ftdichip.com/Drivers/D2XX/Linux/libftd2xx0.4.13.tar.gz In that case, you make a call to their FT_SetFlowControl() function. FT_STATUS FT_SetFlowControl (FT_HANDLE ftHandle, USHORT usFlowControl, UCHAR uXon,UCHAR uXoff) Parameters ftHandle Handle of the device. usFlowControl Must be one of FT_FLOW_NONE, FT_FLOW_RTS_CTS, ****FT_FLOW_DTR_DSR**** or FT_FLOW_XON_XOFF. uXon Character used to signal Xon. Only used if flow control is FT_FLOW_XON_XOFF. uXoff Character used to signal Xoff. Only used if flow control is FT_FLOW_XON_XOFF. This is from their programming guide http://www.ftdichip.com/Documents/ProgramGuides/D2XXPG34.pdf I actually want to take this a step further and say that I think the flow control is actually handled right on the device itself in hardware/firmware. It's enabled through the device driver, but I think the maintaining of buffers, asserting/deasserting of leads, etc is handled by the device. For the time being, I've switched to jd2xx, https://jd2xx.dev.java.net/ and http://bleyer.org/jd2xx/ These are Java wrappers for the device driver libraries. It allows almost direct access to the well-documented device drivers from Java. I hope this helps Keith From tjarvi at qbang.org Thu Nov 1 11:09:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:09:51 -0600 (MDT) 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: Hi Martin, What I usually have done is allow changes that do not impact working software including changes to methods not documented in CommAPI (which remain undocumented in rxtx) and fixes to known problems in the documented portions. That way if you use the documented API, the releases should only become better with time. If you use the undocumented portions, the behavior is not as predictable but open for improvement. On Wed, 31 Oct 2007, 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 >> > From tjarvi at qbang.org Thu Nov 1 11:15:52 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:15:52 -0600 (MDT) 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: I too use rxtx in commercial products. The problem I've been trying to address while bringing the server back was how to make it possible for hobby folks to build the same software as companies so we can move rxtx along a little faster. Exposing internal tools is not an option at this time, the public rxtx builds have been done on my home machine which has drives hanging out of it all over the place dying one at a time. This isn't maintainable. I'm currently looking at the possibility of making an S3 image available on Amazon's EC. These are machines you can rent for ~10 cents an hour which is more than enough to build rxtx. The S3 image is not changed when people use it so everyone has the same starting point. With this, we could all build rxtx for ~20 platforms for a small price and eliminate tool issues. On Wed, 31 Oct 2007, Greg Johnson wrote: > 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 tjarvi at qbang.org Thu Nov 1 11:19:55 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:19:55 -0600 (MDT) 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: On Wed, 31 Oct 2007, 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. I was helping Dmitry do the Mac OS X port without access to a machine when we put that in. In the archives there is information (easily found with google on Apple's site) that describes how their API (and others) can determine if a port is used and ignore it. I think these changes are in CVS but need to confirm. The bottom line is that rxtx should not have used lock files on Mac. It was just ignorance of the system on my part. -- Trent Jarvi tjarvi at qbang.org From fabioanjos at gmail.com Thu Nov 1 12:35:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Thu, 1 Nov 2007 15:35:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Hi, I was using SerialEventListener in my project. But, as was said here, id doesnt work very well with virtual serial ports. So, I changed the strategy using the code posted here in this thread: try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > 0) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } The thing is that in my tests I could notice that in.read(buffer) never blocks. Even when there's nothing to read. Instead of blocking when there's nothing to read it returns 0. So, my questions are: 1. Am I doing something wrong? 2. If not, wouldnt this decrease performance? (the thread would be locked in a loop that does nothing.) 3. Is there a better way to do the job? Thanks in advance!! F?bio -------- On 10/31/07, Andre-John Mas wrote: > > > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/0aee59d0/attachment-0017.html From ajmas at sympatico.ca Thu Nov 1 16:07:55 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Nov 2007 18:07:55 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Message-ID: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From sarah_662005 at yahoo.com Thu Nov 1 17:10:05 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Thu, 1 Nov 2007 16:10:05 -0700 (PDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Message-ID: <351433.37166.qm@web55814.mail.re3.yahoo.com> Thank you very much for your help. Now the application works fine. the serialEvent gets triggered. Rxtx is cool! ----- Original Message ---- From: Andre-John Mas To: Sara Hugh ; RXTX Developers and Users Sent: Wednesday, October 31, 2007 9:55:45 AM Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered 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 __________________________________________________ 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/20071101/4a86bea6/attachment-0017.html From tjarvi at qbang.org Thu Nov 1 17:58:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 17:58:02 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx Message-ID: The rxtx.org site is primarily interested in the hobby aspects of rxtx. Obviously, there are some companies following the work too. These interests bring larger workflows and concerns about details hobby folks may not care about. They also bring many more users. I know the company I work for has a quality engineering effort going on which includes rxtx. While the server was down, I was contacted by another company that was missing the binaries for their testing. Several people have mentioned concerns about a stable release for like reasons. Would there be interest on the quality side of the coin to get together? It could be just sharing email's with each other or a seperate list for QE/QA. I can not say for sure, but we may be able to share some of our efforts/results that could help keep rxtx releases stable. -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Fri Nov 2 01:42:55 2007 From: scldad at sdc.com.au (Stephen Davies) Date: Fri, 2 Nov 2007 18:12:55 +1030 Subject: [Rxtx] Multiple modems Message-ID: <200711021812.56047.scldad@sdc.com.au> This may or may not be related to the Multiple Ports thread. I have an application which uses rxtx on Linux (via cron jobs) to connect multiple modems to remote sensing devices. The application works fine most of the time but occasionally fails to connect if two (or more) connection attempts happen at about the same time. When it fails, it looks as if it may get confused as to which port it is talking to. The app has a "base" component that looks for an available port, opens it and then creates an input thread and an output thread for the connection and data transfer. The "base" component uses this code: // loop round all known ports until one is available. Give up after three minutes Counter ptimeout = new Counter(); while(!portFound && ptimeout.elapsed() < 180000) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // special case. ttyS0 is not available to us on this server. if (!portId.isCurrentlyOwned() && !portId.getName().equals("/dev/ttyS0")) { gLog.debug(lognm + ": Found port " + portId.getName()); try { serialPort = (RXTXPort) portId.open("AguaModem", 10000); } catch (Exception e) { gLog.error(lognm + ": Port " + portId.getName() + " will not open."); gLog.error(e.getMessage()); continue; } AguaModem aguamodem = new AguaModem(); portFound = true; break; } gLog.debug(lognm + ": Port " + portId.getName() + " is busy"); } } } I am wondering about the isCurrentlyOwned method. Does this actually tell me whether a port is currently being used by another process? TIA, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From fabioanjos at gmail.com Fri Nov 2 04:59:58 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 07:59:58 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Message-ID: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/9009eb1d/attachment-0017.html From netbeans at gatworks.com Fri Nov 2 06:28:13 2007 From: netbeans at gatworks.com (U. George) Date: Fri, 02 Nov 2007 08:28:13 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <472B17DD.1050508@gatworks.com> It should normally block ( unless eof / event ) . so its a :{ whats the device ( to recreate if possible ) and how do u open. > My question is, is there a way to make in.read block the thead until > there's something to read? > From fabioanjos at gmail.com Fri Nov 2 06:34:46 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 09:34:46 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > On 11/1/07, Andre-John Mas wrote: > > > > Fabio, > > > > Turns out there was a small error in my example. The test should be: > > > > (numBytes = in.read(buffer)) > -1 > > > > This is because -1 indicates an end of file (end of data stream) > > > > Andre > > > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > > > Hi, > > > > > > I was using SerialEventListener in my project. But, as was said > > > here, id doesnt work very well with virtual serial ports. > > > So, I changed the strategy using the code posted here in this thread: > > > > > > try{ > > > in = port.getInputStream(); > > > out = port.getOutputStream(); > > > int numBytes = 0; > > > while(active){ > > > > > > byte[] buffer = new byte[10]; > > > > > > while ( (numBytes = in.read(buffer)) > 0) > > > { > > > String dataValue = new String(buffer,0,numBytes); > > > processInput(dataValue); > > > } > > > > > > if(numBytes==-1){ > > > break; > > > } > > > > > > Thread.sleep(50); > > > } > > > > > > }catch(IOException e){ > > > logger.info("falha de comunicacao "+ > > > getReceptor().getPort() ); > > > > > > }catch(InterruptedException e){ > > > logger.info ("Interrompendo leitura da porta "+ > > > getReceptor().getPort() ); > > > } > > > > > > The thing is that in my tests I could notice that in.read(buffer) > > > never blocks. Even when there's nothing to read. Instead of blocking > > > when there's nothing to read it returns 0. > > > > > > So, my questions are: > > > > > > 1. Am I doing something wrong? > > > 2. If not, wouldnt this decrease performance? (the thread would be > > > locked in a loop that does nothing.) > > > 3. Is there a better way to do the job? > > > > > > Thanks in advance!! > > > > > > F?bio > > > -------- > > > > > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > > 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 > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > > > > > -- > > > Atenciosamente, > > > F?bio Cristiano dos Anjos > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/5306c4b1/attachment-0017.html From nick.circelli at infrasafe.com Fri Nov 2 07:01:17 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Fri, 2 Nov 2007 08:01:17 -0500 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com><29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com><90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca><29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Message-ID: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> I'm pretty sure that not blocking has to do with you virtual ports. Cause it should block. Maybe you should try: while ((numBytes = in.available()) > 0) { If (numBytes > buffer.length) { numBytes = buffer.length; // in case you have buffer overflow } numBytes = in.read(buffer, 0 , numBytes)); String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } Also, just for optimization, I'd move that byte[] buffer = new byte[10]; out of the while since you don't need to reallocate it every iteration. ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of F?bio Cristiano dos Anjos Sent: Friday, November 02, 2007 8:35 AM To: RXTX Developers and Users Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream (); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas < ajmas at sympatico.ca > wrote: Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info ("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Atenciosamente, F?bio Cristiano dos Anjos -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/4de7f6a3/attachment-0017.html From fabioanjos at gmail.com Fri Nov 2 07:36:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 10:36:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> Message-ID: <29788b250711020636q1588c88fgaa5e27f5504164fb@mail.gmail.com> Hi Nick, Actually, it doesnt block for physical ports too. And, the method avaiable does not block either, so when there's nothing avaiable the loop ends and the thread stops lintening to the port. But I did some more test with serialEventListener, and now its working. I realy dont know what I've done to get it working. I just start woking as soon as I decided to test it again. It was said here that serialEventListener is not reliable for virtual serial ports. Is there another way to read it, without compromising performance? Tanks again!! F?bio ------- On 11/2/07, Nick Circelli wrote: > > I'm pretty sure that not blocking has to do with you virtual ports. > Cause it should block. > > Maybe you should try: > > > > while ((numBytes = in.available()) > 0) > > { > > If (numBytes > buffer.length) { > > numBytes = buffer.length; // in case you have buffer overflow > > } > > numBytes = in.read(buffer, 0 , numBytes)); > > String dataValue = new String(buffer,0,numBytes,"ASCII"); > > processInput(dataValue); > > } > > > > Also, just for optimization, I'd move that byte[] buffer = new > byte[10]; > > out of the while since you don't need to reallocate it every iteration. > > > ------------------------------ > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On Behalf > Of *F?bio Cristiano dos Anjos > *Sent:* Friday, November 02, 2007 8:35 AM > *To:* RXTX Developers and Users > *Subject:* Re: [Rxtx] serialEvent(SerialPortEvent event) never be > triggered > > > > Hi, > > I think i missunderstand something here. > The code you post here was meant to be used inside serialEvent method, > right? > > The think is, that i cannot user SerialEventListener to read serial ports, > because i need to read virual serial ports and id does not behaves well, as > said here before. serialEvent is never triggered. > > So what I quit using SerialEventListener and created a thread to listen to > the port: > > public void run(){ > try{ > in = port.getInputStream(); > out = port.getOutputStream (); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new > String(buffer,0,numBytes,"ASCII"); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ getReceptor().getPort() > ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > } > > > So, the problem is that in.read(buffer) always returns 0 when there is > nothing to read, instead of blocking the flow, and the thread becames locked > in the loop. > > I hope you can help me solve this. > > Thanks in advance! > > F?bio > -------- > > On 11/2/07, *F?bio Cristiano dos Anjos* wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > > > On 11/1/07, *Andre-John Mas* < ajmas at sympatico.ca> wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info ("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/571df6ea/attachment-0016.html From tjarvi at qbang.org Fri Nov 2 08:32:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Nov 2007 08:32:15 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: References: Message-ID: On Fri, 2 Nov 2007, Greg Johnson wrote: > Hi Trent, folks, > Having a single rxtx that is suitable for commercial uses and hobbyists both > would be a great idea? Perhaps it would be worth submitting rxtx as a > proposal to Codehaus - they not only provide excellent tools (Jira (bug > tracker), Confluence (wiki)) but also support build management ( > maestro, continuum, bamboo). Relying on your personal machine (btw, frii.com > / rxtx.org is down again?) seems like a burden you shouldn't have to shoulder > alone. Hi Greg, There may be a little confusion here. There is no need to have two seperate rxtx releases. What I'm trying to encourage is a discussion between some of the people responsible for making sure rxtx does not break their products each release. Usually these people are interested in testing a set of functionality their product depends upon. They do not work with rxtx code but rather traps to catch when rxtx developers break something. This goes on all the time in isolated labs. There are many services that offer to do various pieces of a project for you if you... Anyone is free to do the 'if you' portion with rxtx and see how it goes. I'm actually interested in doing less of that than more. The rxtx.org work I do just happens to overlap with other things I do for personal/family use. The reason I suggest the amazon solution is that anyone can take full control of the environment for a day and it costs less than a package of gum without causing harm to what anyone else is doing. I assume the down question was with respect to a mod_security setting that has been resolved. If not, please post a url to the problem. -- Trent Jarvi tjarvi at qbang.org From nsayer at kfu.com Sat Nov 3 20:17:49 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 19:17:49 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? Message-ID: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Has anyone got RXTX working with an app under Leopard? My app hangs on port open (it works fine with Tiger). The relevant thread looks like this in the activity monitor: 1536 JVM_InvokeMethod 1536 0x48ccd0 1536 0x46f8a0 1536 0x4c3ff4 1536 0x4c4284 1536 0x357d160 1536 0x357faac 1536 Java_gnu_io_RXTXPort_open 1536 open $NOCANCEL$UNIX2003 1536 open $NOCANCEL$UNIX2003 From ajmas at sympatico.ca Sat Nov 3 22:02:04 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 00:02:04 -0400 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> RXTX works for me with Leopard. I am currently using it communicate with a Bluetooth GPS. What computer and device are you trying to use? Is the driver for your serial device compatible with MacOS X 10.5? Andre On 3-Nov-07, at 22:17 , Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From nsayer at kfu.com Sat Nov 3 22:17:47 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 21:17:47 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> Message-ID: <1720F723-3643-438C-B3AB-E09A67536977@kfu.com> On Nov 3, 2007, at 9:02 PM, Andre-John Mas wrote: > RXTX works for me with Leopard. I am currently using it communicate > with a Bluetooth GPS. > > What computer and device are you trying to use? Is the driver for > your serial device compatible with MacOS X 10.5? An Intel mac mini The FTDI USB serial driver an XMPCR, which is just a fancy serial controlled radio and an FTDI usb-to-serial chip I've successfully used the FTDI driver with another FTDI device in another context. > > > Andre > > On 3-Nov-07, at 22:17 , Nick Sayer wrote: > >> Has anyone got RXTX working with an app under Leopard? >> >> My app hangs on port open (it works fine with Tiger). The relevant >> thread looks like this in the activity monitor: >> >> 1536 JVM_InvokeMethod >> 1536 0x48ccd0 >> 1536 0x46f8a0 >> 1536 0x4c3ff4 >> 1536 0x4c4284 >> 1536 0x357d160 >> 1536 0x357faac >> 1536 >> Java_gnu_io_RXTXPort_open >> 1536 open >> $NOCANCEL$UNIX2003 >> 1536 open >> $NOCANCEL$UNIX2003 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From racecar at gmail.com Sat Nov 3 22:25:53 2007 From: racecar at gmail.com (Kevin Mateo Lim) Date: Sat, 3 Nov 2007 21:25:53 -0700 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: Message-ID: I am alternating between two errors. After i run the macosx_setup.command, "everyone" is set to Read only in /var/lock. I notice in the terminal that the group for these perms is _uucp, not uucp. In that state, I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 check_group_uucp(): error testing lock file creation Error details:Permission deniedcheck_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException : Error inside Serial.() at processing.serial.Serial.errorMessage(Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.( Serial.java:102) at Temporary_829_3245.setup(Temporary_829_3245.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java :690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) Then, I hand edit the "everyone" permissions for /var/lock/ to Read and Write (note /var/spool/uucp is Read/Write in all cases, and doesn't change). I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX uucp_lock() /var/lock/LK.003.009.000 is there gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException: Error inside Serial.() at processing.serial.Serial.errorMessage (Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.(Serial.java:102) at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java:690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) See here: http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071103/f1a2c467/attachment-0015.html From greg.johnson at manchester.ac.uk Sun Nov 4 02:31:13 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sun, 4 Nov 2007 10:31:13 +0100 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <28B5E0A0-0802-4C74-AC21-87ED35F3B9A2@manchester.ac.uk> Hi Nick, I also had problems initially with Leopard, but it was resolved by reinstalling the serial USB driver (FTDI in my case). The symptoms were a non-detection of any ports (but I twigged when I tried ZTerm and it had the same problem). Good luck! Cheers, greg PS I did a "Archive and install" which may be the reason my FTDI driver had disappeared - I don't think the driver has changed for 10.5 ------------------------------------------------------------------------- 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 4 Nov 2007, at 03:17, Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Sun Nov 4 13:01:12 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 15:01:12 -0500 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: Message-ID: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Hi, You will need to get the 2.1-8 code from CVS. See the FAQ for more information: http://rxtx.qbang.org/wiki/index.php/FAQ Andre On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > I am alternating between two errors. > > After i run the macosx_setup.command, "everyone" is set to Read only > in /var/lock. I notice in the terminal that the group for these > perms is _uucp, not uucp. > > In that state, I get this error: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > check_group_uucp(): error testing lock file creation Error > details:Permission deniedcheck_lock_status: No permission to create > lock file. > please see: How can I use Lock Files with rxtx? in INSTALL > gnu.io.PortInUseException: Unknown Application > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > java.lang.RuntimeException : Error inside Serial.() > > at processing.serial.Serial.errorMessage(Serial.java:583) > > at processing.serial.Serial.(Serial.java:148) > > at processing.serial.Serial.( Serial.java:102) > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > at processing.core.PApplet.run(PApplet.java:1556) > > at java.lang.Thread.run(Thread.java:613) > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > and Write (note /var/spool/uucp is Read/Write in all cases, and > doesn't change). I get this error: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > gnu.io.PortInUseException: Unknown Application > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > java.lang.RuntimeException: Error inside Serial.() > > at processing.serial.Serial.errorMessage (Serial.java:583) > > at processing.serial.Serial.(Serial.java:148) > > at processing.serial.Serial.(Serial.java:102) > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > at processing.core.PApplet.run(PApplet.java:1556) > > at java.lang.Thread.run(Thread.java:613) > > See here: > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From netbeans at gatworks.com Sun Nov 4 14:33:35 2007 From: netbeans at gatworks.com (U. George) Date: Sun, 04 Nov 2007 16:33:35 -0500 Subject: [Rxtx] #ifndef TIOCSERGETLSR Message-ID: <472E3AAF.7050709@gatworks.com> For Linux, it seems that you need the code for both *having* a TIOCSERGETLSR, and *not having* a TIOCSERGETLSR. Maybe the ioctl exists system wide, but not necessarily for the device driver itself ( always returns -1 ) . Are there systems that have a *functioning* TIOCSERGETLSR for all their devices? Then this would be the case where the "#ifndef TIOCSERGETLSR" directive could be useful is eliminating the unnecessary code and tests. And for those systems that dont have a TIOCSERGETLSR, then the code for TIOCSERGETLSR can be eliminated. It would be a simple case to have, as a foundation, all the code to simulate the missing TIOCSERGETLSR ioctl. If the system does have the ioctl, then that code can be ifdef'd in, and co-exist with the functionality of the code that simulates the missing TIOCSERGETLSR ioctl. From racecar at gmail.com Sun Nov 4 17:30:19 2007 From: racecar at gmail.com (Kevin Mateo Lim) Date: Sun, 4 Nov 2007 17:30:19 -0700 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: the README.OSX reads: Put libSerial.jnilib in the directory of the application (the JavaVM will find it there). Add RXTXComm.jar to the application classpath or include the classes in the application jar. (Some applications already include the RXTX classes in their application jar, in which case only the file libSerial.jnilib is required). I can't find libSerial.jnilib I put librxtxSerial.jnilib into my Processing /libraries/serial/library/ directory. Yet it still sees the old version: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 On 11/4/07, Andre-John Mas wrote: > > Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > 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/20071104/c0a83f91/attachment-0014.html From ajmas at sympatico.ca Sun Nov 4 17:41:47 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 19:41:47 -0500 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> If you are wanting it to be available for all applications, - for all users: /Library/Java/Extensions - for your user: ~/Library/Java/Extensions Or just for your application, then it should be in the same directory from which yo are launching your application. If you are getting the 2.1-8 source, then the library built is called: librxtxSerial.jnilib despite what the docs say. Andre On 4-Nov-07, at 19:30 , Kevin Mateo Lim wrote: > > the README.OSX reads: > Put > libSerial.jnilib > in the directory of the application (the JavaVM will find it there). > Add > RXTXComm.jar > to the application classpath or include the classes in the > application jar. > (Some applications already include the RXTX classes in their > application jar, > in which case only the file libSerial.jnilib is required). > > > I can't find libSerial.jnilib > I put librxtxSerial.jnilib into my Processing /libraries/serial/ > library/ directory. > > Yet it still sees the old version: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > On 11/4/07, Andre-John Mas wrote: Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial .(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay (PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > From bschlining at gmail.com Sun Nov 4 19:46:23 2007 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 4 Nov 2007 18:46:23 -0800 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> Message-ID: > > Or just for your application, then it should be in the same directory > from which yo are launching your application. Just wanted to add one more way of specifying the native lib location... If you don't want to define it globally by putting it in /Library/Java/Extensions (and you don't, it's a very very bad practice) you can also specify the location of the native library when starting the JVM by specifying the 'java.library.path' property. For example: java -Djava.library.path=/Path/To/Directory/With/RXTX/Library YourMainClass -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071104/c5af6980/attachment-0014.html From greg.johnson at manchester.ac.uk Mon Nov 5 01:39:02 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Mon, 5 Nov 2007 09:39:02 +0100 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: The 2.1-8 code reports 2.1-7, hence your (and my) confusion. But as long as you've removed all traces of the old library, it really _is_ 2.1-8. And if you specify the library path to the VM, don't make my mistake (on OSX at least) - you need to respecify the entire library path it had by default, as the command line argument replaces the path, rather than appending to it. 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 5 Nov 2007, at 01:30, Kevin Mateo Lim wrote: > > the README.OSX reads: > Put > libSerial.jnilib > in the directory of the application (the JavaVM will find it there). > Add > RXTXComm.jar > to the application classpath or include the classes in the > application jar. > (Some applications already include the RXTX classes in their > application jar, > in which case only the file libSerial.jnilib is required). > > > I can't find libSerial.jnilib > I put librxtxSerial.jnilib into my Processing /libraries/serial/ > library/ directory. > > Yet it still sees the old version: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > On 11/4/07, Andre-John Mas wrote: > Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial .(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay (PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > 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 HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071105/7f50506d/attachment-0014.html From cyrille.dumont at tatexpress.fr Mon Nov 5 05:46:03 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 05 Nov 2007 13:46:03 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: References: <472727F1.1000704@tatexpress.fr> Message-ID: <472F108B.2090101@tatexpress.fr> Thanks a lot for your solution ... but I'm not a expert in JAVA ... (sorry) For the moment I've this function : """ public void serialEvent(SerialPortEvent e) { StringBuffer inputBuffer = new StringBuffer(); int newData = 0; switch (e.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } //-- Manag. Data from Scanner this.MngDataScanner(inputBuffer.toString()); break; case SerialPortEvent.BI:; //-- Break Received } } """ How can I do what you write ? ( maybe a simple ex ? ) PS : I don't know the PDF417 size (could be, for example, 338 char, or 500 ... ; what I know is that it can't be more than 800 char) Thanks in advance. Best regards. Trent Jarvi a ?crit : > 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 Martin.Oberhuber at windriver.com Mon Nov 5 08:47:50 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 5 Nov 2007 16:47:50 +0100 Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> Hi Trent, are the interestes of hobbyists really so different from commercial ones? Both should be interested in high quality and innovation the like. I haven't seen too many Open Source projects from the "inside" but those that I have seen did not have separate mailing lists for quality/testing/qa versus innovation/development. What I have seen with the Open Source projects that one would call "successful" is a good deal of process around automated builds, automated unit tests, predictable release dates and milestones, and policies around commiting/contributing/reviewing changes. I think that all of these benefit commercial users and hobbyists the like. If you were just asking about who's interested in discussing changes to foster more quality, count me in. I'm just not sure whether discussing these on a separate mailing list or other channel is the right thing to do. Cheers, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From toupsz at cs.tamu.edu Tue Nov 6 14:27:04 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 15:27:04 -0600 Subject: [Rxtx] reading TTL level signals from serial? Message-ID: Dear RXTX community- I've been using RXTX to handle communicating with several hardware devices in Java (a GPS and some custom audio circuitry for my dissertation work). I have a new, high-accuracy GPS which only communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there any way to communicate with this device using RXTX, perhaps by modding the native code for Windows? If so, does anyone have any tips on how to do it? Has it perhaps already been done? Another option is for me to invert / amplify the signal in hardware, but this is difficult for me to pull off due to the sensitivity of the electronics involved...I'll likely end up using a much less accurate piece of equipment rather than go that far! If anyone could help out, I'd really appreciate it! Thanks! -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/b6c59c2b/attachment-0012.html From netbeans at gatworks.com Tue Nov 6 14:55:22 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 06 Nov 2007 16:55:22 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: Message-ID: <4730E2CA.3090009@gatworks.com> This is really a hardware issue. Is there any device ( ie the serial port ) on your computer that will accept the voltage signals ( and load ) that your device produces? Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it happen safely ( ie u dont cook the GPS device ) I have a new, high-accuracy GPS which only > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there > any way to communicate with this device using RXTX, From toupsz at cs.tamu.edu Tue Nov 6 15:14:01 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 16:14:01 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4730E2CA.3090009@gatworks.com> References: <4730E2CA.3090009@gatworks.com> Message-ID: Actually, the device runs over USB, but shows up as a virtual serial port and is outputting these signals. The software that comes with the device (a u-blox ANTARIS 4 eval kit) is able to communicate. RXTX is able to detect and properly configure the port, but does not get any of the data from it. :-/ It seems like there must be some way to do it (obviously, ublox knows how)... -Zach On Nov 6, 2007 3:55 PM, U. George wrote: > This is really a hardware issue. > Is there any device ( ie the serial port ) on your computer that will > accept the voltage signals ( and load ) that your device produces? > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it > happen safely ( ie u dont cook the GPS device ) > > > I have a new, high-accuracy GPS which only > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there > > any way to communicate with this device using RXTX, > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/15ae7a0b/attachment-0012.html From keithvz at verizon.net Tue Nov 6 16:16:55 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 06 Nov 2007 18:16:55 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> Message-ID: <4730F5E7.1030704@verizon.net> Zach Toups wrote: > On Nov 6, 2007 3:55 PM, U. George > wrote: > > This is really a hardware issue. > Is there any device ( ie the serial port ) on your computer that will > accept the voltage signals ( and load ) that your device produces? > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it > happen safely ( ie u dont cook the GPS device ) > > > I have a new, high-accuracy GPS which only > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is > there > > any way to communicate with this device using RXTX, > _______________________________________________ As UGeorge intimated, it's a hardware issue. If your device outputs TTL level voltages, and your USB to serial converter is RS-232, then you've got a physical hardware differences. Inverted leads and voltage issues are mainly the problem. MAXIM makes a neat little chip called the MAX233 (better than the 232, no extern caps required) You can't solve this in software. Now, there are TTL level compatible USB to serial converters available, I happen to be using one right now. This unit below is from a UK company (there might be sources in the US) http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm Parallax makes one that does 3.3 and 5v http://www.parallax.com/detail.asp?product_id=32201 (but only supports RX, TX, GND, AND DTR towards device) (i've tested a variant of the unit above, and it works with RXTX) In both cases, you'll need some creative wiring depending on the interface on your GPS. Hope this helps Keith From toupsz at cs.tamu.edu Tue Nov 6 16:53:01 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 17:53:01 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4730F5E7.1030704@verizon.net> References: <4730E2CA.3090009@gatworks.com> <4730F5E7.1030704@verizon.net> Message-ID: Yeah...I used an FTDI chip to handle USB/serial conversion on the audio equipment I built. I'm leery of trying to build a board for this ublox GPS due to all the grounding/shielding issues around it. Anyway, I apreciate the help...just sad that I can't handle the problem in software! Ublox did send me the source code for their USB drivers...but as a Java programmer, it's a bit tough for me to sort out. ;) Thanks again! -Zach On Nov 6, 2007 5:16 PM, Keith Monahan wrote: > Zach Toups wrote: > > > On Nov 6, 2007 3:55 PM, U. George > > wrote: > > > > This is really a hardware issue. > > Is there any device ( ie the serial port ) on your computer that > will > > accept the voltage signals ( and load ) that your device produces? > > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make > it > > happen safely ( ie u dont cook the GPS device ) > > > > > > I have a new, high-accuracy GPS which only > > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is > > there > > > any way to communicate with this device using RXTX, > > _______________________________________________ > > As UGeorge intimated, it's a hardware issue. > > If your device outputs TTL level voltages, and your USB to serial > converter is RS-232, then you've got a physical hardware differences. > Inverted leads and voltage issues are mainly the problem. MAXIM makes a > neat little chip called the MAX233 (better than the 232, no extern caps > required) > > You can't solve this in software. > > Now, there are TTL level compatible USB to serial converters available, > I happen to be using one right now. > > This unit below is from a UK company (there might be sources in the US) > > http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm > > Parallax makes one that does 3.3 and 5v > > http://www.parallax.com/detail.asp?product_id=32201 > (but only supports RX, TX, GND, AND DTR towards device) > > (i've tested a variant of the unit above, and it works with RXTX) > > In both cases, you'll need some creative wiring depending on the > interface on your GPS. > > Hope this helps > > Keith > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/06e88ad4/attachment-0012.html From netbeans at gatworks.com Tue Nov 6 17:14:01 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 06 Nov 2007 19:14:01 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> <4730F5E7.1030704@verizon.net> Message-ID: <47310349.5000406@gatworks.com> what gps chipset do u have? > Ublox did send me the source code for their USB drivers...but as a Java > programmer, it's a bit tough for me to sort out. ;) From Steffen.DETTMER at ingenico.com Wed Nov 7 03:10:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 7 Nov 2007 11:10:01 +0100 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> Message-ID: <20071107101000.GN10978@elberon.bln.de.ingenico.com> * Zach Toups wrote on Tue, Nov 06, 2007 at 16:14 -0600: > Actually, the device runs over USB, but shows up as a virtual > serial port and is outputting these signals. Ahh, so what you want is to use rxtx on the serial port that is created by the driver and mapped maybe as some COM8 or whatever? I this case then IMHO it would be no hardware question but maybe a problem in your application, or some driver or indeed a rxtx issue. > The software that > comes with the device (a u-blox ANTARIS 4 eval kit) is able to > communicate. Is it sure that this software is really using the virtual serial port and only this port? oki, Steffen -- About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Wed Nov 7 04:59:10 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 06:59:10 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <20071107101000.GN10978@elberon.bln.de.ingenico.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> Message-ID: <4731A88E.6080705@gatworks.com> >> The software that >> comes with the device (a u-blox ANTARIS 4 eval kit) is able to >> communicate. > > Is it sure that this software is really using the virtual serial > port and only this port? > I have tried to read the docs. I have yet to find any explanation on a (windoz) device driver for this device ( the usb device ). That magic is not explained. For a developer thats important magic. Maybe a call to their support team is in order? From netbeans at gatworks.com Wed Nov 7 05:01:38 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 07:01:38 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <20071107101000.GN10978@elberon.bln.de.ingenico.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> Message-ID: <4731A922.7@gatworks.com> Steffen DETTMER wrote: > * Zach Toups wrote on Tue, Nov 06, 2007 at 16:14 -0600: >> Actually, the device runs over USB, but shows up as a virtual BTW: it seems that I am not getting all the Rxtx mail. Is there still a problem? From toupsz at cs.tamu.edu Wed Nov 7 07:36:20 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Wed, 7 Nov 2007 08:36:20 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4731A88E.6080705@gatworks.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> <4731A88E.6080705@gatworks.com> Message-ID: When I emailed them about this issue, they sent me their WinCE drivers, which are apparently based on this open source driver: http://www.yetanotherhomepage.com/j7xx/j7xx.html?/j7xx/software/util/usbdriver.html These include srcdll, and x86 subfolders, though it's not 100% clear to me that these are useful. The ublox communication suite appears to only communicate with serial ports...I've communicated with the ublox on two different comm ports (one with the serial adapter plugged into the serial port, one with the main USB connection), as well as a Garmin bluetooth GPS (which comes up as a bluetooth serial device). I'm not well versed in code this close to the hardware, but it seems to me that if you're running a virtual serial port, then you're virtually controlling the "voltages" that come in on this "port"...so why would they be "ttl level"? :-/ Shouldn't the USB driver be able to interpret the signals in whatever way it wants and just supply software with the binary interpretation? Thanks for all the help, guys, it's really appreciated! -Zach On Nov 7, 2007 5:59 AM, U. George wrote: > > >> The software that > >> comes with the device (a u-blox ANTARIS 4 eval kit) is able to > >> communicate. > > > > Is it sure that this software is really using the virtual serial > > port and only this port? > > > > I have tried to read the docs. I have yet to find any explanation on a > (windoz) device driver for this device ( the usb device ). That magic > is not explained. For a developer thats important magic. Maybe a call > to their support team is in order? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071107/18a13314/attachment-0011.html From netbeans at gatworks.com Wed Nov 7 08:55:55 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 10:55:55 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> <4731A88E.6080705@gatworks.com> Message-ID: <4731E00B.9030902@gatworks.com> There are 2 components to talking to hardware. There is the electrical specification, and then there is the software specification. there is the rs232 specification, parallel port specification, and the USB electrical specification. Generally these are used to plug in the various devices, and hook up electrically. Then there is the software side. There is the device driver, a software component that sits somewhere in the kernel that handles the USB ( in your case ) controller. The device driver generally does not care about the electrical component. There are various chips that handle USB signals, and these chips have I/O addresses so that signals and data can be properly routed. There is also the side that communicates to the user via the COM port device-name. The device driver that you mentioned is for the "Support PL2303 serial chip". This device driver, which hopefully works, handles the USB chip, and eventually recognzes the gps device, and hopefully creates an COM port so the user can open up and communicate. These are a lot of "HOPES". Since u have the web address of the device driver, and developer, I would think that the developer, and any docs, might be better able to help u to first determine if the GPS device is recognized, and the COM port ( maybe its called by another name ) is created, as per documentation. > > These include srcdll, and x86 subfolders, though it's not 100% clear to > me that these are useful. From tjarvi at qbang.org Sat Nov 10 17:46:13 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Nov 2007 17:46:13 -0700 (MST) Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 5 Nov 2007, Oberhuber, Martin wrote: > Hi Trent, > > are the interestes of hobbyists really so different > from commercial ones? Both should be interested in > high quality and innovation the like. > > I haven't seen too many Open Source projects from the > "inside" but those that I have seen did not have > separate mailing lists for quality/testing/qa > versus innovation/development. > > What I have seen with the Open Source projects that > one would call "successful" is a good deal of > process around automated builds, automated unit > tests, predictable release dates and milestones, > and policies around commiting/contributing/reviewing > changes. > > I think that all of these benefit commercial users > and hobbyists the like. > > If you were just asking about who's interested in > discussing changes to foster more quality, count > me in. I'm just not sure whether discussing these > on a separate mailing list or other channel is the > right thing to do. > Hi Martin, There are two issues I'm thinking about. The first is the generic unit testing and quality initiatives required to move rxtx forward. The second is the inevitable fact that rxtx connects to external hardware. The discussion deals with a different set of problems. Here is a simple example of what I'm getting at. We have the capability of setting custom baud rates in rxtx. We may be interested in seeing regressions in rxtx, the C library or the kernel. Some people may be doing some tests with loopback connections. These will always work even if the baud rate is not set to the expected value. Some people may use null modems between two ports. This may be able to catch the problem but not always. Will the build machines be able to test this? (no - for a few reasons) Will people be trying to catch these type of regressions? (yes) What type of coverage does the community have in the end? (?) We could include the discussions in the same list or another equally open list that may be of interest to some folks that deal with these types of problems on a regular basis. -- Trent Jarvi tjarvi at qbang.org From timlow84 at gmail.com Mon Nov 12 00:31:17 2007 From: timlow84 at gmail.com (Timothy Low) Date: Mon, 12 Nov 2007 15:31:17 +0800 Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> Message-ID: <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> ---------- Forwarded message ---------- From: Timothy Low Date: Nov 12, 2007 3:02 PM Subject: Building RXTX From Source To: taj at www.linux.org.uk Cc: ferdinand.tang at tangs.net, Timothy Low , chweehuat.ng at tangs.net Hi Trent, I tried building RXTX from source, and I got this error. I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm trying to get the necessary ".so" files to use for my serial port communication through java. My linux kernal information is: *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 x86_64 x86_64 x86_64 GNU/Linux* I'll most glad if you can provide me some direction on this. Thanks ! ---------------- [root at smsgateway rxtx-2.0-7pre1]# ./configure checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu configure: WARNING: Trying libtool. If the following fails install libtool checking for gcc... gcc checking for C compiler default output... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking for ld used by GCC... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking for a sed that does not truncate output... /bin/sed checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking command to parse /usr/bin/nm -B output... ok checking how to run the C preprocessor... gcc -E checking for egrep... grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for ranlib... ranlib checking for strip... strip checking for objdir... .libs checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.lo... yes checking if gcc supports -fno-rtti -fno-exceptions... yes checking whether the linker (/usr/bin/ld) supports shared libraries... yes checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking dynamic linker characteristics... GNU/Linux ld.so checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no checking whether -lc should be explicitly linked in... no creating libtool checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking for style of include used by make... GNU checking dependency style of gcc... none checking fcntl.h usability... yes checking fcntl.h presence... yes checking for fcntl.h... yes checking sys/fcntl.h usability... yes checking sys/fcntl.h presence... yes checking for sys/fcntl.h... yes checking sys/file.h usability... yes checking sys/file.h presence... yes checking for sys/file.h... yes checking sys/time.h usability... yes checking sys/time.h presence... yes checking for sys/time.h... yes checking sys/signal.h usability... yes checking sys/signal.h presence... yes checking for sys/signal.h... yes checking signal.h usability... yes checking signal.h presence... yes checking for signal.h.. . yes checking termios.h usability... yes checking termios.h presence... yes checking for termios.h... yes checking asm/termbits.h usability... yes checking asm/termbits.h presence... yes checking for asm/termbits.h... yes checking grp.h usability... yes checking grp.h presence... yes checking for grp.h... yes checking pwd.h usability... yes checking pwd.h presence... yes checking for pwd.h... yes checking whether gcc needs -traditional... no checking whether to enable maintainer-specific portions of Makefiles... no /usr/java/jdk1.5.0_13 configure: WARNING: using JAVA_HOME environmental variable adjusted java.home is /usr/java/jdk1.5.0_13 checking os.name Linux checking os.arch i386 checking java.vendor Sun Microsystems Inc. checking java.version 1.5.0_13 checking os.version 2.6.18-8.el5xen comm.jar appears to be installed already. conftest.c: In function 'main': conftest.c:6: warning: incompatible implicit declaration of built-in function 'printf' conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:6: error: (Each undeclared identifier is reported only once conftest.c:6: error: for each function it appears in.) conftest.c:6: error: expected ')' before string constant conftest.c:7: warning: incompatible implicit declaration of built-in function 'exit' ./configure: line 9649: ./conftest: No such file or directory ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected conftest.c: In function 'main': conftest.c:5: warning: incompatible implicit declaration of built-in function 'printf' conftest.c:10: warning: incompatible implicit declaration of built-in function 'exit' configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status : config.h is unchanged config.status: executing depfiles commands [root at smsgateway rxtx-2.0-7pre1]# make install /usr/java/jdk1.5.0_13/bin/javac -classpath .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d /home/jboss/sources/rxtx- 2.0-7pre1/ -O /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java /home/jboss/sources/rxtx-2.0-7pre1/./src/UnSupportedLoggerException.java /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o /home/jboss/sources/rxtx-2.0-7pre1/x86_64-unknown-linux-gnu/SerialImp.lo /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'init_threads': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: cast from pointer to integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_nativeDrain': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: cast to pointer from integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'read_byte_array': /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: cast to pointer from integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_readArray': /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: comparison is always false due to limited range of data type /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_readTerminatedArray': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: comparison is always false due to limited range of data type mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial- 2.0.7pre1.* gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so -o .libs/librxtxSerial-2.0.7pre1.so (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.0.7pre1.so librxtxSerial.so) creating librxtxSerial.la (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la librxtxSerial.la) gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/ParallelImp.lo /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function 'Java_javax_comm_LPRPort_readArray': /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: comparison is always false due to limited range of data type rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* .libs/librxtxParallel-2.0.7pre1.* gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so -o .libs/librxtxParallel- 2.0.7pre1.so (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.0.7pre1.so librxtxParallel.so) creating librxtxParallel.la (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la librxtxParallel.la) make all-am make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' libtool: install: `x86_64-unknown-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 ------------- Regards, Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071112/27758c3c/attachment-0007.html From tjarvi at qbang.org Mon Nov 12 01:02:09 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Nov 2007 01:02:09 -0700 (MST) Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> Message-ID: On Mon, 12 Nov 2007, Timothy Low wrote: > > Hi Trent, Hi Tim, Comments are inline. As I mentioned off the list, rxtx 2.0 is on the edge of deprecation. We can get it working but this is not the path of least resistance for future work. You will probably need to bounce another round of questions off the list. The following is intended to isolate the problem. > > I tried building RXTX from source, and I got this error. > > > I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm trying > to get the necessary ".so" files to use for my serial port communication > through java. > My linux kernal information is: > > *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 x86_64 > x86_64 x86_64 GNU/Linux* > > I'll most glad if you can provide me some direction on this. Thanks ! > > ---------------- > [root at smsgateway rxtx-2.0-7pre1]# ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > checking for C compiler default output... a.out > checking whether the C compiler works... yes > checking whether we are cross compiling... no > checking for suffix of executables... > checking for suffix of object files... o > checking whether we are using the GNU C compiler... yes > checking whether gcc accepts -g... yes > checking for gcc option to accept ANSI C... none needed > checking for ld used by GCC... /usr/bin/ld > checking if the linker (/usr/bin/ld) is GNU ld... yes > checking for /usr/bin/ld option to reload object files... -r > checking for BSD-compatible nm... /usr/bin/nm -B > checking for a sed that does not truncate output... /bin/sed > checking whether ln -s works... yes > checking how to recognise dependent libraries... pass_all > checking command to parse /usr/bin/nm -B output... ok > checking how to run the C preprocessor... gcc -E > checking for egrep... grep -E > checking for ANSI C header files... yes > checking for sys/types.h... yes > checking for sys/stat.h... yes > checking for stdlib.h... yes > checking for string.h... yes > checking for memory.h... yes > checking for strings.h... yes > checking for inttypes.h... yes > checking for stdint.h... yes > checking for unistd.h... yes > checking dlfcn.h usability... yes > checking dlfcn.h presence... yes > checking for dlfcn.h... yes > checking for ranlib... ranlib > checking for strip... strip > checking for objdir... .libs > checking for gcc option to produce PIC... -fPIC > checking if gcc PIC flag -fPIC works... yes > checking if gcc static flag -static works... yes > checking if gcc supports -c -o file.o... yes > checking if gcc supports -c -o file.lo... yes > checking if gcc supports -fno-rtti -fno-exceptions... yes > checking whether the linker (/usr/bin/ld) supports shared libraries... yes > checking how to hardcode library paths into programs... immediate > checking whether stripping libraries is possible... yes > checking dynamic linker characteristics... GNU/Linux ld.so > checking if libtool supports shared libraries... yes > checking whether to build shared libraries... yes > checking whether to build static libraries... no > checking whether -lc should be explicitly linked in... no > creating libtool > checking for a BSD-compatible install... /usr/bin/install -c > checking whether build environment is sane... yes > checking for gawk... gawk > checking whether make sets $(MAKE)... yes > checking for style of include used by make... GNU > checking dependency style of gcc... none > checking fcntl.h usability... yes > checking fcntl.h presence... yes > checking for fcntl.h... yes > checking sys/fcntl.h usability... yes > checking sys/fcntl.h presence... yes > checking for sys/fcntl.h... yes > checking sys/file.h usability... yes > checking sys/file.h presence... yes > checking for sys/file.h... yes > checking sys/time.h usability... yes > checking sys/time.h presence... yes > checking for sys/time.h... yes > checking sys/signal.h usability... yes > checking sys/signal.h presence... yes > checking for sys/signal.h... yes > checking signal.h usability... yes > checking signal.h presence... yes > checking for signal.h.. . yes > checking termios.h usability... yes > checking termios.h presence... yes > checking for termios.h... yes > checking asm/termbits.h usability... yes > checking asm/termbits.h presence... yes > checking for asm/termbits.h... yes > checking grp.h usability... yes > checking grp.h presence... yes > checking for grp.h... yes > checking pwd.h usability... yes > checking pwd.h presence... yes > checking for pwd.h... yes > checking whether gcc needs -traditional... no > checking whether to enable maintainer-specific portions of Makefiles... no > /usr/java/jdk1.5.0_13 > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /usr/java/jdk1.5.0_13 > checking os.name Linux > checking os.arch i386 > checking java.vendor Sun Microsystems Inc. > checking java.version 1.5.0_13 > checking os.version 2.6.18-8.el5xen > comm.jar appears to be installed already. > conftest.c: In function 'main': > conftest.c:6: warning: incompatible implicit declaration of built-in > function 'printf' > conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:6: error: (Each undeclared identifier is reported only once > conftest.c:6: error: for each function it appears in.) > conftest.c:6: error: expected ')' before string constant This is an outdated kernel version check for when headers and kernels could cause problems for rxtx. If we made it past this, then you are OK. > conftest.c:7: warning: incompatible implicit declaration of built-in > function 'exit' > ./configure: line 9649: ./conftest: No such file or directory > ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected It blew up but continues.. > conftest.c: In function 'main': > conftest.c:5: warning: incompatible implicit declaration of built-in > function 'printf' > conftest.c:10: warning: incompatible implicit declaration of built-in > function 'exit' > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status : config.h is unchanged > config.status: executing depfiles commands > [root at smsgateway rxtx-2.0-7pre1]# make install > /usr/java/jdk1.5.0_13/bin/javac -classpath > .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d > /home/jboss/sources/rxtx- 2.0-7pre1/ -O > /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java > /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/UnSupportedLoggerException.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java > Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or > overrides a deprecated API. > Note: Recompile with -Xlint:deprecation for details. > /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* The java jar should be fine now. You may need to change the source files as mentioned below. > gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. > -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g > -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o > /home/jboss/sources/rxtx-2.0-7pre1/x86_64-unknown-linux-gnu/SerialImp.lo > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'init_threads': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: cast > from pointer to integer of different size > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_nativeDrain': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: cast to > pointer from integer of different size > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'read_byte_array': > /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: cast to > pointer from integer of different size As I recall, this was caused by pointers (now 64 bit rather than 32 bit) being stored in java ints (jints). I would look at the diff between the CVS 2.1 SerialImp.c and RXTXPort.java files against 2.0. We did fix those issues. You have a .so file but the different pointer sizes will cause runtime errors. > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_readArray': > /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: > comparison is always false due to limited range of data type > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_readTerminatedArray': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: > comparison is always false due to limited range of data type > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial- > 2.0.7pre1.* > gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so -o > .libs/librxtxSerial-2.0.7pre1.so > (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.0.7pre1.so > librxtxSerial.so) > creating librxtxSerial.la > (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la > librxtxSerial.la) > gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. > -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g > -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o > /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/ParallelImp.lo > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function > 'Java_javax_comm_LPRPort_readArray': > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: > comparison is always false due to limited range of data type > rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* > .libs/librxtxParallel-2.0.7pre1.* > gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so -o > .libs/librxtxParallel- 2.0.7pre1.so > (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.0.7pre1.so > librxtxParallel.so) > creating librxtxParallel.la > (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la > librxtxParallel.la) > make all-am > make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' > make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' > libtool: install: `x86_64-unknown-linux-gnu' must be an absolute directory > name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 A libtool change? Assuming you ran configure && make install in /home/jboss/sources/rxtx- 2.0-7pre1, libtool is looking for /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/.libs/librxtxSerial-2.0.7pre1.so. I think you have this? The file is just being copied to ~JAVA/jre/lib/$(JAVA_ARCH). -- Trent Jarvi tjarvi at qbang.org From sarah_662005 at yahoo.com Mon Nov 12 16:10:28 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Mon, 12 Nov 2007 15:10:28 -0800 (PST) Subject: [Rxtx] [urgent] device's power off detection Message-ID: <766782.10076.qm@web55803.mail.re3.yahoo.com> Hello all, I have a small application built on top of rxtx api. This application can retrieve the incoming data from a device through a port. The device can be powered off after the port get closed from the application. I have been trying a couple of hours to find a way to detect the power switching from device. If anyone knows how to handle it through rxtx, could you please give me a help? Thank you very much. r, Sara ____________________________________________________________________________________ Get easy, one-click access to your favorites. Make Yahoo! your homepage. http://www.yahoo.com/r/hs -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071112/4599f3ec/attachment-0006.html From netbeans at gatworks.com Mon Nov 12 17:52:22 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 12 Nov 2007 19:52:22 -0500 Subject: [Rxtx] [urgent] device's power off detection In-Reply-To: <766782.10076.qm@web55803.mail.re3.yahoo.com> References: <766782.10076.qm@web55803.mail.re3.yahoo.com> Message-ID: <4738F546.5010101@gatworks.com> Not sure what u are asking for. Are u asking for a way to detect if the device is OFF? Are u asking how to power off the device - via software ? Is it a Serial device? is it a parallel device? is it a usb device? Sara Hugh wrote: > Hello all, > I have a small application built on top of rxtx api. This application > can retrieve the incoming data from a device through a port. The device > can be powered off after the port get closed from the application. I > have been trying a couple of hours to find a way to detect the power > switching from device. If anyone knows how to handle it through rxtx, > could you please give me a help? Thank you very much. From tjarvi at qbang.org Mon Nov 12 22:48:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Nov 2007 22:48:11 -0700 (MST) Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711120225x562db8cbxb750767ade3b0d73@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> <900c6ba90711120031p66edc001ted76f7ba24e34b98@mail.gmail.com> <900c6ba90711120225x562db8cbxb750767ade3b0d73@mail.gmail.com> Message-ID: Hi Tim, The gnu.io namespace looks just like the javax.comm 2.0 namespace. There are additional (discouraged) undocumented methods in gnu.io that you need not use. We just used the different namespace to avoid poluting Sun's by mistake and to make sure we stayed off any potential licensing related radar. Usuaully, you just change your imports and make sure you do not use the javax.comm namespace for anything like exception handling. As I mentioned off the list, there are no issues with rxtx going through the JSR process to be more Sun friendly other than time. rxtx has no hidden intentions there; anything that does not work like CommAPI 2.0 documented is a bug. The reason we do not support CommAPI 2.1 is technical in nature and is in the list archives as well as the front page of www.rxtx.org. On Mon, 12 Nov 2007, Timothy Low wrote: > Hi Trent, > > I'll move to use a JDK1.5 64-bit version... but do I need to make any source > code changes to use the package (gnu.io) in the RTXTcomm.jar instead of the > ones from the javacomm api ? > > > Regards, > Tim > > On Nov 12, 2007 5:22 PM, Trent Jarvi wrote: > >> >> Hi Tim, >> >> I see a couple things here. >> >> First your jdk is for i686 yet the library is compiled on a x86_64 >> machine. You may try passing configure the --target=i686-unknown-linux to >> try using the i686 backend to gcc if it is available. Or move to the 64 >> bit jdk. >> >> The other error I see is again the moved UTF_RELEASE define that we need >> to fix. You can probably get around that with: >> >> make -DUTF_RELEASE=`uname -r` >> >> even more simple would be to just specify the serial library which should >> be in configure --help. >> >> You can remove the UTF_RELEASE check from configure by editing >> configure.in, searching for the simple C program check and deleting it. >> Running autoconf after that will regenerate a new configure without the >> check. >> >> Note that you should remove the previous native libraries >> (librxtxSerial.so) when moving from rxtx 2.0 to 2.1. These are compiled >> for different namespaces (javax.comm/gnu.io). >> >> On Mon, 12 Nov 2007, Timothy Low wrote: >> >>> *Hi Trent, >>> >>> I moved on to rxtx 2.1.7r2, and updated my jre to 1.6.0 (64-bit)... I >> tried >>> the following 2 methods: >>> >>> (1) using the rxtx 2.1.7 binaries from the RXTX website* >>> *Are these binaries suitable for a 64-bit OS ? There mentioning of the >>> gnu.io that you've talked about previously...* >>> ------ >>> [root at smsgateway sources]# java -Djava.library.path=/usr/lib PortLister >>> Experimental: JNI_OnLoad called. >>> >>> java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion >>> ()Ljava/lang/String; >>> at gnu.io.RXTXCommDriver.nativeGetVersion(Native Method) >>> at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:85) >>> at java.lang.Class.forName0(Native Method) >>> at java.lang.Class.forName(Unknown Source) >>> at javax.comm.CommPortIdentifier.loadDriver( >> CommPortIdentifier.java >>> :237) >>> at javax.comm.CommPortIdentifier.(CommPortIdentifier.java >>> :109) >>> at PortLister.(PortLister.java:6) >>> at PortLister.main(PortLister.java:25) >>> Exception in thread "main" java.lang.UnsatisfiedLinkError: >>> com.sun.comm.SunrayInfo.isSessionActive()Z >>> at com.sun.comm.SunrayInfo.isSessionActive(Native Method) >>> at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java >> :155) >>> at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java >>> :100) >>> at javax.comm.CommPortIdentifier.(CommPortIdentifier.java >>> :138) >>> at PortLister.(PortLister.java:6) >>> at PortLister.main(PortLister.java:25) >>> >>> ------ >>> >>> (2) compiling the rxtx 2.1.7 from source >>> *but i got the following error while running ./configure and make all* >>> >>> ------ >>> [root at smsgateway rxtx-2.1-7r2]# ./configure >>> checking build system type... x86_64-unknown-linux-gnu >>> checking host system type... x86_64-unknown-linux-gnu >>> checking target system type... x86_64-unknown-linux-gnu >>> configure: WARNING: Trying libtool. If the following fails install >> libtool >>> checking for gcc... gcc >>> checking for C compiler default output file name... a.out >>> checking whether the C compiler works... yes >>> checking whether we are cross compiling... no >>> checking for suffix of executables... >>> checking for suffix of object files... o >>> checking whether we are using the GNU C compiler... yes >>> checking whether gcc accepts -g... yes >>> checking for gcc option to accept ANSI C... none needed >>> checking for a sed that does not truncate output... /bin/sed >>> checking for egrep... grep -E >>> checking for ld used by gcc... /usr/bin/ld >>> checking if the linker (/usr/bin/ld) is GNU ld... yes >>> checking for /usr/bin/ld option to reload object files... -r >>> checking for BSD-compatible nm... /usr/bin/nm -B >>> checking whether ln -s works... yes >>> checking how to recognise dependent libraries... pass_all >>> checking how to run the C preprocessor... gcc -E >>> checking for ANSI C header files... yes >>> checking for sys/types.h... yes >>> checking for sys/stat.h... yes >>> checking for stdlib.h... yes >>> checking for string.h... yes >>> checking for memory.h... yes >>> checking for strings.h... yes >>> checking for inttypes.h... yes >>> checking for stdint.h... yes >>> checking for unistd.h... yes >>> checking dlfcn.h usability... yes >>> checking dlfcn.h presence... yes >>> checking for dlfcn.h... yes >>> checking for g++... g++ >>> checking whether we are using the GNU C++ compiler... yes >>> checking whether g++ accepts -g... yes >>> checking how to run the C++ preprocessor... g++ -E >>> checking for g77... no >>> checking for f77... no >>> checking for xlf... no >>> checking for frt... no >>> checking for pgf77... no >>> checking for fort77... no >>> checking for fl32... no >>> checking for af77... no >>> checking for f90... no >>> checking for xlf90... no >>> checking for pgf90... no >>> checking for epcf90... no >>> checking for f95... f95 >>> checking whether we are using the GNU Fortran 77 compiler... yes >>> checking whether f95 accepts -g... yes >>> checking the maximum length of command line arguments... 32768 >>> checking command to parse /usr/bin/nm -B output from gcc object... ok >>> checking for objdir... .libs >>> checking for ar... ar >>> checking for ranlib... ranlib >>> checking for strip... strip >>> checking if gcc static flag works... yes >>> checking if gcc supports -fno-rtti -fno-exceptions... no >>> checking for gcc option to produce PIC... -fPIC >>> checking if gcc PIC flag -fPIC works... yes >>> checking if gcc supports -c -o file.o... yes >>> checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking whether -lc should be explicitly linked in... no >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> checking if libtool supports shared libraries... yes >>> checking whether to build shared libraries... yes >>> checking whether to build static libraries... no >>> configure: creating libtool >>> appending configuration tag "CXX" to libtool >>> checking for ld used by g++... /usr/bin/ld -m elf_x86_64 >>> checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes >>> checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking for g++ option to produce PIC... -fPIC >>> checking if g++ PIC flag -fPIC works... yes >>> checking if g++ supports -c -o file.o... yes >>> checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> appending configuration tag "F77" to libtool >>> checking if libtool supports shared libraries... yes >>> checking whether to build shared libraries... yes >>> checking whether to build static libraries... no >>> checking for f95 option to produce PIC... -fPIC >>> checking if f95 PIC flag -fPIC works... yes >>> checking if f95 supports -c -o file.o... yes >>> checking whether the f95 linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> checking for a BSD-compatible install... /usr/bin/install -c >>> checking whether build environment is sane... yes >>> checking for gawk... gawk >>> checking whether make sets $(MAKE)... yes >>> checking for style of include used by make... GNU >>> checking dependency style of gcc... none >>> checking dependency style of g++... none >>> checking fcntl.h usability... yes >>> checking fcntl.h presence... yes >>> checking for fcntl.h... yes >>> checking sys/fcntl.h usability... yes >>> checking sys/fcntl.h presence... yes >>> checking for sys/fcntl.h... yes >>> checking sys/file.h usability... yes >>> checking sys/file.h presence... yes >>> checking for sys/file.h... yes >>> checking sys/time.h usability... yes >>> checking sys/time.h presence... yes >>> checking for sys/time.h... yes >>> checking sys/signal.h usability... yes >>> checking sys/signal.h presence... yes >>> checking for sys/signal.h... yes >>> checking signal.h usability... yes >>> checking signal.h presence... yes >>> checking for signal.h... yes >>> checking termios.h usability... yes >>> checking termios.h presence... yes >>> checking for termios.h... yes >>> checking grp.h usability... yes >>> checking grp.h presence... yes >>> checking for grp.h... yes >>> checking pwd.h usability... yes >>> checking pwd.h presence... yes >>> checking for pwd.h... yes >>> checking whether gcc needs -traditional... no >>> checking whether to enable maintainer-specific portions of Makefiles... >> no >>> /usr/java/jdk1.5.0_13 >>> configure: WARNING: using JAVA_HOME environmental variable >>> adjusted java.home is /usr/java/jdk1.5.0_13 >>> checking os.name Linux >>> checking os.arch i386 >>> checking java.vendor Sun Microsystems Inc. >>> checking java.version 1.5.0_13 >>> checking os.version 2.6.18-8.el5xen >>> conftest.c: In function 'main': >>> conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this >> function) >>> conftest.c:8: error: (Each undeclared identifier is reported only once >>> conftest.c:8: error: for each function it appears in.) >>> conftest.c:8: error: expected ')' before string constant >>> ./configure: line 21462: ./conftest: No such file or directory >>> ./configure: line 21462: test: 2.6.18-8.el5xen: unary operator expected >>> configure: creating ./config.status >>> config.status: creating Makefile >>> config.status: creating config.h >>> config.status: executing depfiles commands >>> [root at smsgateway rxtx-2.1-7r2]# make install >>> /usr/java/jdk1.5.0_13/bin/javac -classpath .:/home/jboss/sources/rxtx- >>> >> 2.1-7r2:/home/jboss/sources/rxtx-2.1-7r2/src:/usr/java/jdk1.5.0_13/jre/lib/ext/RXTXcomm.jar-d >>> /home/jboss/sources/rxtx- >>> 2.1-7r2/ -O -source 1.3 -target 1.3 >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommDriver.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortEnumerator.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortIdentifier.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortOwnershipListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Configure.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2C.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/I2CPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/LPRPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/NoSuchPortException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/PortInUseException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Raw.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/RawPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RawPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RawPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/RS485PortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485PortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485Port.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXCommDriver.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXVersion.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPort.java >>> /home/jboss/sources/rxtx-2.1-7r2 >> /./src/UnsupportedCommOperationException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/UnSupportedLoggerException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Zystem.java >>> /usr/java/jdk1.5.0_13/bin/javah -classpath .:/home/jboss/sources/rxtx- >>> >> 2.1-7r2:/home/jboss/sources/rxtx-2.1-7r2/src:/usr/java/jdk1.5.0_13/jre/lib/ext/RXTXcomm.jar-d >>> x86_64-unknown-linux-gnu -jni `(for i in CommDriver CommPortEnumerator >>> CommPortIdentifier CommPort CommPortOwnershipListener Configure I2C >>> I2CPortEvent I2CPortEventListener I2CPort LPRPort NoSuchPortException >>> ParallelPortEvent ParallelPortEventListener ParallelPort >> PortInUseException >>> Raw RawPortEvent RawPortEventListener RawPort RS485 RS485PortEvent >>> RS485PortEventListener RS485Port RXTXCommDriver RXTXPort RXTXVersion >>> SerialPortEvent SerialPortEventListener SerialPort >>> UnsupportedCommOperationException UnSupportedLoggerException Zystem;do \ >>> if grep > /dev/null native.*\( /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/$i.java; then \ >>> echo gnu.io.$i; \ >>> fi; \ >>> done)` >>> /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialImp.c -o >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo; >>> \ >>> if [ "Serial" = "Serial" ]; >>> then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxSerial.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxSerial.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo; >> \ >>> fi; \ >>> ) >>> mkdir /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/.libs >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/SerialImp.o >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/fuserImp.o >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c: In function >> 'show_user': >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c:238: warning: cast >> from >>> pointer to integer of different size >>> gcc -shared /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/SerialImp.o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/fuserImp.o >>> -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7.so -o >> .libs/librxtxSerial- >>> 2.1-7.so >>> (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.1-7.so >>> librxtxSerial.so) >>> creating librxtxSerial.la >>> (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la >>> librxtxSerial.la) >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelImp.c -o >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/ParallelImp.lo; >>> \ >>> if [ "Parallel" = "Serial" ]; >>> then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxParallel.la -rpath >>> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/ParallelImp.lo >>> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxParallel.la -rpath >>> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/ParallelImp.lo; >>> \ >>> fi; \ >>> ) >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >>> /x86_64-unknown-linux-gnu/.libs/ParallelImp.o >>> gcc -shared /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/ParallelImp.o >>> -lpthread -Wl,-soname -Wl,librxtxParallel-2.1-7.so -o >>> .libs/librxtxParallel-2.1-7.so >>> (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.1-7.so >>> librxtxParallel.so) >>> creating librxtxParallel.la >>> (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la >>> librxtxParallel.la) >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo; >>> \ >>> if [ "I2C" = "Serial" ]; then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxI2C.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo >>> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxI2C.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo; >>> \ >>> fi; \ >>> ) >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/.libs/I2CImp.o >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c: In function >>> 'Java_gnu_io_I2CPort_Initialize': >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: 'UTS_RELEASE' >>> undeclared (first use in this function) >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: (Each >> undeclared >>> identifier is reported only once >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: for each >> function >>> it appears in.) >>> libtool: link: `/home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/I2CImp.lo' >>> is not a valid libtool object >>> make: *** [x86_64-unknown-linux-gnu/librxtxI2C.la] Error 1 >>> >>> ------ >>> >>> >>> >>> On Nov 12, 2007 4:02 PM, Trent Jarvi wrote: >>> >>>> On Mon, 12 Nov 2007, Timothy Low wrote: >>>>> >>>>> Hi Trent, >>>> >>>> Hi Tim, >>>> >>>> Comments are inline. As I mentioned off the list, rxtx 2.0 is on the >> edge >>>> of deprecation. We can get it working but this is not the path of >> least >>>> resistance for future work. >>>> >>>> You will probably need to bounce another round of questions off the >> list. >>>> The following is intended to isolate the problem. >>>> >>>>> >>>>> I tried building RXTX from source, and I got this error. >>>>> >>>>> >>>>> I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm >>>> trying >>>>> to get the necessary ".so" files to use for my serial port >> communication >>>>> through java. >>>>> My linux kernal information is: >>>>> >>>>> *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 >>>> x86_64 >>>>> x86_64 x86_64 GNU/Linux* >>>>> >>>>> I'll most glad if you can provide me some direction on this. Thanks ! >>>>> >>>>> ---------------- >>>>> [root at smsgateway rxtx-2.0-7pre1]# ./configure >>>>> checking build system type... x86_64-unknown-linux-gnu >>>>> checking host system type... x86_64-unknown-linux-gnu >>>>> checking target system type... x86_64-unknown-linux-gnu >>>>> configure: WARNING: Trying libtool. If the following fails install >>>> libtool >>>>> checking for gcc... gcc >>>>> checking for C compiler default output... a.out >>>>> checking whether the C compiler works... yes >>>>> checking whether we are cross compiling... no >>>>> checking for suffix of executables... >>>>> checking for suffix of object files... o >>>>> checking whether we are using the GNU C compiler... yes >>>>> checking whether gcc accepts -g... yes >>>>> checking for gcc option to accept ANSI C... none needed >>>>> checking for ld used by GCC... /usr/bin/ld >>>>> checking if the linker (/usr/bin/ld) is GNU ld... yes >>>>> checking for /usr/bin/ld option to reload object files... -r >>>>> checking for BSD-compatible nm... /usr/bin/nm -B >>>>> checking for a sed that does not truncate output... /bin/sed >>>>> checking whether ln -s works... yes >>>>> checking how to recognise dependent libraries... pass_all >>>>> checking command to parse /usr/bin/nm -B output... ok >>>>> checking how to run the C preprocessor... gcc -E >>>>> checking for egrep... grep -E >>>>> checking for ANSI C header files... yes >>>>> checking for sys/types.h... yes >>>>> checking for sys/stat.h... yes >>>>> checking for stdlib.h... yes >>>>> checking for string.h... yes >>>>> checking for memory.h... yes >>>>> checking for strings.h... yes >>>>> checking for inttypes.h... yes >>>>> checking for stdint.h... yes >>>>> checking for unistd.h... yes >>>>> checking dlfcn.h usability... yes >>>>> checking dlfcn.h presence... yes >>>>> checking for dlfcn.h... yes >>>>> checking for ranlib... ranlib >>>>> checking for strip... strip >>>>> checking for objdir... .libs >>>>> checking for gcc option to produce PIC... -fPIC >>>>> checking if gcc PIC flag -fPIC works... yes >>>>> checking if gcc static flag -static works... yes >>>>> checking if gcc supports -c -o file.o... yes >>>>> checking if gcc supports -c -o file.lo... yes >>>>> checking if gcc supports -fno-rtti -fno-exceptions... yes >>>>> checking whether the linker (/usr/bin/ld) supports shared libraries... >>>> yes >>>>> checking how to hardcode library paths into programs... immediate >>>>> checking whether stripping libraries is possible... yes >>>>> checking dynamic linker characteristics... GNU/Linux ld.so >>>>> checking if libtool supports shared libraries... yes >>>>> checking whether to build shared libraries... yes >>>>> checking whether to build static libraries... no >>>>> checking whether -lc should be explicitly linked in... no >>>>> creating libtool >>>>> checking for a BSD-compatible install... /usr/bin/install -c >>>>> checking whether build environment is sane... yes >>>>> checking for gawk... gawk >>>>> checking whether make sets $(MAKE)... yes >>>>> checking for style of include used by make... GNU >>>>> checking dependency style of gcc... none >>>>> checking fcntl.h usability... yes >>>>> checking fcntl.h presence... yes >>>>> checking for fcntl.h... yes >>>>> checking sys/fcntl.h usability... yes >>>>> checking sys/fcntl.h presence... yes >>>>> checking for sys/fcntl.h... yes >>>>> checking sys/file.h usability... yes >>>>> checking sys/file.h presence... yes >>>>> checking for sys/file.h... yes >>>>> checking sys/time.h usability... yes >>>>> checking sys/time.h presence... yes >>>>> checking for sys/time.h... yes >>>>> checking sys/signal.h usability... yes >>>>> checking sys/signal.h presence... yes >>>>> checking for sys/signal.h... yes >>>>> checking signal.h usability... yes >>>>> checking signal.h presence... yes >>>>> checking for signal.h.. . yes >>>>> checking termios.h usability... yes >>>>> checking termios.h presence... yes >>>>> checking for termios.h... yes >>>>> checking asm/termbits.h usability... yes >>>>> checking asm/termbits.h presence... yes >>>>> checking for asm/termbits.h... yes >>>>> checking grp.h usability... yes >>>>> checking grp.h presence... yes >>>>> checking for grp.h... yes >>>>> checking pwd.h usability... yes >>>>> checking pwd.h presence... yes >>>>> checking for pwd.h... yes >>>>> checking whether gcc needs -traditional... no >>>>> checking whether to enable maintainer-specific portions of >> Makefiles... >>>> no >>>>> /usr/java/jdk1.5.0_13 >>>>> configure: WARNING: using JAVA_HOME environmental variable >>>>> adjusted java.home is /usr/java/jdk1.5.0_13 >>>>> checking os.name Linux >>>>> checking os.arch i386 >>>>> checking java.vendor Sun Microsystems Inc. >>>>> checking java.version 1.5.0_13 >>>>> checking os.version 2.6.18-8.el5xen >>>>> comm.jar appears to be installed already. >>>>> conftest.c: In function 'main': >>>>> conftest.c:6: warning: incompatible implicit declaration of built-in >>>>> function 'printf' >>>>> conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this >>>> function) >>>>> conftest.c:6: error: (Each undeclared identifier is reported only once >>>>> conftest.c:6: error: for each function it appears in.) >>>>> conftest.c:6: error: expected ')' before string constant >>>> >>>> >>>> This is an outdated kernel version check for when headers and kernels >>>> could cause problems for rxtx. If we made it past this, then you are >> OK. >>>> >>>> >>>>> conftest.c:7: warning: incompatible implicit declaration of built-in >>>>> function 'exit' >>>>> ./configure: line 9649: ./conftest: No such file or directory >>>>> ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected >>>> >>>> It blew up but continues.. >>>> >>>>> conftest.c: In function 'main': >>>>> conftest.c:5: warning: incompatible implicit declaration of built-in >>>>> function 'printf' >>>>> conftest.c:10: warning: incompatible implicit declaration of built-in >>>>> function 'exit' >>>>> configure: creating ./config.status >>>>> config.status: creating Makefile >>>>> config.status: creating config.h >>>>> config.status : config.h is unchanged >>>>> config.status: executing depfiles commands >>>>> [root at smsgateway rxtx-2.0-7pre1]# make install >>>>> /usr/java/jdk1.5.0_13/bin/javac -classpath >>>>> .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/ -O >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1 >> /./src/UnSupportedLoggerException.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java >>>>> Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or >>>>> overrides a deprecated API. >>>>> Note: Recompile with -Xlint:deprecation for details. >>>>> /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* >>>> >>>> >>>> The java jar should be fine now. You may need to change the source >> files >>>> as mentioned below. >>>> >>>>> gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu >> -I. >>>>> -I/usr/java/jdk1.5.0_13/include >> -I/usr/java/jdk1.5.0_13/include/./linux/ >>>> -g >>>>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o >>>>> /home/jboss/sources/rxtx-2.0-7pre1 >> /x86_64-unknown-linux-gnu/SerialImp.lo >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'init_threads': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: >>>> cast >>>>> from pointer to integer of different size >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_nativeDrain': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: >>>> cast to >>>>> pointer from integer of different size >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'read_byte_array': >>>>> /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: >>>> cast to >>>>> pointer from integer of different size >>>> >>>> >>>> As I recall, this was caused by pointers (now 64 bit rather than 32 >> bit) >>>> being stored in java ints (jints). I would look at the diff between >> the >>>> CVS 2.1 SerialImp.c and RXTXPort.java files against 2.0. We >>>> did fix those issues. >>>> >>>> You have a .so file but the different pointer sizes will cause runtime >>>> errors. >>>> >>>> >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_readArray': >>>>> /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: >>>>> comparison is always false due to limited range of data type >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_readTerminatedArray': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: >>>>> comparison is always false due to limited range of data type >>>>> mkdir .libs >>>>> rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* >> .libs/librxtxSerial- >>>>> 2.0.7pre1.* >>>>> gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so-o >>>>> .libs/librxtxSerial-2.0.7pre1.so >>>>> (cd .libs && rm -f librxtxSerial.so && ln -s >> librxtxSerial-2.0.7pre1.so >>>>> librxtxSerial.so) >>>>> creating librxtxSerial.la >>>>> (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la >>>>> librxtxSerial.la) >>>>> gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu >> -I. >>>>> -I/usr/java/jdk1.5.0_13/include >> -I/usr/java/jdk1.5.0_13/include/./linux/ >>>> -g >>>>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o >>>>> /home/jboss/sources/rxtx- 2.0-7pre1 >>>> /x86_64-unknown-linux-gnu/ParallelImp.lo >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function >>>>> 'Java_javax_comm_LPRPort_readArray': >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: >>>>> comparison is always false due to limited range of data type >>>>> rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* >>>>> .libs/librxtxParallel-2.0.7pre1.* >>>>> gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so-o >>>>> .libs/librxtxParallel- 2.0.7pre1.so >>>>> (cd .libs && rm -f librxtxParallel.so && ln -s >>>> librxtxParallel-2.0.7pre1.so >>>>> librxtxParallel.so) >>>>> creating librxtxParallel.la >>>>> (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la >>>>> librxtxParallel.la) >>>>> make all-am >>>>> make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' >>>>> make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' >>>>> libtool: install: `x86_64-unknown-linux-gnu' must be an absolute >>>> directory >>>>> name >>>>> Try `libtool --help --mode=install' for more information. >>>>> make: *** [install] Error 1 >>>> >>>> A libtool change? Assuming you ran configure && make install in >>>> /home/jboss/sources/rxtx- 2.0-7pre1, libtool is looking for >>>> /home/jboss/sources/rxtx- >>>> 2.0-7pre1/x86_64-unknown-linux-gnu/.libs/librxtxSerial-2.0.7pre1.so. >>>> >>>> I think you have this? The file is just being copied to >>>> ~JAVA/jre/lib/$(JAVA_ARCH). >>>> >>>> -- >>>> Trent Jarvi >>>> tjarvi at qbang.org >>>> >>> >> > From guido.vogt at celsi.ch Tue Nov 13 00:28:01 2007 From: guido.vogt at celsi.ch (Guido Vogt) Date: Tue, 13 Nov 2007 08:28:01 +0100 Subject: [Rxtx] RTS Line can't be set Message-ID: <47395201.1050400@celsi.ch> I'm working on an Windows XP /SP2 System. Version of RXTX: 2.1.7. The serial line is connected to a modem. As I can see, the RTS-Line of the serial Port is inactive, when the port is opened (flowcontrol=none). Obviously, no data is coming from the modem. If I use the setRTS(true) command after open, the comport does not send out my data any more. This behaviour is regardless of flowcontrol. Anybody has an idea what do do? Thanks for help. From Martin.Oberhuber at windriver.com Tue Nov 13 08:58:23 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 13 Nov 2007 16:58:23 +0100 Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803880918@ism-mail03.corp.ad.wrs.com> Hi Trent, as said before, I like the idea of discussing such quality engineering issues, but why hide these away from the rest of the public? Anyways, if you do want to create a new mailing list for these kinds of things I'll happily subscribe. 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: Sunday, November 11, 2007 1:46 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: RE: [Rxtx] Quality Engineering with rxtx > > On Mon, 5 Nov 2007, Oberhuber, Martin wrote: > > > Hi Trent, > > > > are the interestes of hobbyists really so different > > from commercial ones? Both should be interested in > > high quality and innovation the like. > > > > I haven't seen too many Open Source projects from the > > "inside" but those that I have seen did not have > > separate mailing lists for quality/testing/qa > > versus innovation/development. > > > > What I have seen with the Open Source projects that > > one would call "successful" is a good deal of > > process around automated builds, automated unit > > tests, predictable release dates and milestones, > > and policies around commiting/contributing/reviewing > > changes. > > > > I think that all of these benefit commercial users > > and hobbyists the like. > > > > If you were just asking about who's interested in > > discussing changes to foster more quality, count > > me in. I'm just not sure whether discussing these > > on a separate mailing list or other channel is the > > right thing to do. > > > > Hi Martin, > > There are two issues I'm thinking about. The first is the > generic unit > testing and quality initiatives required to move rxtx > forward. The second > is the inevitable fact that rxtx connects to external hardware. The > discussion deals with a different set of problems. > > Here is a simple example of what I'm getting at. > > We have the capability of setting custom baud rates in rxtx. > We may be > interested in seeing regressions in rxtx, the C library or > the kernel. > Some people may be doing some tests with loopback > connections. These will > always work even if the baud rate is not set to the expected > value. Some > people may use null modems between two ports. This may be > able to catch > the problem but not always. > > Will the build machines be able to test this? (no - for a few reasons) > Will people be trying to catch these type of regressions? (yes) > What type of coverage does the community have in the end? (?) > > We could include the discussions in the same list or another > equally open > list that may be of interest to some folks that deal with > these types of > problems on a regular basis. > > -- > Trent Jarvi > tjarvi at qbang.org > From toupsz at cs.tamu.edu Tue Nov 13 10:33:03 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 13 Nov 2007 11:33:03 -0600 Subject: [Rxtx] [urgent] device's power off detection In-Reply-To: <4738F546.5010101@gatworks.com> References: <766782.10076.qm@web55803.mail.re3.yahoo.com> <4738F546.5010101@gatworks.com> Message-ID: Lacking any other specification on it...but can you set up the device to notify your software when it turns off? Send a message or somesuch? Maybe it can signal using RTS or DTR? -Zach On Nov 12, 2007 6:52 PM, U. George wrote: > Not sure what u are asking for. Are u asking for a way to detect if the > device is OFF? Are u asking how to power off the device - via software ? > Is it a Serial device? > is it a parallel device? > is it a usb device? > > Sara Hugh wrote: > > Hello all, > > I have a small application built on top of rxtx api. This application > > can retrieve the incoming data from a device through a port. The device > > can be powered off after the port get closed from the application. I > > have been trying a couple of hours to find a way to detect the power > > switching from device. If anyone knows how to handle it through rxtx, > > could you please give me a help? Thank you very much. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071113/e5859e4d/attachment-0004.html From tjarvi at qbang.org Tue Nov 13 20:02:03 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 13 Nov 2007 20:02:03 -0700 (MST) Subject: [Rxtx] #ifndef TIOCSERGETLSR In-Reply-To: <472E3AAF.7050709@gatworks.com> References: <472E3AAF.7050709@gatworks.com> Message-ID: On Sun, 4 Nov 2007, U. George wrote: > For Linux, it seems that you need the code for both *having* a > TIOCSERGETLSR, and *not having* a TIOCSERGETLSR. Maybe the ioctl exists > system wide, but not necessarily for the device driver itself ( always > returns -1 ) . > > Are there systems that have a *functioning* TIOCSERGETLSR for all their > devices? Then this would be the case where the "#ifndef TIOCSERGETLSR" > directive could be useful is eliminating the unnecessary code and tests. > > And for those systems that dont have a TIOCSERGETLSR, then the code for > TIOCSERGETLSR can be eliminated. > > It would be a simple case to have, as a foundation, all the code to > simulate the missing TIOCSERGETLSR ioctl. If the system does have the > ioctl, then that code can be ifdef'd in, and co-exist with the > functionality of the code that simulates the missing TIOCSERGETLSR ioctl. > Ah, there is the post. Sorry I was on vacation. Hi George, Yes there are systems that have functioning TIOCSERGETLSR for all of their devices. These are machines that just use traditional UARTs. If you mean operating systems, then probably not. Let me explain a bit about the history of those #ifdefs to help clear up a mess. RXTX aims to follow POSIX. TIOCSERGETLSR turns out to not be POSIX at all as I understand. It isn't in BSD, Solaris, AIX or HP-UX. It certainly provides access to important information. I assumed it was standard when I coded rxtx on a Linux system. Ya, laugh. Then I looked at Win32.. Oh you are still laughing? ..I could not navigate msft's web site at the time [still can't really find anything today]. So google pointed me to someones 'reverse documentation' of the w32 API and an example msft put together back in the win3.0 days. It was enough but maybe not 100% correct. They covered overlapped IO which was important for events in rxtx. Looking at Win32 and Linux, it made sense to implement TIOCSERGETLSR for win32 with the way rxtx works. That was how things matched up. But when I got feedback about other systems, it didn't match up. When people used multiport cards with money saving designs in Linux, it didn't match up. And today, there are drivers for unusual serial ports that don't match up. Now we have some ugly logic that mostly works for most serial ports. It isn't right though. The important aspect of TIOSERGETLSR is knowing when the output is really gone. But POSIX tcdrain tells us the same thing. So there is logic in the ifdefs to match that up as you suggest. Perhaps a more formal solution along those lines would be worth looking into. I would suggest the roles should be switched though. We should use POSIX calls on all systems and hide things that don't work on everything like we have with other undocumented calls. TIOSERGETLSR is nice and would be great if it was standard. It isn't as far as I can tell. In the end, many people write Java code because they want portability. The TIOSERGETLSR does not really fit. In someways, this is limiting to the least common denominator which is Solaris if you have seen it's serial kernel driver code. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 15 09:10:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 15 Nov 2007 17:10:59 +0100 Subject: [Rxtx] RXTX blocking on unconnected virtual port Message-ID: <460801A4097E3D4CA04CC64EE648584803919080@ism-mail03.corp.ad.wrs.com> Hello, we came across the following issue: * Set up a virtual serial port, e.g. with com0com: http://com0com.sourceforge.net/ * Connect RXTX to one end, e.g. cnc1a * Do not connect the other end, e.g. cnc1b * Have RXTX write data to the port --> Since the data is not being read, RXTX blocks - RXTXPort.SerialOutputStream.write increases the RXTXPort.IOLocked variable - it then calls the native writeByte or writeArray method (which blocks) closing the RXTXPort hangs for ever too: - RXTXPort.close() has a while( IOLocked > 0 ) {..Thread.sleep(500);...} which spins for ever ==> once the communication hangs, it cannot recover. Has anybody else seen such a problem before, or even got an idea how to solve it? When I connect Hyperterminal to the same half-open port, and type a character, it hangs for about 3 seconds but then times out and is available again. I guess that's what I'd like to see in RXTX as well, with a (configurable) timeout. Our big problem with the current situation is that once RXTX gets stuck, there is nothing at all we can do to make it go live again - that's why our original workaround of writing to the port in a background thread is not good enough. For more background information, the issue is being tracked in https://bugs.eclipse.org/bugs/show_bug.cgi?id=208185 Thanks for any hints or ideas, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From keithvz at verizon.net Thu Nov 1 08:08:58 2007 From: keithvz at verizon.net (Keith) Date: Thu, 01 Nov 2007 10:08:58 -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: <4729DDFA.7080206@verizon.net> Trent Jarvi wrote: > 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? Well, I honestly don't know how all this fits together. I think it's just a matter of enabling the right flow control option within the standard serial framework to tell the device driver, "HEY START USING DTR/DSR FOR FLOW CONTROL." If what UGeorge said,(about that type of nitty-gritty lead control being done within the device driver), is true, then this confirms my suspicion. I tried narrowing down within the Linux drivers what you are looking for, but I can't entirely tell wth I'm looking at. (virtual com port drivers -- they are included compiled by default with Ubuntu, source included) http://www.ftdichip.com/Drivers/VCP/Linux/ftdi_sio.tar.gz Hahahaa, they make a reference to DTR flow control being supported but say (UGH) in parenthesis. You can also use their direct device driver library on Ubuntu -- libftd2xx.so.0.4.13. No source code. http://www.ftdichip.com/Drivers/D2XX/Linux/libftd2xx0.4.13.tar.gz In that case, you make a call to their FT_SetFlowControl() function. FT_STATUS FT_SetFlowControl (FT_HANDLE ftHandle, USHORT usFlowControl, UCHAR uXon,UCHAR uXoff) Parameters ftHandle Handle of the device. usFlowControl Must be one of FT_FLOW_NONE, FT_FLOW_RTS_CTS, ****FT_FLOW_DTR_DSR**** or FT_FLOW_XON_XOFF. uXon Character used to signal Xon. Only used if flow control is FT_FLOW_XON_XOFF. uXoff Character used to signal Xoff. Only used if flow control is FT_FLOW_XON_XOFF. This is from their programming guide http://www.ftdichip.com/Documents/ProgramGuides/D2XXPG34.pdf I actually want to take this a step further and say that I think the flow control is actually handled right on the device itself in hardware/firmware. It's enabled through the device driver, but I think the maintaining of buffers, asserting/deasserting of leads, etc is handled by the device. For the time being, I've switched to jd2xx, https://jd2xx.dev.java.net/ and http://bleyer.org/jd2xx/ These are Java wrappers for the device driver libraries. It allows almost direct access to the well-documented device drivers from Java. I hope this helps Keith From tjarvi at qbang.org Thu Nov 1 11:09:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:09:51 -0600 (MDT) 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: Hi Martin, What I usually have done is allow changes that do not impact working software including changes to methods not documented in CommAPI (which remain undocumented in rxtx) and fixes to known problems in the documented portions. That way if you use the documented API, the releases should only become better with time. If you use the undocumented portions, the behavior is not as predictable but open for improvement. On Wed, 31 Oct 2007, 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 >> > From tjarvi at qbang.org Thu Nov 1 11:15:52 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:15:52 -0600 (MDT) 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: I too use rxtx in commercial products. The problem I've been trying to address while bringing the server back was how to make it possible for hobby folks to build the same software as companies so we can move rxtx along a little faster. Exposing internal tools is not an option at this time, the public rxtx builds have been done on my home machine which has drives hanging out of it all over the place dying one at a time. This isn't maintainable. I'm currently looking at the possibility of making an S3 image available on Amazon's EC. These are machines you can rent for ~10 cents an hour which is more than enough to build rxtx. The S3 image is not changed when people use it so everyone has the same starting point. With this, we could all build rxtx for ~20 platforms for a small price and eliminate tool issues. On Wed, 31 Oct 2007, Greg Johnson wrote: > 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 tjarvi at qbang.org Thu Nov 1 11:19:55 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:19:55 -0600 (MDT) 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: On Wed, 31 Oct 2007, 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. I was helping Dmitry do the Mac OS X port without access to a machine when we put that in. In the archives there is information (easily found with google on Apple's site) that describes how their API (and others) can determine if a port is used and ignore it. I think these changes are in CVS but need to confirm. The bottom line is that rxtx should not have used lock files on Mac. It was just ignorance of the system on my part. -- Trent Jarvi tjarvi at qbang.org From fabioanjos at gmail.com Thu Nov 1 12:35:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Thu, 1 Nov 2007 15:35:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Hi, I was using SerialEventListener in my project. But, as was said here, id doesnt work very well with virtual serial ports. So, I changed the strategy using the code posted here in this thread: try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > 0) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } The thing is that in my tests I could notice that in.read(buffer) never blocks. Even when there's nothing to read. Instead of blocking when there's nothing to read it returns 0. So, my questions are: 1. Am I doing something wrong? 2. If not, wouldnt this decrease performance? (the thread would be locked in a loop that does nothing.) 3. Is there a better way to do the job? Thanks in advance!! F?bio -------- On 10/31/07, Andre-John Mas wrote: > > > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/0aee59d0/attachment-0018.html From ajmas at sympatico.ca Thu Nov 1 16:07:55 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Nov 2007 18:07:55 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Message-ID: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From sarah_662005 at yahoo.com Thu Nov 1 17:10:05 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Thu, 1 Nov 2007 16:10:05 -0700 (PDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Message-ID: <351433.37166.qm@web55814.mail.re3.yahoo.com> Thank you very much for your help. Now the application works fine. the serialEvent gets triggered. Rxtx is cool! ----- Original Message ---- From: Andre-John Mas To: Sara Hugh ; RXTX Developers and Users Sent: Wednesday, October 31, 2007 9:55:45 AM Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered 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 __________________________________________________ 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/20071101/4a86bea6/attachment-0018.html From tjarvi at qbang.org Thu Nov 1 17:58:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 17:58:02 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx Message-ID: The rxtx.org site is primarily interested in the hobby aspects of rxtx. Obviously, there are some companies following the work too. These interests bring larger workflows and concerns about details hobby folks may not care about. They also bring many more users. I know the company I work for has a quality engineering effort going on which includes rxtx. While the server was down, I was contacted by another company that was missing the binaries for their testing. Several people have mentioned concerns about a stable release for like reasons. Would there be interest on the quality side of the coin to get together? It could be just sharing email's with each other or a seperate list for QE/QA. I can not say for sure, but we may be able to share some of our efforts/results that could help keep rxtx releases stable. -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Fri Nov 2 01:42:55 2007 From: scldad at sdc.com.au (Stephen Davies) Date: Fri, 2 Nov 2007 18:12:55 +1030 Subject: [Rxtx] Multiple modems Message-ID: <200711021812.56047.scldad@sdc.com.au> This may or may not be related to the Multiple Ports thread. I have an application which uses rxtx on Linux (via cron jobs) to connect multiple modems to remote sensing devices. The application works fine most of the time but occasionally fails to connect if two (or more) connection attempts happen at about the same time. When it fails, it looks as if it may get confused as to which port it is talking to. The app has a "base" component that looks for an available port, opens it and then creates an input thread and an output thread for the connection and data transfer. The "base" component uses this code: // loop round all known ports until one is available. Give up after three minutes Counter ptimeout = new Counter(); while(!portFound && ptimeout.elapsed() < 180000) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // special case. ttyS0 is not available to us on this server. if (!portId.isCurrentlyOwned() && !portId.getName().equals("/dev/ttyS0")) { gLog.debug(lognm + ": Found port " + portId.getName()); try { serialPort = (RXTXPort) portId.open("AguaModem", 10000); } catch (Exception e) { gLog.error(lognm + ": Port " + portId.getName() + " will not open."); gLog.error(e.getMessage()); continue; } AguaModem aguamodem = new AguaModem(); portFound = true; break; } gLog.debug(lognm + ": Port " + portId.getName() + " is busy"); } } } I am wondering about the isCurrentlyOwned method. Does this actually tell me whether a port is currently being used by another process? TIA, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From fabioanjos at gmail.com Fri Nov 2 04:59:58 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 07:59:58 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Message-ID: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/9009eb1d/attachment-0018.html From netbeans at gatworks.com Fri Nov 2 06:28:13 2007 From: netbeans at gatworks.com (U. George) Date: Fri, 02 Nov 2007 08:28:13 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <472B17DD.1050508@gatworks.com> It should normally block ( unless eof / event ) . so its a :{ whats the device ( to recreate if possible ) and how do u open. > My question is, is there a way to make in.read block the thead until > there's something to read? > From fabioanjos at gmail.com Fri Nov 2 06:34:46 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 09:34:46 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > On 11/1/07, Andre-John Mas wrote: > > > > Fabio, > > > > Turns out there was a small error in my example. The test should be: > > > > (numBytes = in.read(buffer)) > -1 > > > > This is because -1 indicates an end of file (end of data stream) > > > > Andre > > > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > > > Hi, > > > > > > I was using SerialEventListener in my project. But, as was said > > > here, id doesnt work very well with virtual serial ports. > > > So, I changed the strategy using the code posted here in this thread: > > > > > > try{ > > > in = port.getInputStream(); > > > out = port.getOutputStream(); > > > int numBytes = 0; > > > while(active){ > > > > > > byte[] buffer = new byte[10]; > > > > > > while ( (numBytes = in.read(buffer)) > 0) > > > { > > > String dataValue = new String(buffer,0,numBytes); > > > processInput(dataValue); > > > } > > > > > > if(numBytes==-1){ > > > break; > > > } > > > > > > Thread.sleep(50); > > > } > > > > > > }catch(IOException e){ > > > logger.info("falha de comunicacao "+ > > > getReceptor().getPort() ); > > > > > > }catch(InterruptedException e){ > > > logger.info ("Interrompendo leitura da porta "+ > > > getReceptor().getPort() ); > > > } > > > > > > The thing is that in my tests I could notice that in.read(buffer) > > > never blocks. Even when there's nothing to read. Instead of blocking > > > when there's nothing to read it returns 0. > > > > > > So, my questions are: > > > > > > 1. Am I doing something wrong? > > > 2. If not, wouldnt this decrease performance? (the thread would be > > > locked in a loop that does nothing.) > > > 3. Is there a better way to do the job? > > > > > > Thanks in advance!! > > > > > > F?bio > > > -------- > > > > > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > > 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 > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > > > > > -- > > > Atenciosamente, > > > F?bio Cristiano dos Anjos > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/5306c4b1/attachment-0018.html From nick.circelli at infrasafe.com Fri Nov 2 07:01:17 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Fri, 2 Nov 2007 08:01:17 -0500 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com><29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com><90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca><29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Message-ID: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> I'm pretty sure that not blocking has to do with you virtual ports. Cause it should block. Maybe you should try: while ((numBytes = in.available()) > 0) { If (numBytes > buffer.length) { numBytes = buffer.length; // in case you have buffer overflow } numBytes = in.read(buffer, 0 , numBytes)); String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } Also, just for optimization, I'd move that byte[] buffer = new byte[10]; out of the while since you don't need to reallocate it every iteration. ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of F?bio Cristiano dos Anjos Sent: Friday, November 02, 2007 8:35 AM To: RXTX Developers and Users Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream (); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas < ajmas at sympatico.ca > wrote: Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info ("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Atenciosamente, F?bio Cristiano dos Anjos -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/4de7f6a3/attachment-0018.html From fabioanjos at gmail.com Fri Nov 2 07:36:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 10:36:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> Message-ID: <29788b250711020636q1588c88fgaa5e27f5504164fb@mail.gmail.com> Hi Nick, Actually, it doesnt block for physical ports too. And, the method avaiable does not block either, so when there's nothing avaiable the loop ends and the thread stops lintening to the port. But I did some more test with serialEventListener, and now its working. I realy dont know what I've done to get it working. I just start woking as soon as I decided to test it again. It was said here that serialEventListener is not reliable for virtual serial ports. Is there another way to read it, without compromising performance? Tanks again!! F?bio ------- On 11/2/07, Nick Circelli wrote: > > I'm pretty sure that not blocking has to do with you virtual ports. > Cause it should block. > > Maybe you should try: > > > > while ((numBytes = in.available()) > 0) > > { > > If (numBytes > buffer.length) { > > numBytes = buffer.length; // in case you have buffer overflow > > } > > numBytes = in.read(buffer, 0 , numBytes)); > > String dataValue = new String(buffer,0,numBytes,"ASCII"); > > processInput(dataValue); > > } > > > > Also, just for optimization, I'd move that byte[] buffer = new > byte[10]; > > out of the while since you don't need to reallocate it every iteration. > > > ------------------------------ > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On Behalf > Of *F?bio Cristiano dos Anjos > *Sent:* Friday, November 02, 2007 8:35 AM > *To:* RXTX Developers and Users > *Subject:* Re: [Rxtx] serialEvent(SerialPortEvent event) never be > triggered > > > > Hi, > > I think i missunderstand something here. > The code you post here was meant to be used inside serialEvent method, > right? > > The think is, that i cannot user SerialEventListener to read serial ports, > because i need to read virual serial ports and id does not behaves well, as > said here before. serialEvent is never triggered. > > So what I quit using SerialEventListener and created a thread to listen to > the port: > > public void run(){ > try{ > in = port.getInputStream(); > out = port.getOutputStream (); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new > String(buffer,0,numBytes,"ASCII"); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ getReceptor().getPort() > ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > } > > > So, the problem is that in.read(buffer) always returns 0 when there is > nothing to read, instead of blocking the flow, and the thread becames locked > in the loop. > > I hope you can help me solve this. > > Thanks in advance! > > F?bio > -------- > > On 11/2/07, *F?bio Cristiano dos Anjos* wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > > > On 11/1/07, *Andre-John Mas* < ajmas at sympatico.ca> wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info ("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/571df6ea/attachment-0017.html From tjarvi at qbang.org Fri Nov 2 08:32:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Nov 2007 08:32:15 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: References: Message-ID: On Fri, 2 Nov 2007, Greg Johnson wrote: > Hi Trent, folks, > Having a single rxtx that is suitable for commercial uses and hobbyists both > would be a great idea? Perhaps it would be worth submitting rxtx as a > proposal to Codehaus - they not only provide excellent tools (Jira (bug > tracker), Confluence (wiki)) but also support build management ( > maestro, continuum, bamboo). Relying on your personal machine (btw, frii.com > / rxtx.org is down again?) seems like a burden you shouldn't have to shoulder > alone. Hi Greg, There may be a little confusion here. There is no need to have two seperate rxtx releases. What I'm trying to encourage is a discussion between some of the people responsible for making sure rxtx does not break their products each release. Usually these people are interested in testing a set of functionality their product depends upon. They do not work with rxtx code but rather traps to catch when rxtx developers break something. This goes on all the time in isolated labs. There are many services that offer to do various pieces of a project for you if you... Anyone is free to do the 'if you' portion with rxtx and see how it goes. I'm actually interested in doing less of that than more. The rxtx.org work I do just happens to overlap with other things I do for personal/family use. The reason I suggest the amazon solution is that anyone can take full control of the environment for a day and it costs less than a package of gum without causing harm to what anyone else is doing. I assume the down question was with respect to a mod_security setting that has been resolved. If not, please post a url to the problem. -- Trent Jarvi tjarvi at qbang.org From nsayer at kfu.com Sat Nov 3 20:17:49 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 19:17:49 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? Message-ID: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Has anyone got RXTX working with an app under Leopard? My app hangs on port open (it works fine with Tiger). The relevant thread looks like this in the activity monitor: 1536 JVM_InvokeMethod 1536 0x48ccd0 1536 0x46f8a0 1536 0x4c3ff4 1536 0x4c4284 1536 0x357d160 1536 0x357faac 1536 Java_gnu_io_RXTXPort_open 1536 open $NOCANCEL$UNIX2003 1536 open $NOCANCEL$UNIX2003 From ajmas at sympatico.ca Sat Nov 3 22:02:04 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 00:02:04 -0400 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> RXTX works for me with Leopard. I am currently using it communicate with a Bluetooth GPS. What computer and device are you trying to use? Is the driver for your serial device compatible with MacOS X 10.5? Andre On 3-Nov-07, at 22:17 , Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From nsayer at kfu.com Sat Nov 3 22:17:47 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 21:17:47 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> Message-ID: <1720F723-3643-438C-B3AB-E09A67536977@kfu.com> On Nov 3, 2007, at 9:02 PM, Andre-John Mas wrote: > RXTX works for me with Leopard. I am currently using it communicate > with a Bluetooth GPS. > > What computer and device are you trying to use? Is the driver for > your serial device compatible with MacOS X 10.5? An Intel mac mini The FTDI USB serial driver an XMPCR, which is just a fancy serial controlled radio and an FTDI usb-to-serial chip I've successfully used the FTDI driver with another FTDI device in another context. > > > Andre > > On 3-Nov-07, at 22:17 , Nick Sayer wrote: > >> Has anyone got RXTX working with an app under Leopard? >> >> My app hangs on port open (it works fine with Tiger). The relevant >> thread looks like this in the activity monitor: >> >> 1536 JVM_InvokeMethod >> 1536 0x48ccd0 >> 1536 0x46f8a0 >> 1536 0x4c3ff4 >> 1536 0x4c4284 >> 1536 0x357d160 >> 1536 0x357faac >> 1536 >> Java_gnu_io_RXTXPort_open >> 1536 open >> $NOCANCEL$UNIX2003 >> 1536 open >> $NOCANCEL$UNIX2003 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From racecar at gmail.com Sat Nov 3 22:25:53 2007 From: racecar at gmail.com (Kevin Mateo Lim) Date: Sat, 3 Nov 2007 21:25:53 -0700 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: Message-ID: I am alternating between two errors. After i run the macosx_setup.command, "everyone" is set to Read only in /var/lock. I notice in the terminal that the group for these perms is _uucp, not uucp. In that state, I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 check_group_uucp(): error testing lock file creation Error details:Permission deniedcheck_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException : Error inside Serial.() at processing.serial.Serial.errorMessage(Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.( Serial.java:102) at Temporary_829_3245.setup(Temporary_829_3245.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java :690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) Then, I hand edit the "everyone" permissions for /var/lock/ to Read and Write (note /var/spool/uucp is Read/Write in all cases, and doesn't change). I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX uucp_lock() /var/lock/LK.003.009.000 is there gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException: Error inside Serial.() at processing.serial.Serial.errorMessage (Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.(Serial.java:102) at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java:690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) See here: http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071103/f1a2c467/attachment-0016.html From greg.johnson at manchester.ac.uk Sun Nov 4 02:31:13 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sun, 4 Nov 2007 10:31:13 +0100 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <28B5E0A0-0802-4C74-AC21-87ED35F3B9A2@manchester.ac.uk> Hi Nick, I also had problems initially with Leopard, but it was resolved by reinstalling the serial USB driver (FTDI in my case). The symptoms were a non-detection of any ports (but I twigged when I tried ZTerm and it had the same problem). Good luck! Cheers, greg PS I did a "Archive and install" which may be the reason my FTDI driver had disappeared - I don't think the driver has changed for 10.5 ------------------------------------------------------------------------- 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 4 Nov 2007, at 03:17, Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Sun Nov 4 13:01:12 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 15:01:12 -0500 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: Message-ID: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Hi, You will need to get the 2.1-8 code from CVS. See the FAQ for more information: http://rxtx.qbang.org/wiki/index.php/FAQ Andre On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > I am alternating between two errors. > > After i run the macosx_setup.command, "everyone" is set to Read only > in /var/lock. I notice in the terminal that the group for these > perms is _uucp, not uucp. > > In that state, I get this error: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > check_group_uucp(): error testing lock file creation Error > details:Permission deniedcheck_lock_status: No permission to create > lock file. > please see: How can I use Lock Files with rxtx? in INSTALL > gnu.io.PortInUseException: Unknown Application > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > java.lang.RuntimeException : Error inside Serial.() > > at processing.serial.Serial.errorMessage(Serial.java:583) > > at processing.serial.Serial.(Serial.java:148) > > at processing.serial.Serial.( Serial.java:102) > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > at processing.core.PApplet.run(PApplet.java:1556) > > at java.lang.Thread.run(Thread.java:613) > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > and Write (note /var/spool/uucp is Read/Write in all cases, and > doesn't change). I get this error: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > gnu.io.PortInUseException: Unknown Application > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > java.lang.RuntimeException: Error inside Serial.() > > at processing.serial.Serial.errorMessage (Serial.java:583) > > at processing.serial.Serial.(Serial.java:148) > > at processing.serial.Serial.(Serial.java:102) > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > at processing.core.PApplet.run(PApplet.java:1556) > > at java.lang.Thread.run(Thread.java:613) > > See here: > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From netbeans at gatworks.com Sun Nov 4 14:33:35 2007 From: netbeans at gatworks.com (U. George) Date: Sun, 04 Nov 2007 16:33:35 -0500 Subject: [Rxtx] #ifndef TIOCSERGETLSR Message-ID: <472E3AAF.7050709@gatworks.com> For Linux, it seems that you need the code for both *having* a TIOCSERGETLSR, and *not having* a TIOCSERGETLSR. Maybe the ioctl exists system wide, but not necessarily for the device driver itself ( always returns -1 ) . Are there systems that have a *functioning* TIOCSERGETLSR for all their devices? Then this would be the case where the "#ifndef TIOCSERGETLSR" directive could be useful is eliminating the unnecessary code and tests. And for those systems that dont have a TIOCSERGETLSR, then the code for TIOCSERGETLSR can be eliminated. It would be a simple case to have, as a foundation, all the code to simulate the missing TIOCSERGETLSR ioctl. If the system does have the ioctl, then that code can be ifdef'd in, and co-exist with the functionality of the code that simulates the missing TIOCSERGETLSR ioctl. From racecar at gmail.com Sun Nov 4 17:30:19 2007 From: racecar at gmail.com (Kevin Mateo Lim) Date: Sun, 4 Nov 2007 17:30:19 -0700 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: the README.OSX reads: Put libSerial.jnilib in the directory of the application (the JavaVM will find it there). Add RXTXComm.jar to the application classpath or include the classes in the application jar. (Some applications already include the RXTX classes in their application jar, in which case only the file libSerial.jnilib is required). I can't find libSerial.jnilib I put librxtxSerial.jnilib into my Processing /libraries/serial/library/ directory. Yet it still sees the old version: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 On 11/4/07, Andre-John Mas wrote: > > Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > 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/20071104/c0a83f91/attachment-0015.html From ajmas at sympatico.ca Sun Nov 4 17:41:47 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 19:41:47 -0500 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> If you are wanting it to be available for all applications, - for all users: /Library/Java/Extensions - for your user: ~/Library/Java/Extensions Or just for your application, then it should be in the same directory from which yo are launching your application. If you are getting the 2.1-8 source, then the library built is called: librxtxSerial.jnilib despite what the docs say. Andre On 4-Nov-07, at 19:30 , Kevin Mateo Lim wrote: > > the README.OSX reads: > Put > libSerial.jnilib > in the directory of the application (the JavaVM will find it there). > Add > RXTXComm.jar > to the application classpath or include the classes in the > application jar. > (Some applications already include the RXTX classes in their > application jar, > in which case only the file libSerial.jnilib is required). > > > I can't find libSerial.jnilib > I put librxtxSerial.jnilib into my Processing /libraries/serial/ > library/ directory. > > Yet it still sees the old version: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > On 11/4/07, Andre-John Mas wrote: Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial .(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay (PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > From bschlining at gmail.com Sun Nov 4 19:46:23 2007 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 4 Nov 2007 18:46:23 -0800 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> Message-ID: > > Or just for your application, then it should be in the same directory > from which yo are launching your application. Just wanted to add one more way of specifying the native lib location... If you don't want to define it globally by putting it in /Library/Java/Extensions (and you don't, it's a very very bad practice) you can also specify the location of the native library when starting the JVM by specifying the 'java.library.path' property. For example: java -Djava.library.path=/Path/To/Directory/With/RXTX/Library YourMainClass -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071104/c5af6980/attachment-0015.html From greg.johnson at manchester.ac.uk Mon Nov 5 01:39:02 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Mon, 5 Nov 2007 09:39:02 +0100 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: The 2.1-8 code reports 2.1-7, hence your (and my) confusion. But as long as you've removed all traces of the old library, it really _is_ 2.1-8. And if you specify the library path to the VM, don't make my mistake (on OSX at least) - you need to respecify the entire library path it had by default, as the command line argument replaces the path, rather than appending to it. 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 5 Nov 2007, at 01:30, Kevin Mateo Lim wrote: > > the README.OSX reads: > Put > libSerial.jnilib > in the directory of the application (the JavaVM will find it there). > Add > RXTXComm.jar > to the application classpath or include the classes in the > application jar. > (Some applications already include the RXTX classes in their > application jar, > in which case only the file libSerial.jnilib is required). > > > I can't find libSerial.jnilib > I put librxtxSerial.jnilib into my Processing /libraries/serial/ > library/ directory. > > Yet it still sees the old version: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > On 11/4/07, Andre-John Mas wrote: > Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial .(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay (PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > 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 HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071105/7f50506d/attachment-0015.html From cyrille.dumont at tatexpress.fr Mon Nov 5 05:46:03 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 05 Nov 2007 13:46:03 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: References: <472727F1.1000704@tatexpress.fr> Message-ID: <472F108B.2090101@tatexpress.fr> Thanks a lot for your solution ... but I'm not a expert in JAVA ... (sorry) For the moment I've this function : """ public void serialEvent(SerialPortEvent e) { StringBuffer inputBuffer = new StringBuffer(); int newData = 0; switch (e.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } //-- Manag. Data from Scanner this.MngDataScanner(inputBuffer.toString()); break; case SerialPortEvent.BI:; //-- Break Received } } """ How can I do what you write ? ( maybe a simple ex ? ) PS : I don't know the PDF417 size (could be, for example, 338 char, or 500 ... ; what I know is that it can't be more than 800 char) Thanks in advance. Best regards. Trent Jarvi a ?crit : > 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 Martin.Oberhuber at windriver.com Mon Nov 5 08:47:50 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 5 Nov 2007 16:47:50 +0100 Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> Hi Trent, are the interestes of hobbyists really so different from commercial ones? Both should be interested in high quality and innovation the like. I haven't seen too many Open Source projects from the "inside" but those that I have seen did not have separate mailing lists for quality/testing/qa versus innovation/development. What I have seen with the Open Source projects that one would call "successful" is a good deal of process around automated builds, automated unit tests, predictable release dates and milestones, and policies around commiting/contributing/reviewing changes. I think that all of these benefit commercial users and hobbyists the like. If you were just asking about who's interested in discussing changes to foster more quality, count me in. I'm just not sure whether discussing these on a separate mailing list or other channel is the right thing to do. Cheers, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From toupsz at cs.tamu.edu Tue Nov 6 14:27:04 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 15:27:04 -0600 Subject: [Rxtx] reading TTL level signals from serial? Message-ID: Dear RXTX community- I've been using RXTX to handle communicating with several hardware devices in Java (a GPS and some custom audio circuitry for my dissertation work). I have a new, high-accuracy GPS which only communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there any way to communicate with this device using RXTX, perhaps by modding the native code for Windows? If so, does anyone have any tips on how to do it? Has it perhaps already been done? Another option is for me to invert / amplify the signal in hardware, but this is difficult for me to pull off due to the sensitivity of the electronics involved...I'll likely end up using a much less accurate piece of equipment rather than go that far! If anyone could help out, I'd really appreciate it! Thanks! -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/b6c59c2b/attachment-0013.html From netbeans at gatworks.com Tue Nov 6 14:55:22 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 06 Nov 2007 16:55:22 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: Message-ID: <4730E2CA.3090009@gatworks.com> This is really a hardware issue. Is there any device ( ie the serial port ) on your computer that will accept the voltage signals ( and load ) that your device produces? Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it happen safely ( ie u dont cook the GPS device ) I have a new, high-accuracy GPS which only > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there > any way to communicate with this device using RXTX, From toupsz at cs.tamu.edu Tue Nov 6 15:14:01 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 16:14:01 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4730E2CA.3090009@gatworks.com> References: <4730E2CA.3090009@gatworks.com> Message-ID: Actually, the device runs over USB, but shows up as a virtual serial port and is outputting these signals. The software that comes with the device (a u-blox ANTARIS 4 eval kit) is able to communicate. RXTX is able to detect and properly configure the port, but does not get any of the data from it. :-/ It seems like there must be some way to do it (obviously, ublox knows how)... -Zach On Nov 6, 2007 3:55 PM, U. George wrote: > This is really a hardware issue. > Is there any device ( ie the serial port ) on your computer that will > accept the voltage signals ( and load ) that your device produces? > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it > happen safely ( ie u dont cook the GPS device ) > > > I have a new, high-accuracy GPS which only > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there > > any way to communicate with this device using RXTX, > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/15ae7a0b/attachment-0013.html From keithvz at verizon.net Tue Nov 6 16:16:55 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 06 Nov 2007 18:16:55 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> Message-ID: <4730F5E7.1030704@verizon.net> Zach Toups wrote: > On Nov 6, 2007 3:55 PM, U. George > wrote: > > This is really a hardware issue. > Is there any device ( ie the serial port ) on your computer that will > accept the voltage signals ( and load ) that your device produces? > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it > happen safely ( ie u dont cook the GPS device ) > > > I have a new, high-accuracy GPS which only > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is > there > > any way to communicate with this device using RXTX, > _______________________________________________ As UGeorge intimated, it's a hardware issue. If your device outputs TTL level voltages, and your USB to serial converter is RS-232, then you've got a physical hardware differences. Inverted leads and voltage issues are mainly the problem. MAXIM makes a neat little chip called the MAX233 (better than the 232, no extern caps required) You can't solve this in software. Now, there are TTL level compatible USB to serial converters available, I happen to be using one right now. This unit below is from a UK company (there might be sources in the US) http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm Parallax makes one that does 3.3 and 5v http://www.parallax.com/detail.asp?product_id=32201 (but only supports RX, TX, GND, AND DTR towards device) (i've tested a variant of the unit above, and it works with RXTX) In both cases, you'll need some creative wiring depending on the interface on your GPS. Hope this helps Keith From toupsz at cs.tamu.edu Tue Nov 6 16:53:01 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 17:53:01 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4730F5E7.1030704@verizon.net> References: <4730E2CA.3090009@gatworks.com> <4730F5E7.1030704@verizon.net> Message-ID: Yeah...I used an FTDI chip to handle USB/serial conversion on the audio equipment I built. I'm leery of trying to build a board for this ublox GPS due to all the grounding/shielding issues around it. Anyway, I apreciate the help...just sad that I can't handle the problem in software! Ublox did send me the source code for their USB drivers...but as a Java programmer, it's a bit tough for me to sort out. ;) Thanks again! -Zach On Nov 6, 2007 5:16 PM, Keith Monahan wrote: > Zach Toups wrote: > > > On Nov 6, 2007 3:55 PM, U. George > > wrote: > > > > This is really a hardware issue. > > Is there any device ( ie the serial port ) on your computer that > will > > accept the voltage signals ( and load ) that your device produces? > > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make > it > > happen safely ( ie u dont cook the GPS device ) > > > > > > I have a new, high-accuracy GPS which only > > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is > > there > > > any way to communicate with this device using RXTX, > > _______________________________________________ > > As UGeorge intimated, it's a hardware issue. > > If your device outputs TTL level voltages, and your USB to serial > converter is RS-232, then you've got a physical hardware differences. > Inverted leads and voltage issues are mainly the problem. MAXIM makes a > neat little chip called the MAX233 (better than the 232, no extern caps > required) > > You can't solve this in software. > > Now, there are TTL level compatible USB to serial converters available, > I happen to be using one right now. > > This unit below is from a UK company (there might be sources in the US) > > http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm > > Parallax makes one that does 3.3 and 5v > > http://www.parallax.com/detail.asp?product_id=32201 > (but only supports RX, TX, GND, AND DTR towards device) > > (i've tested a variant of the unit above, and it works with RXTX) > > In both cases, you'll need some creative wiring depending on the > interface on your GPS. > > Hope this helps > > Keith > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/06e88ad4/attachment-0013.html From netbeans at gatworks.com Tue Nov 6 17:14:01 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 06 Nov 2007 19:14:01 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> <4730F5E7.1030704@verizon.net> Message-ID: <47310349.5000406@gatworks.com> what gps chipset do u have? > Ublox did send me the source code for their USB drivers...but as a Java > programmer, it's a bit tough for me to sort out. ;) From Steffen.DETTMER at ingenico.com Wed Nov 7 03:10:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 7 Nov 2007 11:10:01 +0100 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> Message-ID: <20071107101000.GN10978@elberon.bln.de.ingenico.com> * Zach Toups wrote on Tue, Nov 06, 2007 at 16:14 -0600: > Actually, the device runs over USB, but shows up as a virtual > serial port and is outputting these signals. Ahh, so what you want is to use rxtx on the serial port that is created by the driver and mapped maybe as some COM8 or whatever? I this case then IMHO it would be no hardware question but maybe a problem in your application, or some driver or indeed a rxtx issue. > The software that > comes with the device (a u-blox ANTARIS 4 eval kit) is able to > communicate. Is it sure that this software is really using the virtual serial port and only this port? oki, Steffen -- About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Wed Nov 7 04:59:10 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 06:59:10 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <20071107101000.GN10978@elberon.bln.de.ingenico.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> Message-ID: <4731A88E.6080705@gatworks.com> >> The software that >> comes with the device (a u-blox ANTARIS 4 eval kit) is able to >> communicate. > > Is it sure that this software is really using the virtual serial > port and only this port? > I have tried to read the docs. I have yet to find any explanation on a (windoz) device driver for this device ( the usb device ). That magic is not explained. For a developer thats important magic. Maybe a call to their support team is in order? From netbeans at gatworks.com Wed Nov 7 05:01:38 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 07:01:38 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <20071107101000.GN10978@elberon.bln.de.ingenico.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> Message-ID: <4731A922.7@gatworks.com> Steffen DETTMER wrote: > * Zach Toups wrote on Tue, Nov 06, 2007 at 16:14 -0600: >> Actually, the device runs over USB, but shows up as a virtual BTW: it seems that I am not getting all the Rxtx mail. Is there still a problem? From toupsz at cs.tamu.edu Wed Nov 7 07:36:20 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Wed, 7 Nov 2007 08:36:20 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4731A88E.6080705@gatworks.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> <4731A88E.6080705@gatworks.com> Message-ID: When I emailed them about this issue, they sent me their WinCE drivers, which are apparently based on this open source driver: http://www.yetanotherhomepage.com/j7xx/j7xx.html?/j7xx/software/util/usbdriver.html These include srcdll, and x86 subfolders, though it's not 100% clear to me that these are useful. The ublox communication suite appears to only communicate with serial ports...I've communicated with the ublox on two different comm ports (one with the serial adapter plugged into the serial port, one with the main USB connection), as well as a Garmin bluetooth GPS (which comes up as a bluetooth serial device). I'm not well versed in code this close to the hardware, but it seems to me that if you're running a virtual serial port, then you're virtually controlling the "voltages" that come in on this "port"...so why would they be "ttl level"? :-/ Shouldn't the USB driver be able to interpret the signals in whatever way it wants and just supply software with the binary interpretation? Thanks for all the help, guys, it's really appreciated! -Zach On Nov 7, 2007 5:59 AM, U. George wrote: > > >> The software that > >> comes with the device (a u-blox ANTARIS 4 eval kit) is able to > >> communicate. > > > > Is it sure that this software is really using the virtual serial > > port and only this port? > > > > I have tried to read the docs. I have yet to find any explanation on a > (windoz) device driver for this device ( the usb device ). That magic > is not explained. For a developer thats important magic. Maybe a call > to their support team is in order? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071107/18a13314/attachment-0012.html From netbeans at gatworks.com Wed Nov 7 08:55:55 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 10:55:55 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> <4731A88E.6080705@gatworks.com> Message-ID: <4731E00B.9030902@gatworks.com> There are 2 components to talking to hardware. There is the electrical specification, and then there is the software specification. there is the rs232 specification, parallel port specification, and the USB electrical specification. Generally these are used to plug in the various devices, and hook up electrically. Then there is the software side. There is the device driver, a software component that sits somewhere in the kernel that handles the USB ( in your case ) controller. The device driver generally does not care about the electrical component. There are various chips that handle USB signals, and these chips have I/O addresses so that signals and data can be properly routed. There is also the side that communicates to the user via the COM port device-name. The device driver that you mentioned is for the "Support PL2303 serial chip". This device driver, which hopefully works, handles the USB chip, and eventually recognzes the gps device, and hopefully creates an COM port so the user can open up and communicate. These are a lot of "HOPES". Since u have the web address of the device driver, and developer, I would think that the developer, and any docs, might be better able to help u to first determine if the GPS device is recognized, and the COM port ( maybe its called by another name ) is created, as per documentation. > > These include srcdll, and x86 subfolders, though it's not 100% clear to > me that these are useful. From tjarvi at qbang.org Sat Nov 10 17:46:13 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Nov 2007 17:46:13 -0700 (MST) Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 5 Nov 2007, Oberhuber, Martin wrote: > Hi Trent, > > are the interestes of hobbyists really so different > from commercial ones? Both should be interested in > high quality and innovation the like. > > I haven't seen too many Open Source projects from the > "inside" but those that I have seen did not have > separate mailing lists for quality/testing/qa > versus innovation/development. > > What I have seen with the Open Source projects that > one would call "successful" is a good deal of > process around automated builds, automated unit > tests, predictable release dates and milestones, > and policies around commiting/contributing/reviewing > changes. > > I think that all of these benefit commercial users > and hobbyists the like. > > If you were just asking about who's interested in > discussing changes to foster more quality, count > me in. I'm just not sure whether discussing these > on a separate mailing list or other channel is the > right thing to do. > Hi Martin, There are two issues I'm thinking about. The first is the generic unit testing and quality initiatives required to move rxtx forward. The second is the inevitable fact that rxtx connects to external hardware. The discussion deals with a different set of problems. Here is a simple example of what I'm getting at. We have the capability of setting custom baud rates in rxtx. We may be interested in seeing regressions in rxtx, the C library or the kernel. Some people may be doing some tests with loopback connections. These will always work even if the baud rate is not set to the expected value. Some people may use null modems between two ports. This may be able to catch the problem but not always. Will the build machines be able to test this? (no - for a few reasons) Will people be trying to catch these type of regressions? (yes) What type of coverage does the community have in the end? (?) We could include the discussions in the same list or another equally open list that may be of interest to some folks that deal with these types of problems on a regular basis. -- Trent Jarvi tjarvi at qbang.org From timlow84 at gmail.com Mon Nov 12 00:31:17 2007 From: timlow84 at gmail.com (Timothy Low) Date: Mon, 12 Nov 2007 15:31:17 +0800 Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> Message-ID: <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> ---------- Forwarded message ---------- From: Timothy Low Date: Nov 12, 2007 3:02 PM Subject: Building RXTX From Source To: taj at www.linux.org.uk Cc: ferdinand.tang at tangs.net, Timothy Low , chweehuat.ng at tangs.net Hi Trent, I tried building RXTX from source, and I got this error. I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm trying to get the necessary ".so" files to use for my serial port communication through java. My linux kernal information is: *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 x86_64 x86_64 x86_64 GNU/Linux* I'll most glad if you can provide me some direction on this. Thanks ! ---------------- [root at smsgateway rxtx-2.0-7pre1]# ./configure checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu configure: WARNING: Trying libtool. If the following fails install libtool checking for gcc... gcc checking for C compiler default output... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking for ld used by GCC... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking for a sed that does not truncate output... /bin/sed checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking command to parse /usr/bin/nm -B output... ok checking how to run the C preprocessor... gcc -E checking for egrep... grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for ranlib... ranlib checking for strip... strip checking for objdir... .libs checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.lo... yes checking if gcc supports -fno-rtti -fno-exceptions... yes checking whether the linker (/usr/bin/ld) supports shared libraries... yes checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking dynamic linker characteristics... GNU/Linux ld.so checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no checking whether -lc should be explicitly linked in... no creating libtool checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking for style of include used by make... GNU checking dependency style of gcc... none checking fcntl.h usability... yes checking fcntl.h presence... yes checking for fcntl.h... yes checking sys/fcntl.h usability... yes checking sys/fcntl.h presence... yes checking for sys/fcntl.h... yes checking sys/file.h usability... yes checking sys/file.h presence... yes checking for sys/file.h... yes checking sys/time.h usability... yes checking sys/time.h presence... yes checking for sys/time.h... yes checking sys/signal.h usability... yes checking sys/signal.h presence... yes checking for sys/signal.h... yes checking signal.h usability... yes checking signal.h presence... yes checking for signal.h.. . yes checking termios.h usability... yes checking termios.h presence... yes checking for termios.h... yes checking asm/termbits.h usability... yes checking asm/termbits.h presence... yes checking for asm/termbits.h... yes checking grp.h usability... yes checking grp.h presence... yes checking for grp.h... yes checking pwd.h usability... yes checking pwd.h presence... yes checking for pwd.h... yes checking whether gcc needs -traditional... no checking whether to enable maintainer-specific portions of Makefiles... no /usr/java/jdk1.5.0_13 configure: WARNING: using JAVA_HOME environmental variable adjusted java.home is /usr/java/jdk1.5.0_13 checking os.name Linux checking os.arch i386 checking java.vendor Sun Microsystems Inc. checking java.version 1.5.0_13 checking os.version 2.6.18-8.el5xen comm.jar appears to be installed already. conftest.c: In function 'main': conftest.c:6: warning: incompatible implicit declaration of built-in function 'printf' conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:6: error: (Each undeclared identifier is reported only once conftest.c:6: error: for each function it appears in.) conftest.c:6: error: expected ')' before string constant conftest.c:7: warning: incompatible implicit declaration of built-in function 'exit' ./configure: line 9649: ./conftest: No such file or directory ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected conftest.c: In function 'main': conftest.c:5: warning: incompatible implicit declaration of built-in function 'printf' conftest.c:10: warning: incompatible implicit declaration of built-in function 'exit' configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status : config.h is unchanged config.status: executing depfiles commands [root at smsgateway rxtx-2.0-7pre1]# make install /usr/java/jdk1.5.0_13/bin/javac -classpath .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d /home/jboss/sources/rxtx- 2.0-7pre1/ -O /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java /home/jboss/sources/rxtx-2.0-7pre1/./src/UnSupportedLoggerException.java /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o /home/jboss/sources/rxtx-2.0-7pre1/x86_64-unknown-linux-gnu/SerialImp.lo /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'init_threads': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: cast from pointer to integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_nativeDrain': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: cast to pointer from integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'read_byte_array': /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: cast to pointer from integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_readArray': /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: comparison is always false due to limited range of data type /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_readTerminatedArray': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: comparison is always false due to limited range of data type mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial- 2.0.7pre1.* gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so -o .libs/librxtxSerial-2.0.7pre1.so (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.0.7pre1.so librxtxSerial.so) creating librxtxSerial.la (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la librxtxSerial.la) gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/ParallelImp.lo /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function 'Java_javax_comm_LPRPort_readArray': /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: comparison is always false due to limited range of data type rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* .libs/librxtxParallel-2.0.7pre1.* gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so -o .libs/librxtxParallel- 2.0.7pre1.so (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.0.7pre1.so librxtxParallel.so) creating librxtxParallel.la (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la librxtxParallel.la) make all-am make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' libtool: install: `x86_64-unknown-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 ------------- Regards, Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071112/27758c3c/attachment-0008.html From tjarvi at qbang.org Mon Nov 12 01:02:09 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Nov 2007 01:02:09 -0700 (MST) Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> Message-ID: On Mon, 12 Nov 2007, Timothy Low wrote: > > Hi Trent, Hi Tim, Comments are inline. As I mentioned off the list, rxtx 2.0 is on the edge of deprecation. We can get it working but this is not the path of least resistance for future work. You will probably need to bounce another round of questions off the list. The following is intended to isolate the problem. > > I tried building RXTX from source, and I got this error. > > > I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm trying > to get the necessary ".so" files to use for my serial port communication > through java. > My linux kernal information is: > > *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 x86_64 > x86_64 x86_64 GNU/Linux* > > I'll most glad if you can provide me some direction on this. Thanks ! > > ---------------- > [root at smsgateway rxtx-2.0-7pre1]# ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > checking for C compiler default output... a.out > checking whether the C compiler works... yes > checking whether we are cross compiling... no > checking for suffix of executables... > checking for suffix of object files... o > checking whether we are using the GNU C compiler... yes > checking whether gcc accepts -g... yes > checking for gcc option to accept ANSI C... none needed > checking for ld used by GCC... /usr/bin/ld > checking if the linker (/usr/bin/ld) is GNU ld... yes > checking for /usr/bin/ld option to reload object files... -r > checking for BSD-compatible nm... /usr/bin/nm -B > checking for a sed that does not truncate output... /bin/sed > checking whether ln -s works... yes > checking how to recognise dependent libraries... pass_all > checking command to parse /usr/bin/nm -B output... ok > checking how to run the C preprocessor... gcc -E > checking for egrep... grep -E > checking for ANSI C header files... yes > checking for sys/types.h... yes > checking for sys/stat.h... yes > checking for stdlib.h... yes > checking for string.h... yes > checking for memory.h... yes > checking for strings.h... yes > checking for inttypes.h... yes > checking for stdint.h... yes > checking for unistd.h... yes > checking dlfcn.h usability... yes > checking dlfcn.h presence... yes > checking for dlfcn.h... yes > checking for ranlib... ranlib > checking for strip... strip > checking for objdir... .libs > checking for gcc option to produce PIC... -fPIC > checking if gcc PIC flag -fPIC works... yes > checking if gcc static flag -static works... yes > checking if gcc supports -c -o file.o... yes > checking if gcc supports -c -o file.lo... yes > checking if gcc supports -fno-rtti -fno-exceptions... yes > checking whether the linker (/usr/bin/ld) supports shared libraries... yes > checking how to hardcode library paths into programs... immediate > checking whether stripping libraries is possible... yes > checking dynamic linker characteristics... GNU/Linux ld.so > checking if libtool supports shared libraries... yes > checking whether to build shared libraries... yes > checking whether to build static libraries... no > checking whether -lc should be explicitly linked in... no > creating libtool > checking for a BSD-compatible install... /usr/bin/install -c > checking whether build environment is sane... yes > checking for gawk... gawk > checking whether make sets $(MAKE)... yes > checking for style of include used by make... GNU > checking dependency style of gcc... none > checking fcntl.h usability... yes > checking fcntl.h presence... yes > checking for fcntl.h... yes > checking sys/fcntl.h usability... yes > checking sys/fcntl.h presence... yes > checking for sys/fcntl.h... yes > checking sys/file.h usability... yes > checking sys/file.h presence... yes > checking for sys/file.h... yes > checking sys/time.h usability... yes > checking sys/time.h presence... yes > checking for sys/time.h... yes > checking sys/signal.h usability... yes > checking sys/signal.h presence... yes > checking for sys/signal.h... yes > checking signal.h usability... yes > checking signal.h presence... yes > checking for signal.h.. . yes > checking termios.h usability... yes > checking termios.h presence... yes > checking for termios.h... yes > checking asm/termbits.h usability... yes > checking asm/termbits.h presence... yes > checking for asm/termbits.h... yes > checking grp.h usability... yes > checking grp.h presence... yes > checking for grp.h... yes > checking pwd.h usability... yes > checking pwd.h presence... yes > checking for pwd.h... yes > checking whether gcc needs -traditional... no > checking whether to enable maintainer-specific portions of Makefiles... no > /usr/java/jdk1.5.0_13 > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /usr/java/jdk1.5.0_13 > checking os.name Linux > checking os.arch i386 > checking java.vendor Sun Microsystems Inc. > checking java.version 1.5.0_13 > checking os.version 2.6.18-8.el5xen > comm.jar appears to be installed already. > conftest.c: In function 'main': > conftest.c:6: warning: incompatible implicit declaration of built-in > function 'printf' > conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:6: error: (Each undeclared identifier is reported only once > conftest.c:6: error: for each function it appears in.) > conftest.c:6: error: expected ')' before string constant This is an outdated kernel version check for when headers and kernels could cause problems for rxtx. If we made it past this, then you are OK. > conftest.c:7: warning: incompatible implicit declaration of built-in > function 'exit' > ./configure: line 9649: ./conftest: No such file or directory > ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected It blew up but continues.. > conftest.c: In function 'main': > conftest.c:5: warning: incompatible implicit declaration of built-in > function 'printf' > conftest.c:10: warning: incompatible implicit declaration of built-in > function 'exit' > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status : config.h is unchanged > config.status: executing depfiles commands > [root at smsgateway rxtx-2.0-7pre1]# make install > /usr/java/jdk1.5.0_13/bin/javac -classpath > .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d > /home/jboss/sources/rxtx- 2.0-7pre1/ -O > /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java > /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/UnSupportedLoggerException.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java > Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or > overrides a deprecated API. > Note: Recompile with -Xlint:deprecation for details. > /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* The java jar should be fine now. You may need to change the source files as mentioned below. > gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. > -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g > -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o > /home/jboss/sources/rxtx-2.0-7pre1/x86_64-unknown-linux-gnu/SerialImp.lo > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'init_threads': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: cast > from pointer to integer of different size > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_nativeDrain': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: cast to > pointer from integer of different size > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'read_byte_array': > /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: cast to > pointer from integer of different size As I recall, this was caused by pointers (now 64 bit rather than 32 bit) being stored in java ints (jints). I would look at the diff between the CVS 2.1 SerialImp.c and RXTXPort.java files against 2.0. We did fix those issues. You have a .so file but the different pointer sizes will cause runtime errors. > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_readArray': > /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: > comparison is always false due to limited range of data type > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_readTerminatedArray': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: > comparison is always false due to limited range of data type > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial- > 2.0.7pre1.* > gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so -o > .libs/librxtxSerial-2.0.7pre1.so > (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.0.7pre1.so > librxtxSerial.so) > creating librxtxSerial.la > (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la > librxtxSerial.la) > gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. > -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g > -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o > /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/ParallelImp.lo > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function > 'Java_javax_comm_LPRPort_readArray': > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: > comparison is always false due to limited range of data type > rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* > .libs/librxtxParallel-2.0.7pre1.* > gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so -o > .libs/librxtxParallel- 2.0.7pre1.so > (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.0.7pre1.so > librxtxParallel.so) > creating librxtxParallel.la > (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la > librxtxParallel.la) > make all-am > make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' > make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' > libtool: install: `x86_64-unknown-linux-gnu' must be an absolute directory > name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 A libtool change? Assuming you ran configure && make install in /home/jboss/sources/rxtx- 2.0-7pre1, libtool is looking for /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/.libs/librxtxSerial-2.0.7pre1.so. I think you have this? The file is just being copied to ~JAVA/jre/lib/$(JAVA_ARCH). -- Trent Jarvi tjarvi at qbang.org From sarah_662005 at yahoo.com Mon Nov 12 16:10:28 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Mon, 12 Nov 2007 15:10:28 -0800 (PST) Subject: [Rxtx] [urgent] device's power off detection Message-ID: <766782.10076.qm@web55803.mail.re3.yahoo.com> Hello all, I have a small application built on top of rxtx api. This application can retrieve the incoming data from a device through a port. The device can be powered off after the port get closed from the application. I have been trying a couple of hours to find a way to detect the power switching from device. If anyone knows how to handle it through rxtx, could you please give me a help? Thank you very much. r, Sara ____________________________________________________________________________________ Get easy, one-click access to your favorites. Make Yahoo! your homepage. http://www.yahoo.com/r/hs -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071112/4599f3ec/attachment-0007.html From netbeans at gatworks.com Mon Nov 12 17:52:22 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 12 Nov 2007 19:52:22 -0500 Subject: [Rxtx] [urgent] device's power off detection In-Reply-To: <766782.10076.qm@web55803.mail.re3.yahoo.com> References: <766782.10076.qm@web55803.mail.re3.yahoo.com> Message-ID: <4738F546.5010101@gatworks.com> Not sure what u are asking for. Are u asking for a way to detect if the device is OFF? Are u asking how to power off the device - via software ? Is it a Serial device? is it a parallel device? is it a usb device? Sara Hugh wrote: > Hello all, > I have a small application built on top of rxtx api. This application > can retrieve the incoming data from a device through a port. The device > can be powered off after the port get closed from the application. I > have been trying a couple of hours to find a way to detect the power > switching from device. If anyone knows how to handle it through rxtx, > could you please give me a help? Thank you very much. From tjarvi at qbang.org Mon Nov 12 22:48:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Nov 2007 22:48:11 -0700 (MST) Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711120225x562db8cbxb750767ade3b0d73@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> <900c6ba90711120031p66edc001ted76f7ba24e34b98@mail.gmail.com> <900c6ba90711120225x562db8cbxb750767ade3b0d73@mail.gmail.com> Message-ID: Hi Tim, The gnu.io namespace looks just like the javax.comm 2.0 namespace. There are additional (discouraged) undocumented methods in gnu.io that you need not use. We just used the different namespace to avoid poluting Sun's by mistake and to make sure we stayed off any potential licensing related radar. Usuaully, you just change your imports and make sure you do not use the javax.comm namespace for anything like exception handling. As I mentioned off the list, there are no issues with rxtx going through the JSR process to be more Sun friendly other than time. rxtx has no hidden intentions there; anything that does not work like CommAPI 2.0 documented is a bug. The reason we do not support CommAPI 2.1 is technical in nature and is in the list archives as well as the front page of www.rxtx.org. On Mon, 12 Nov 2007, Timothy Low wrote: > Hi Trent, > > I'll move to use a JDK1.5 64-bit version... but do I need to make any source > code changes to use the package (gnu.io) in the RTXTcomm.jar instead of the > ones from the javacomm api ? > > > Regards, > Tim > > On Nov 12, 2007 5:22 PM, Trent Jarvi wrote: > >> >> Hi Tim, >> >> I see a couple things here. >> >> First your jdk is for i686 yet the library is compiled on a x86_64 >> machine. You may try passing configure the --target=i686-unknown-linux to >> try using the i686 backend to gcc if it is available. Or move to the 64 >> bit jdk. >> >> The other error I see is again the moved UTF_RELEASE define that we need >> to fix. You can probably get around that with: >> >> make -DUTF_RELEASE=`uname -r` >> >> even more simple would be to just specify the serial library which should >> be in configure --help. >> >> You can remove the UTF_RELEASE check from configure by editing >> configure.in, searching for the simple C program check and deleting it. >> Running autoconf after that will regenerate a new configure without the >> check. >> >> Note that you should remove the previous native libraries >> (librxtxSerial.so) when moving from rxtx 2.0 to 2.1. These are compiled >> for different namespaces (javax.comm/gnu.io). >> >> On Mon, 12 Nov 2007, Timothy Low wrote: >> >>> *Hi Trent, >>> >>> I moved on to rxtx 2.1.7r2, and updated my jre to 1.6.0 (64-bit)... I >> tried >>> the following 2 methods: >>> >>> (1) using the rxtx 2.1.7 binaries from the RXTX website* >>> *Are these binaries suitable for a 64-bit OS ? There mentioning of the >>> gnu.io that you've talked about previously...* >>> ------ >>> [root at smsgateway sources]# java -Djava.library.path=/usr/lib PortLister >>> Experimental: JNI_OnLoad called. >>> >>> java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion >>> ()Ljava/lang/String; >>> at gnu.io.RXTXCommDriver.nativeGetVersion(Native Method) >>> at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:85) >>> at java.lang.Class.forName0(Native Method) >>> at java.lang.Class.forName(Unknown Source) >>> at javax.comm.CommPortIdentifier.loadDriver( >> CommPortIdentifier.java >>> :237) >>> at javax.comm.CommPortIdentifier.(CommPortIdentifier.java >>> :109) >>> at PortLister.(PortLister.java:6) >>> at PortLister.main(PortLister.java:25) >>> Exception in thread "main" java.lang.UnsatisfiedLinkError: >>> com.sun.comm.SunrayInfo.isSessionActive()Z >>> at com.sun.comm.SunrayInfo.isSessionActive(Native Method) >>> at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java >> :155) >>> at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java >>> :100) >>> at javax.comm.CommPortIdentifier.(CommPortIdentifier.java >>> :138) >>> at PortLister.(PortLister.java:6) >>> at PortLister.main(PortLister.java:25) >>> >>> ------ >>> >>> (2) compiling the rxtx 2.1.7 from source >>> *but i got the following error while running ./configure and make all* >>> >>> ------ >>> [root at smsgateway rxtx-2.1-7r2]# ./configure >>> checking build system type... x86_64-unknown-linux-gnu >>> checking host system type... x86_64-unknown-linux-gnu >>> checking target system type... x86_64-unknown-linux-gnu >>> configure: WARNING: Trying libtool. If the following fails install >> libtool >>> checking for gcc... gcc >>> checking for C compiler default output file name... a.out >>> checking whether the C compiler works... yes >>> checking whether we are cross compiling... no >>> checking for suffix of executables... >>> checking for suffix of object files... o >>> checking whether we are using the GNU C compiler... yes >>> checking whether gcc accepts -g... yes >>> checking for gcc option to accept ANSI C... none needed >>> checking for a sed that does not truncate output... /bin/sed >>> checking for egrep... grep -E >>> checking for ld used by gcc... /usr/bin/ld >>> checking if the linker (/usr/bin/ld) is GNU ld... yes >>> checking for /usr/bin/ld option to reload object files... -r >>> checking for BSD-compatible nm... /usr/bin/nm -B >>> checking whether ln -s works... yes >>> checking how to recognise dependent libraries... pass_all >>> checking how to run the C preprocessor... gcc -E >>> checking for ANSI C header files... yes >>> checking for sys/types.h... yes >>> checking for sys/stat.h... yes >>> checking for stdlib.h... yes >>> checking for string.h... yes >>> checking for memory.h... yes >>> checking for strings.h... yes >>> checking for inttypes.h... yes >>> checking for stdint.h... yes >>> checking for unistd.h... yes >>> checking dlfcn.h usability... yes >>> checking dlfcn.h presence... yes >>> checking for dlfcn.h... yes >>> checking for g++... g++ >>> checking whether we are using the GNU C++ compiler... yes >>> checking whether g++ accepts -g... yes >>> checking how to run the C++ preprocessor... g++ -E >>> checking for g77... no >>> checking for f77... no >>> checking for xlf... no >>> checking for frt... no >>> checking for pgf77... no >>> checking for fort77... no >>> checking for fl32... no >>> checking for af77... no >>> checking for f90... no >>> checking for xlf90... no >>> checking for pgf90... no >>> checking for epcf90... no >>> checking for f95... f95 >>> checking whether we are using the GNU Fortran 77 compiler... yes >>> checking whether f95 accepts -g... yes >>> checking the maximum length of command line arguments... 32768 >>> checking command to parse /usr/bin/nm -B output from gcc object... ok >>> checking for objdir... .libs >>> checking for ar... ar >>> checking for ranlib... ranlib >>> checking for strip... strip >>> checking if gcc static flag works... yes >>> checking if gcc supports -fno-rtti -fno-exceptions... no >>> checking for gcc option to produce PIC... -fPIC >>> checking if gcc PIC flag -fPIC works... yes >>> checking if gcc supports -c -o file.o... yes >>> checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking whether -lc should be explicitly linked in... no >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> checking if libtool supports shared libraries... yes >>> checking whether to build shared libraries... yes >>> checking whether to build static libraries... no >>> configure: creating libtool >>> appending configuration tag "CXX" to libtool >>> checking for ld used by g++... /usr/bin/ld -m elf_x86_64 >>> checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes >>> checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking for g++ option to produce PIC... -fPIC >>> checking if g++ PIC flag -fPIC works... yes >>> checking if g++ supports -c -o file.o... yes >>> checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> appending configuration tag "F77" to libtool >>> checking if libtool supports shared libraries... yes >>> checking whether to build shared libraries... yes >>> checking whether to build static libraries... no >>> checking for f95 option to produce PIC... -fPIC >>> checking if f95 PIC flag -fPIC works... yes >>> checking if f95 supports -c -o file.o... yes >>> checking whether the f95 linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> checking for a BSD-compatible install... /usr/bin/install -c >>> checking whether build environment is sane... yes >>> checking for gawk... gawk >>> checking whether make sets $(MAKE)... yes >>> checking for style of include used by make... GNU >>> checking dependency style of gcc... none >>> checking dependency style of g++... none >>> checking fcntl.h usability... yes >>> checking fcntl.h presence... yes >>> checking for fcntl.h... yes >>> checking sys/fcntl.h usability... yes >>> checking sys/fcntl.h presence... yes >>> checking for sys/fcntl.h... yes >>> checking sys/file.h usability... yes >>> checking sys/file.h presence... yes >>> checking for sys/file.h... yes >>> checking sys/time.h usability... yes >>> checking sys/time.h presence... yes >>> checking for sys/time.h... yes >>> checking sys/signal.h usability... yes >>> checking sys/signal.h presence... yes >>> checking for sys/signal.h... yes >>> checking signal.h usability... yes >>> checking signal.h presence... yes >>> checking for signal.h... yes >>> checking termios.h usability... yes >>> checking termios.h presence... yes >>> checking for termios.h... yes >>> checking grp.h usability... yes >>> checking grp.h presence... yes >>> checking for grp.h... yes >>> checking pwd.h usability... yes >>> checking pwd.h presence... yes >>> checking for pwd.h... yes >>> checking whether gcc needs -traditional... no >>> checking whether to enable maintainer-specific portions of Makefiles... >> no >>> /usr/java/jdk1.5.0_13 >>> configure: WARNING: using JAVA_HOME environmental variable >>> adjusted java.home is /usr/java/jdk1.5.0_13 >>> checking os.name Linux >>> checking os.arch i386 >>> checking java.vendor Sun Microsystems Inc. >>> checking java.version 1.5.0_13 >>> checking os.version 2.6.18-8.el5xen >>> conftest.c: In function 'main': >>> conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this >> function) >>> conftest.c:8: error: (Each undeclared identifier is reported only once >>> conftest.c:8: error: for each function it appears in.) >>> conftest.c:8: error: expected ')' before string constant >>> ./configure: line 21462: ./conftest: No such file or directory >>> ./configure: line 21462: test: 2.6.18-8.el5xen: unary operator expected >>> configure: creating ./config.status >>> config.status: creating Makefile >>> config.status: creating config.h >>> config.status: executing depfiles commands >>> [root at smsgateway rxtx-2.1-7r2]# make install >>> /usr/java/jdk1.5.0_13/bin/javac -classpath .:/home/jboss/sources/rxtx- >>> >> 2.1-7r2:/home/jboss/sources/rxtx-2.1-7r2/src:/usr/java/jdk1.5.0_13/jre/lib/ext/RXTXcomm.jar-d >>> /home/jboss/sources/rxtx- >>> 2.1-7r2/ -O -source 1.3 -target 1.3 >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommDriver.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortEnumerator.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortIdentifier.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortOwnershipListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Configure.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2C.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/I2CPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/LPRPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/NoSuchPortException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/PortInUseException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Raw.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/RawPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RawPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RawPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/RS485PortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485PortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485Port.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXCommDriver.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXVersion.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPort.java >>> /home/jboss/sources/rxtx-2.1-7r2 >> /./src/UnsupportedCommOperationException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/UnSupportedLoggerException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Zystem.java >>> /usr/java/jdk1.5.0_13/bin/javah -classpath .:/home/jboss/sources/rxtx- >>> >> 2.1-7r2:/home/jboss/sources/rxtx-2.1-7r2/src:/usr/java/jdk1.5.0_13/jre/lib/ext/RXTXcomm.jar-d >>> x86_64-unknown-linux-gnu -jni `(for i in CommDriver CommPortEnumerator >>> CommPortIdentifier CommPort CommPortOwnershipListener Configure I2C >>> I2CPortEvent I2CPortEventListener I2CPort LPRPort NoSuchPortException >>> ParallelPortEvent ParallelPortEventListener ParallelPort >> PortInUseException >>> Raw RawPortEvent RawPortEventListener RawPort RS485 RS485PortEvent >>> RS485PortEventListener RS485Port RXTXCommDriver RXTXPort RXTXVersion >>> SerialPortEvent SerialPortEventListener SerialPort >>> UnsupportedCommOperationException UnSupportedLoggerException Zystem;do \ >>> if grep > /dev/null native.*\( /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/$i.java; then \ >>> echo gnu.io.$i; \ >>> fi; \ >>> done)` >>> /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialImp.c -o >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo; >>> \ >>> if [ "Serial" = "Serial" ]; >>> then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxSerial.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxSerial.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo; >> \ >>> fi; \ >>> ) >>> mkdir /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/.libs >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/SerialImp.o >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/fuserImp.o >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c: In function >> 'show_user': >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c:238: warning: cast >> from >>> pointer to integer of different size >>> gcc -shared /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/SerialImp.o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/fuserImp.o >>> -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7.so -o >> .libs/librxtxSerial- >>> 2.1-7.so >>> (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.1-7.so >>> librxtxSerial.so) >>> creating librxtxSerial.la >>> (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la >>> librxtxSerial.la) >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelImp.c -o >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/ParallelImp.lo; >>> \ >>> if [ "Parallel" = "Serial" ]; >>> then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxParallel.la -rpath >>> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/ParallelImp.lo >>> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxParallel.la -rpath >>> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/ParallelImp.lo; >>> \ >>> fi; \ >>> ) >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >>> /x86_64-unknown-linux-gnu/.libs/ParallelImp.o >>> gcc -shared /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/ParallelImp.o >>> -lpthread -Wl,-soname -Wl,librxtxParallel-2.1-7.so -o >>> .libs/librxtxParallel-2.1-7.so >>> (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.1-7.so >>> librxtxParallel.so) >>> creating librxtxParallel.la >>> (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la >>> librxtxParallel.la) >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo; >>> \ >>> if [ "I2C" = "Serial" ]; then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxI2C.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo >>> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxI2C.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo; >>> \ >>> fi; \ >>> ) >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/.libs/I2CImp.o >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c: In function >>> 'Java_gnu_io_I2CPort_Initialize': >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: 'UTS_RELEASE' >>> undeclared (first use in this function) >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: (Each >> undeclared >>> identifier is reported only once >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: for each >> function >>> it appears in.) >>> libtool: link: `/home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/I2CImp.lo' >>> is not a valid libtool object >>> make: *** [x86_64-unknown-linux-gnu/librxtxI2C.la] Error 1 >>> >>> ------ >>> >>> >>> >>> On Nov 12, 2007 4:02 PM, Trent Jarvi wrote: >>> >>>> On Mon, 12 Nov 2007, Timothy Low wrote: >>>>> >>>>> Hi Trent, >>>> >>>> Hi Tim, >>>> >>>> Comments are inline. As I mentioned off the list, rxtx 2.0 is on the >> edge >>>> of deprecation. We can get it working but this is not the path of >> least >>>> resistance for future work. >>>> >>>> You will probably need to bounce another round of questions off the >> list. >>>> The following is intended to isolate the problem. >>>> >>>>> >>>>> I tried building RXTX from source, and I got this error. >>>>> >>>>> >>>>> I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm >>>> trying >>>>> to get the necessary ".so" files to use for my serial port >> communication >>>>> through java. >>>>> My linux kernal information is: >>>>> >>>>> *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 >>>> x86_64 >>>>> x86_64 x86_64 GNU/Linux* >>>>> >>>>> I'll most glad if you can provide me some direction on this. Thanks ! >>>>> >>>>> ---------------- >>>>> [root at smsgateway rxtx-2.0-7pre1]# ./configure >>>>> checking build system type... x86_64-unknown-linux-gnu >>>>> checking host system type... x86_64-unknown-linux-gnu >>>>> checking target system type... x86_64-unknown-linux-gnu >>>>> configure: WARNING: Trying libtool. If the following fails install >>>> libtool >>>>> checking for gcc... gcc >>>>> checking for C compiler default output... a.out >>>>> checking whether the C compiler works... yes >>>>> checking whether we are cross compiling... no >>>>> checking for suffix of executables... >>>>> checking for suffix of object files... o >>>>> checking whether we are using the GNU C compiler... yes >>>>> checking whether gcc accepts -g... yes >>>>> checking for gcc option to accept ANSI C... none needed >>>>> checking for ld used by GCC... /usr/bin/ld >>>>> checking if the linker (/usr/bin/ld) is GNU ld... yes >>>>> checking for /usr/bin/ld option to reload object files... -r >>>>> checking for BSD-compatible nm... /usr/bin/nm -B >>>>> checking for a sed that does not truncate output... /bin/sed >>>>> checking whether ln -s works... yes >>>>> checking how to recognise dependent libraries... pass_all >>>>> checking command to parse /usr/bin/nm -B output... ok >>>>> checking how to run the C preprocessor... gcc -E >>>>> checking for egrep... grep -E >>>>> checking for ANSI C header files... yes >>>>> checking for sys/types.h... yes >>>>> checking for sys/stat.h... yes >>>>> checking for stdlib.h... yes >>>>> checking for string.h... yes >>>>> checking for memory.h... yes >>>>> checking for strings.h... yes >>>>> checking for inttypes.h... yes >>>>> checking for stdint.h... yes >>>>> checking for unistd.h... yes >>>>> checking dlfcn.h usability... yes >>>>> checking dlfcn.h presence... yes >>>>> checking for dlfcn.h... yes >>>>> checking for ranlib... ranlib >>>>> checking for strip... strip >>>>> checking for objdir... .libs >>>>> checking for gcc option to produce PIC... -fPIC >>>>> checking if gcc PIC flag -fPIC works... yes >>>>> checking if gcc static flag -static works... yes >>>>> checking if gcc supports -c -o file.o... yes >>>>> checking if gcc supports -c -o file.lo... yes >>>>> checking if gcc supports -fno-rtti -fno-exceptions... yes >>>>> checking whether the linker (/usr/bin/ld) supports shared libraries... >>>> yes >>>>> checking how to hardcode library paths into programs... immediate >>>>> checking whether stripping libraries is possible... yes >>>>> checking dynamic linker characteristics... GNU/Linux ld.so >>>>> checking if libtool supports shared libraries... yes >>>>> checking whether to build shared libraries... yes >>>>> checking whether to build static libraries... no >>>>> checking whether -lc should be explicitly linked in... no >>>>> creating libtool >>>>> checking for a BSD-compatible install... /usr/bin/install -c >>>>> checking whether build environment is sane... yes >>>>> checking for gawk... gawk >>>>> checking whether make sets $(MAKE)... yes >>>>> checking for style of include used by make... GNU >>>>> checking dependency style of gcc... none >>>>> checking fcntl.h usability... yes >>>>> checking fcntl.h presence... yes >>>>> checking for fcntl.h... yes >>>>> checking sys/fcntl.h usability... yes >>>>> checking sys/fcntl.h presence... yes >>>>> checking for sys/fcntl.h... yes >>>>> checking sys/file.h usability... yes >>>>> checking sys/file.h presence... yes >>>>> checking for sys/file.h... yes >>>>> checking sys/time.h usability... yes >>>>> checking sys/time.h presence... yes >>>>> checking for sys/time.h... yes >>>>> checking sys/signal.h usability... yes >>>>> checking sys/signal.h presence... yes >>>>> checking for sys/signal.h... yes >>>>> checking signal.h usability... yes >>>>> checking signal.h presence... yes >>>>> checking for signal.h.. . yes >>>>> checking termios.h usability... yes >>>>> checking termios.h presence... yes >>>>> checking for termios.h... yes >>>>> checking asm/termbits.h usability... yes >>>>> checking asm/termbits.h presence... yes >>>>> checking for asm/termbits.h... yes >>>>> checking grp.h usability... yes >>>>> checking grp.h presence... yes >>>>> checking for grp.h... yes >>>>> checking pwd.h usability... yes >>>>> checking pwd.h presence... yes >>>>> checking for pwd.h... yes >>>>> checking whether gcc needs -traditional... no >>>>> checking whether to enable maintainer-specific portions of >> Makefiles... >>>> no >>>>> /usr/java/jdk1.5.0_13 >>>>> configure: WARNING: using JAVA_HOME environmental variable >>>>> adjusted java.home is /usr/java/jdk1.5.0_13 >>>>> checking os.name Linux >>>>> checking os.arch i386 >>>>> checking java.vendor Sun Microsystems Inc. >>>>> checking java.version 1.5.0_13 >>>>> checking os.version 2.6.18-8.el5xen >>>>> comm.jar appears to be installed already. >>>>> conftest.c: In function 'main': >>>>> conftest.c:6: warning: incompatible implicit declaration of built-in >>>>> function 'printf' >>>>> conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this >>>> function) >>>>> conftest.c:6: error: (Each undeclared identifier is reported only once >>>>> conftest.c:6: error: for each function it appears in.) >>>>> conftest.c:6: error: expected ')' before string constant >>>> >>>> >>>> This is an outdated kernel version check for when headers and kernels >>>> could cause problems for rxtx. If we made it past this, then you are >> OK. >>>> >>>> >>>>> conftest.c:7: warning: incompatible implicit declaration of built-in >>>>> function 'exit' >>>>> ./configure: line 9649: ./conftest: No such file or directory >>>>> ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected >>>> >>>> It blew up but continues.. >>>> >>>>> conftest.c: In function 'main': >>>>> conftest.c:5: warning: incompatible implicit declaration of built-in >>>>> function 'printf' >>>>> conftest.c:10: warning: incompatible implicit declaration of built-in >>>>> function 'exit' >>>>> configure: creating ./config.status >>>>> config.status: creating Makefile >>>>> config.status: creating config.h >>>>> config.status : config.h is unchanged >>>>> config.status: executing depfiles commands >>>>> [root at smsgateway rxtx-2.0-7pre1]# make install >>>>> /usr/java/jdk1.5.0_13/bin/javac -classpath >>>>> .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/ -O >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1 >> /./src/UnSupportedLoggerException.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java >>>>> Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or >>>>> overrides a deprecated API. >>>>> Note: Recompile with -Xlint:deprecation for details. >>>>> /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* >>>> >>>> >>>> The java jar should be fine now. You may need to change the source >> files >>>> as mentioned below. >>>> >>>>> gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu >> -I. >>>>> -I/usr/java/jdk1.5.0_13/include >> -I/usr/java/jdk1.5.0_13/include/./linux/ >>>> -g >>>>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o >>>>> /home/jboss/sources/rxtx-2.0-7pre1 >> /x86_64-unknown-linux-gnu/SerialImp.lo >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'init_threads': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: >>>> cast >>>>> from pointer to integer of different size >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_nativeDrain': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: >>>> cast to >>>>> pointer from integer of different size >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'read_byte_array': >>>>> /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: >>>> cast to >>>>> pointer from integer of different size >>>> >>>> >>>> As I recall, this was caused by pointers (now 64 bit rather than 32 >> bit) >>>> being stored in java ints (jints). I would look at the diff between >> the >>>> CVS 2.1 SerialImp.c and RXTXPort.java files against 2.0. We >>>> did fix those issues. >>>> >>>> You have a .so file but the different pointer sizes will cause runtime >>>> errors. >>>> >>>> >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_readArray': >>>>> /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: >>>>> comparison is always false due to limited range of data type >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_readTerminatedArray': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: >>>>> comparison is always false due to limited range of data type >>>>> mkdir .libs >>>>> rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* >> .libs/librxtxSerial- >>>>> 2.0.7pre1.* >>>>> gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so-o >>>>> .libs/librxtxSerial-2.0.7pre1.so >>>>> (cd .libs && rm -f librxtxSerial.so && ln -s >> librxtxSerial-2.0.7pre1.so >>>>> librxtxSerial.so) >>>>> creating librxtxSerial.la >>>>> (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la >>>>> librxtxSerial.la) >>>>> gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu >> -I. >>>>> -I/usr/java/jdk1.5.0_13/include >> -I/usr/java/jdk1.5.0_13/include/./linux/ >>>> -g >>>>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o >>>>> /home/jboss/sources/rxtx- 2.0-7pre1 >>>> /x86_64-unknown-linux-gnu/ParallelImp.lo >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function >>>>> 'Java_javax_comm_LPRPort_readArray': >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: >>>>> comparison is always false due to limited range of data type >>>>> rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* >>>>> .libs/librxtxParallel-2.0.7pre1.* >>>>> gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so-o >>>>> .libs/librxtxParallel- 2.0.7pre1.so >>>>> (cd .libs && rm -f librxtxParallel.so && ln -s >>>> librxtxParallel-2.0.7pre1.so >>>>> librxtxParallel.so) >>>>> creating librxtxParallel.la >>>>> (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la >>>>> librxtxParallel.la) >>>>> make all-am >>>>> make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' >>>>> make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' >>>>> libtool: install: `x86_64-unknown-linux-gnu' must be an absolute >>>> directory >>>>> name >>>>> Try `libtool --help --mode=install' for more information. >>>>> make: *** [install] Error 1 >>>> >>>> A libtool change? Assuming you ran configure && make install in >>>> /home/jboss/sources/rxtx- 2.0-7pre1, libtool is looking for >>>> /home/jboss/sources/rxtx- >>>> 2.0-7pre1/x86_64-unknown-linux-gnu/.libs/librxtxSerial-2.0.7pre1.so. >>>> >>>> I think you have this? The file is just being copied to >>>> ~JAVA/jre/lib/$(JAVA_ARCH). >>>> >>>> -- >>>> Trent Jarvi >>>> tjarvi at qbang.org >>>> >>> >> > From guido.vogt at celsi.ch Tue Nov 13 00:28:01 2007 From: guido.vogt at celsi.ch (Guido Vogt) Date: Tue, 13 Nov 2007 08:28:01 +0100 Subject: [Rxtx] RTS Line can't be set Message-ID: <47395201.1050400@celsi.ch> I'm working on an Windows XP /SP2 System. Version of RXTX: 2.1.7. The serial line is connected to a modem. As I can see, the RTS-Line of the serial Port is inactive, when the port is opened (flowcontrol=none). Obviously, no data is coming from the modem. If I use the setRTS(true) command after open, the comport does not send out my data any more. This behaviour is regardless of flowcontrol. Anybody has an idea what do do? Thanks for help. From Martin.Oberhuber at windriver.com Tue Nov 13 08:58:23 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 13 Nov 2007 16:58:23 +0100 Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803880918@ism-mail03.corp.ad.wrs.com> Hi Trent, as said before, I like the idea of discussing such quality engineering issues, but why hide these away from the rest of the public? Anyways, if you do want to create a new mailing list for these kinds of things I'll happily subscribe. 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: Sunday, November 11, 2007 1:46 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: RE: [Rxtx] Quality Engineering with rxtx > > On Mon, 5 Nov 2007, Oberhuber, Martin wrote: > > > Hi Trent, > > > > are the interestes of hobbyists really so different > > from commercial ones? Both should be interested in > > high quality and innovation the like. > > > > I haven't seen too many Open Source projects from the > > "inside" but those that I have seen did not have > > separate mailing lists for quality/testing/qa > > versus innovation/development. > > > > What I have seen with the Open Source projects that > > one would call "successful" is a good deal of > > process around automated builds, automated unit > > tests, predictable release dates and milestones, > > and policies around commiting/contributing/reviewing > > changes. > > > > I think that all of these benefit commercial users > > and hobbyists the like. > > > > If you were just asking about who's interested in > > discussing changes to foster more quality, count > > me in. I'm just not sure whether discussing these > > on a separate mailing list or other channel is the > > right thing to do. > > > > Hi Martin, > > There are two issues I'm thinking about. The first is the > generic unit > testing and quality initiatives required to move rxtx > forward. The second > is the inevitable fact that rxtx connects to external hardware. The > discussion deals with a different set of problems. > > Here is a simple example of what I'm getting at. > > We have the capability of setting custom baud rates in rxtx. > We may be > interested in seeing regressions in rxtx, the C library or > the kernel. > Some people may be doing some tests with loopback > connections. These will > always work even if the baud rate is not set to the expected > value. Some > people may use null modems between two ports. This may be > able to catch > the problem but not always. > > Will the build machines be able to test this? (no - for a few reasons) > Will people be trying to catch these type of regressions? (yes) > What type of coverage does the community have in the end? (?) > > We could include the discussions in the same list or another > equally open > list that may be of interest to some folks that deal with > these types of > problems on a regular basis. > > -- > Trent Jarvi > tjarvi at qbang.org > From toupsz at cs.tamu.edu Tue Nov 13 10:33:03 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 13 Nov 2007 11:33:03 -0600 Subject: [Rxtx] [urgent] device's power off detection In-Reply-To: <4738F546.5010101@gatworks.com> References: <766782.10076.qm@web55803.mail.re3.yahoo.com> <4738F546.5010101@gatworks.com> Message-ID: Lacking any other specification on it...but can you set up the device to notify your software when it turns off? Send a message or somesuch? Maybe it can signal using RTS or DTR? -Zach On Nov 12, 2007 6:52 PM, U. George wrote: > Not sure what u are asking for. Are u asking for a way to detect if the > device is OFF? Are u asking how to power off the device - via software ? > Is it a Serial device? > is it a parallel device? > is it a usb device? > > Sara Hugh wrote: > > Hello all, > > I have a small application built on top of rxtx api. This application > > can retrieve the incoming data from a device through a port. The device > > can be powered off after the port get closed from the application. I > > have been trying a couple of hours to find a way to detect the power > > switching from device. If anyone knows how to handle it through rxtx, > > could you please give me a help? Thank you very much. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071113/e5859e4d/attachment-0005.html From tjarvi at qbang.org Tue Nov 13 20:02:03 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 13 Nov 2007 20:02:03 -0700 (MST) Subject: [Rxtx] #ifndef TIOCSERGETLSR In-Reply-To: <472E3AAF.7050709@gatworks.com> References: <472E3AAF.7050709@gatworks.com> Message-ID: On Sun, 4 Nov 2007, U. George wrote: > For Linux, it seems that you need the code for both *having* a > TIOCSERGETLSR, and *not having* a TIOCSERGETLSR. Maybe the ioctl exists > system wide, but not necessarily for the device driver itself ( always > returns -1 ) . > > Are there systems that have a *functioning* TIOCSERGETLSR for all their > devices? Then this would be the case where the "#ifndef TIOCSERGETLSR" > directive could be useful is eliminating the unnecessary code and tests. > > And for those systems that dont have a TIOCSERGETLSR, then the code for > TIOCSERGETLSR can be eliminated. > > It would be a simple case to have, as a foundation, all the code to > simulate the missing TIOCSERGETLSR ioctl. If the system does have the > ioctl, then that code can be ifdef'd in, and co-exist with the > functionality of the code that simulates the missing TIOCSERGETLSR ioctl. > Ah, there is the post. Sorry I was on vacation. Hi George, Yes there are systems that have functioning TIOCSERGETLSR for all of their devices. These are machines that just use traditional UARTs. If you mean operating systems, then probably not. Let me explain a bit about the history of those #ifdefs to help clear up a mess. RXTX aims to follow POSIX. TIOCSERGETLSR turns out to not be POSIX at all as I understand. It isn't in BSD, Solaris, AIX or HP-UX. It certainly provides access to important information. I assumed it was standard when I coded rxtx on a Linux system. Ya, laugh. Then I looked at Win32.. Oh you are still laughing? ..I could not navigate msft's web site at the time [still can't really find anything today]. So google pointed me to someones 'reverse documentation' of the w32 API and an example msft put together back in the win3.0 days. It was enough but maybe not 100% correct. They covered overlapped IO which was important for events in rxtx. Looking at Win32 and Linux, it made sense to implement TIOCSERGETLSR for win32 with the way rxtx works. That was how things matched up. But when I got feedback about other systems, it didn't match up. When people used multiport cards with money saving designs in Linux, it didn't match up. And today, there are drivers for unusual serial ports that don't match up. Now we have some ugly logic that mostly works for most serial ports. It isn't right though. The important aspect of TIOSERGETLSR is knowing when the output is really gone. But POSIX tcdrain tells us the same thing. So there is logic in the ifdefs to match that up as you suggest. Perhaps a more formal solution along those lines would be worth looking into. I would suggest the roles should be switched though. We should use POSIX calls on all systems and hide things that don't work on everything like we have with other undocumented calls. TIOSERGETLSR is nice and would be great if it was standard. It isn't as far as I can tell. In the end, many people write Java code because they want portability. The TIOSERGETLSR does not really fit. In someways, this is limiting to the least common denominator which is Solaris if you have seen it's serial kernel driver code. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 15 09:10:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 15 Nov 2007 17:10:59 +0100 Subject: [Rxtx] RXTX blocking on unconnected virtual port Message-ID: <460801A4097E3D4CA04CC64EE648584803919080@ism-mail03.corp.ad.wrs.com> Hello, we came across the following issue: * Set up a virtual serial port, e.g. with com0com: http://com0com.sourceforge.net/ * Connect RXTX to one end, e.g. cnc1a * Do not connect the other end, e.g. cnc1b * Have RXTX write data to the port --> Since the data is not being read, RXTX blocks - RXTXPort.SerialOutputStream.write increases the RXTXPort.IOLocked variable - it then calls the native writeByte or writeArray method (which blocks) closing the RXTXPort hangs for ever too: - RXTXPort.close() has a while( IOLocked > 0 ) {..Thread.sleep(500);...} which spins for ever ==> once the communication hangs, it cannot recover. Has anybody else seen such a problem before, or even got an idea how to solve it? When I connect Hyperterminal to the same half-open port, and type a character, it hangs for about 3 seconds but then times out and is available again. I guess that's what I'd like to see in RXTX as well, with a (configurable) timeout. Our big problem with the current situation is that once RXTX gets stuck, there is nothing at all we can do to make it go live again - that's why our original workaround of writing to the port in a background thread is not good enough. For more background information, the issue is being tracked in https://bugs.eclipse.org/bugs/show_bug.cgi?id=208185 Thanks for any hints or ideas, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Sun Nov 18 09:43:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 09:43:26 -0700 (MST) Subject: [Rxtx] PortInUseException - Cannot close and reopen serial port In-Reply-To: <460801A4097E3D4CA04CC64EE64858480351C711@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858480351C711@ism-mail03.corp.ad.wrs.com> Message-ID: These have been submitted to CVS and the bugzilla entries have been changed to reflect the changes. ChangeLog: find ports which were added after program startup on Mac OS X. Martin Oberhuber http://bugzilla.qbang.org/show_bug.cgi?id=48 Clean up CommPort Ownership code, avoid possible deadlocks, fix lost commport ownership events. http://bugzilla.qbang.org/show_bug.cgi?id=83 Martin Oberhuber On Wed, 24 Oct 2007, Oberhuber, Martin wrote: > 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) > > > > > > > > > > > > > > > From tjarvi at qbang.org Sun Nov 18 09:45:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 09:45:39 -0700 (MST) Subject: [Rxtx] PortInUseException - Cannot close and reopen serial port In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848020CAF26@ism-mail03.corp.ad.wrs.com> Message-ID: The current CVS code should have all the entries. With version information, I usually do not change the version until we tag and release a zip file. Any feedback would be appreciated. On Wed, 27 Jun 2007, Greg Johnson wrote: > 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) >> >> >> >> >> > From tjarvi at qbang.org Sun Nov 18 13:51:27 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 13:51:27 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs Message-ID: The following bugs have been closed and CVS updated as needed: CommPortIdentifier.getPortIdentifier throws NoSuchPortException http://bugzilla.qbang.org/show_bug.cgi?id=48 CommPortOwnership events not sent http://bugzilla.qbang.org/show_bug.cgi?id=83 JVM 1.6 builds http://bugzilla.qbang.org/show_bug.cgi?id=84 I'd like to give Martin Oberhuber CVS write access. He has been doing a great job of pushing safe patches into rxtx. I'll be preparing seperate patches for the changes I have and submitting them to the list. I'll need to work with George to do a couple things: 1) break the patch into smaller pieces to isolate issues for discussion. 2) work through the Line Status Register changes so it does not cause problems on other systems. George: If you could do the first one, it would be greatly appreciated. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Nov 18 15:33:36 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 15:33:36 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: Message-ID: I'm not running any tests at this point, I'm trying to apply the small safe patches and make sure everything is compiling. As mentioned at the bottom, there are 3 patches + the USB fix posted here that need more review before accepting. The following bugs have been closed and CVS updated as needed. Most of these are already in CVS. The diff will be small. configure script failed at line UTS_RELEASE megov http://bugzilla.qbang.org/show_bug.cgi?id=80 code cleanup patch (extra ';' creates bug for if statements + new String() calls removed) Xavier Le Vourch http://bugzilla.qbang.org/show_bug.cgi?id=77 Wont compile on linux ppc with glibc 2.5 - no sys/io.h Brian Johnson http://bugzilla.qbang.org/show_bug.cgi?id=72 rxtx overwrites System properties Andrew Gillett Nektarios K. Papadopoulos Neboj??a http://bugzilla.qbang.org/show_bug.cgi?id=64 Solaris ACM port support Dave Cleal http://bugzilla.qbang.org/show_bug.cgi?id=59 Setting of non-standard baud rate fails. Andrew Prunicki http://bugzilla.qbang.org/show_bug.cgi?id=58 RXTX uses lockfiles on MacOS X (instead of ioctl TIOCEXCL) Joachim Buechse http://bugzilla.qbang.org/show_bug.cgi?id=50 JavaDoc fixes Joachim Buechse http://bugzilla.qbang.org/show_bug.cgi?id=49 I need to further review the following: http://bugzilla.qbang.org/show_bug.cgi?id=53 http://bugzilla.qbang.org/show_bug.cgi?id=46 http://bugzilla.qbang.org/show_bug.cgi?id=41 On Sun, 18 Nov 2007, Trent Jarvi wrote: > > The following bugs have been closed and CVS updated as needed: > > CommPortIdentifier.getPortIdentifier throws NoSuchPortException > http://bugzilla.qbang.org/show_bug.cgi?id=48 > CommPortOwnership events not sent > http://bugzilla.qbang.org/show_bug.cgi?id=83 > JVM 1.6 builds > http://bugzilla.qbang.org/show_bug.cgi?id=84 > > I'd like to give Martin Oberhuber CVS write access. He has been doing a > great job of pushing safe patches into rxtx. > > I'll be preparing seperate patches for the changes I have and submitting > them to the list. > > I'll need to work with George to do a couple things: > > 1) break the patch into smaller pieces to isolate issues for discussion. > 2) work through the Line Status Register changes so it does not cause > problems on other systems. > > George: If you could do the first one, it would be greatly appreciated. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From netbeans at gatworks.com Sun Nov 18 16:20:02 2007 From: netbeans at gatworks.com (U. George) Date: Sun, 18 Nov 2007 18:20:02 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: Message-ID: <4740C8A2.6030908@gatworks.com> > I'll need to work with George to do a couple things: > > 1) break the patch into smaller pieces to isolate issues for discussion. > 2) work through the Line Status Register changes so it does not cause > problems on other systems. > > George: If you could do the first one, it would be greatly appreciated. there are ( probably ) 3 pieces: 1) the select() failure when the USB-serial device is unceremoniously unplugged ( causes rxtx to spin ) 2) TIOCSERGETLSR, need to have the simulation of it available for all os's . If the system has the capability, don't simulate for devices that have the capability. For devices that dont have the capability, but the OS still defines TIOCSERGETLSR, fall back to simulation. 3) I rearranged DEBUG ifdef's. This is probably the bulk of the patches. From tjarvi at qbang.org Sun Nov 18 18:26:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 18:26:26 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <4740C8A2.6030908@gatworks.com> References: <4740C8A2.6030908@gatworks.com> Message-ID: On Sun, 18 Nov 2007, U. George wrote: > >> I'll need to work with George to do a couple things: >> >> 1) break the patch into smaller pieces to isolate issues for discussion. >> 2) work through the Line Status Register changes so it does not cause >> problems on other systems. >> >> George: If you could do the first one, it would be greatly appreciated. > > there are ( probably ) 3 pieces: > 1) the select() failure when the USB-serial device is unceremoniously > unplugged ( causes rxtx to spin ) > 2) TIOCSERGETLSR, need to have the simulation of it available for all os's . > If the system has the capability, don't simulate for devices that have the > capability. For devices that dont have the capability, but the OS still > defines TIOCSERGETLSR, fall back to simulation. > 3) I rearranged DEBUG ifdef's. This is probably the bulk of the patches. > Hi George, I suspect if you do cvs update, there will be very few conflicts if any. While the list of fixes is fairly long, the changes are small. -- Trent Jarvi tjarvi at qbang.org From EdwardRF at xtremax.com Mon Nov 19 03:32:29 2007 From: EdwardRF at xtremax.com (Edward) Date: Mon, 19 Nov 2007 18:32:29 +0800 Subject: [Rxtx] Cannot Read under Windows XP Message-ID: <4741663D.4070200@xtremax.com> Hi Guys, I have a iTegno 3000 usb GSM modem, it is an usb-serial device. I am trying to use RXTX with it under Windows XP. The problem is it seems RXTX cannot read any data from it, but writing to it seems successful. I blindly issue a series of command to send off a SMS, it is successfully delivered, but neither the echo from the modem nor the "OK" response was received. I tried to connect to the modem directly using hyper terminal, there was no problem reading or writing. So can i assume it is not the driver problem? Then i turned to Serial Port Monitor for help, when I use hyper terminal, monitor shows both way traffic, and nothing abnormal, but when I connect using RXTX, only the data I sent to the modem is being detected, no input was detected. Does anyone else experience similar problem? Best Regards Edward From tjarvi at qbang.org Mon Nov 19 03:38:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Nov 2007 03:38:02 -0700 (MST) Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: <4741663D.4070200@xtremax.com> References: <4741663D.4070200@xtremax.com> Message-ID: On Mon, 19 Nov 2007, Edward wrote: > Hi Guys, > > I have a iTegno 3000 usb GSM modem, it is an usb-serial device. I am > trying to use RXTX with it under Windows XP. > The problem is it seems RXTX cannot read any data from it, but writing > to it seems successful. I blindly issue a series of command to send off > a SMS, it is successfully delivered, but neither the echo from the modem > nor the "OK" response was received. > > I tried to connect to the modem directly using hyper terminal, there was > no problem reading or writing. So can i assume it is not the driver problem? > > Then i turned to Serial Port Monitor for help, when I use hyper > terminal, monitor shows both way traffic, and nothing abnormal, but when > I connect using RXTX, only the data I sent to the modem is being > detected, no input was detected. > > Does anyone else experience similar problem? > Hi Edward, A common mistake is to send Strings to the modem which are i18n. You want to send the bytes. Examples of doing this are in the contrib directory with the sourcecode. ie SimpleSnuV1.java -- Trent Jarvi tjarvi at qbang.org From EdwardRF at xtremax.com Mon Nov 19 04:42:16 2007 From: EdwardRF at xtremax.com (Edward) Date: Mon, 19 Nov 2007 19:42:16 +0800 Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: References: <4741663D.4070200@xtremax.com> Message-ID: <47417698.3060705@xtremax.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071119/b0f08ba9/attachment.html From netbeans at gatworks.com Mon Nov 19 06:31:30 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 19 Nov 2007 08:31:30 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: <4740C8A2.6030908@gatworks.com> Message-ID: <47419032.8080406@gatworks.com> Did the "make install". The install does not want to go to or use Makefiles's prefix = /usr/local/rxtx-devel Not terribly happy that it installed in /home/gat/JAVA/JDK14/j2sdk1.4.2_08/jre/lib/i386 Trent Jarvi wrote: > > I suspect if you do cvs update, there will be very few conflicts if any. > While the list of fixes is fairly long, the changes are small. > > -- > Trent Jarvi > tjarvi at qbang.org > > From Martin.Oberhuber at windriver.com Mon Nov 19 07:00:48 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 19 Nov 2007 15:00:48 +0100 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE6485848039986E6@ism-mail03.corp.ad.wrs.com> It's great to see things progressing - thanks Trent! I checked CVS, and it seems that most of the patch authors are yet missing from the AUTHORS file, is this intentional? The issues areound RXTXPort.close() are interesting for us in the context of Eclipse as well: https://bugs.eclipse.org/bugs/show_bug.cgi?id=208185#c3 I did a quick review and found some issues / comments: http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 http://bugzilla.qbang.org/show_bug.cgi?id=53#c9 Thanks for proposing CVS write access for me. I promise to use these thoughtfully, and discuss potential fixes openly (on bugzilla) before applying them [unless it's really trivial issues only like obvious Javadoc syntax or spelling errors]. Cheers, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From keithvz at verizon.net Thu Nov 1 08:08:58 2007 From: keithvz at verizon.net (Keith) Date: Thu, 01 Nov 2007 10:08:58 -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: <4729DDFA.7080206@verizon.net> Trent Jarvi wrote: > 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? Well, I honestly don't know how all this fits together. I think it's just a matter of enabling the right flow control option within the standard serial framework to tell the device driver, "HEY START USING DTR/DSR FOR FLOW CONTROL." If what UGeorge said,(about that type of nitty-gritty lead control being done within the device driver), is true, then this confirms my suspicion. I tried narrowing down within the Linux drivers what you are looking for, but I can't entirely tell wth I'm looking at. (virtual com port drivers -- they are included compiled by default with Ubuntu, source included) http://www.ftdichip.com/Drivers/VCP/Linux/ftdi_sio.tar.gz Hahahaa, they make a reference to DTR flow control being supported but say (UGH) in parenthesis. You can also use their direct device driver library on Ubuntu -- libftd2xx.so.0.4.13. No source code. http://www.ftdichip.com/Drivers/D2XX/Linux/libftd2xx0.4.13.tar.gz In that case, you make a call to their FT_SetFlowControl() function. FT_STATUS FT_SetFlowControl (FT_HANDLE ftHandle, USHORT usFlowControl, UCHAR uXon,UCHAR uXoff) Parameters ftHandle Handle of the device. usFlowControl Must be one of FT_FLOW_NONE, FT_FLOW_RTS_CTS, ****FT_FLOW_DTR_DSR**** or FT_FLOW_XON_XOFF. uXon Character used to signal Xon. Only used if flow control is FT_FLOW_XON_XOFF. uXoff Character used to signal Xoff. Only used if flow control is FT_FLOW_XON_XOFF. This is from their programming guide http://www.ftdichip.com/Documents/ProgramGuides/D2XXPG34.pdf I actually want to take this a step further and say that I think the flow control is actually handled right on the device itself in hardware/firmware. It's enabled through the device driver, but I think the maintaining of buffers, asserting/deasserting of leads, etc is handled by the device. For the time being, I've switched to jd2xx, https://jd2xx.dev.java.net/ and http://bleyer.org/jd2xx/ These are Java wrappers for the device driver libraries. It allows almost direct access to the well-documented device drivers from Java. I hope this helps Keith From tjarvi at qbang.org Thu Nov 1 11:09:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:09:51 -0600 (MDT) 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: Hi Martin, What I usually have done is allow changes that do not impact working software including changes to methods not documented in CommAPI (which remain undocumented in rxtx) and fixes to known problems in the documented portions. That way if you use the documented API, the releases should only become better with time. If you use the undocumented portions, the behavior is not as predictable but open for improvement. On Wed, 31 Oct 2007, 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 >> > From tjarvi at qbang.org Thu Nov 1 11:15:52 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:15:52 -0600 (MDT) 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: I too use rxtx in commercial products. The problem I've been trying to address while bringing the server back was how to make it possible for hobby folks to build the same software as companies so we can move rxtx along a little faster. Exposing internal tools is not an option at this time, the public rxtx builds have been done on my home machine which has drives hanging out of it all over the place dying one at a time. This isn't maintainable. I'm currently looking at the possibility of making an S3 image available on Amazon's EC. These are machines you can rent for ~10 cents an hour which is more than enough to build rxtx. The S3 image is not changed when people use it so everyone has the same starting point. With this, we could all build rxtx for ~20 platforms for a small price and eliminate tool issues. On Wed, 31 Oct 2007, Greg Johnson wrote: > 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 tjarvi at qbang.org Thu Nov 1 11:19:55 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:19:55 -0600 (MDT) 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: On Wed, 31 Oct 2007, 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. I was helping Dmitry do the Mac OS X port without access to a machine when we put that in. In the archives there is information (easily found with google on Apple's site) that describes how their API (and others) can determine if a port is used and ignore it. I think these changes are in CVS but need to confirm. The bottom line is that rxtx should not have used lock files on Mac. It was just ignorance of the system on my part. -- Trent Jarvi tjarvi at qbang.org From fabioanjos at gmail.com Thu Nov 1 12:35:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Thu, 1 Nov 2007 15:35:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Hi, I was using SerialEventListener in my project. But, as was said here, id doesnt work very well with virtual serial ports. So, I changed the strategy using the code posted here in this thread: try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > 0) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } The thing is that in my tests I could notice that in.read(buffer) never blocks. Even when there's nothing to read. Instead of blocking when there's nothing to read it returns 0. So, my questions are: 1. Am I doing something wrong? 2. If not, wouldnt this decrease performance? (the thread would be locked in a loop that does nothing.) 3. Is there a better way to do the job? Thanks in advance!! F?bio -------- On 10/31/07, Andre-John Mas wrote: > > > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/0aee59d0/attachment-0019.html From ajmas at sympatico.ca Thu Nov 1 16:07:55 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Nov 2007 18:07:55 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Message-ID: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From sarah_662005 at yahoo.com Thu Nov 1 17:10:05 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Thu, 1 Nov 2007 16:10:05 -0700 (PDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Message-ID: <351433.37166.qm@web55814.mail.re3.yahoo.com> Thank you very much for your help. Now the application works fine. the serialEvent gets triggered. Rxtx is cool! ----- Original Message ---- From: Andre-John Mas To: Sara Hugh ; RXTX Developers and Users Sent: Wednesday, October 31, 2007 9:55:45 AM Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered 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 __________________________________________________ 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/20071101/4a86bea6/attachment-0019.html From tjarvi at qbang.org Thu Nov 1 17:58:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 17:58:02 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx Message-ID: The rxtx.org site is primarily interested in the hobby aspects of rxtx. Obviously, there are some companies following the work too. These interests bring larger workflows and concerns about details hobby folks may not care about. They also bring many more users. I know the company I work for has a quality engineering effort going on which includes rxtx. While the server was down, I was contacted by another company that was missing the binaries for their testing. Several people have mentioned concerns about a stable release for like reasons. Would there be interest on the quality side of the coin to get together? It could be just sharing email's with each other or a seperate list for QE/QA. I can not say for sure, but we may be able to share some of our efforts/results that could help keep rxtx releases stable. -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Fri Nov 2 01:42:55 2007 From: scldad at sdc.com.au (Stephen Davies) Date: Fri, 2 Nov 2007 18:12:55 +1030 Subject: [Rxtx] Multiple modems Message-ID: <200711021812.56047.scldad@sdc.com.au> This may or may not be related to the Multiple Ports thread. I have an application which uses rxtx on Linux (via cron jobs) to connect multiple modems to remote sensing devices. The application works fine most of the time but occasionally fails to connect if two (or more) connection attempts happen at about the same time. When it fails, it looks as if it may get confused as to which port it is talking to. The app has a "base" component that looks for an available port, opens it and then creates an input thread and an output thread for the connection and data transfer. The "base" component uses this code: // loop round all known ports until one is available. Give up after three minutes Counter ptimeout = new Counter(); while(!portFound && ptimeout.elapsed() < 180000) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // special case. ttyS0 is not available to us on this server. if (!portId.isCurrentlyOwned() && !portId.getName().equals("/dev/ttyS0")) { gLog.debug(lognm + ": Found port " + portId.getName()); try { serialPort = (RXTXPort) portId.open("AguaModem", 10000); } catch (Exception e) { gLog.error(lognm + ": Port " + portId.getName() + " will not open."); gLog.error(e.getMessage()); continue; } AguaModem aguamodem = new AguaModem(); portFound = true; break; } gLog.debug(lognm + ": Port " + portId.getName() + " is busy"); } } } I am wondering about the isCurrentlyOwned method. Does this actually tell me whether a port is currently being used by another process? TIA, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From fabioanjos at gmail.com Fri Nov 2 04:59:58 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 07:59:58 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Message-ID: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/9009eb1d/attachment-0019.html From netbeans at gatworks.com Fri Nov 2 06:28:13 2007 From: netbeans at gatworks.com (U. George) Date: Fri, 02 Nov 2007 08:28:13 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <472B17DD.1050508@gatworks.com> It should normally block ( unless eof / event ) . so its a :{ whats the device ( to recreate if possible ) and how do u open. > My question is, is there a way to make in.read block the thead until > there's something to read? > From fabioanjos at gmail.com Fri Nov 2 06:34:46 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 09:34:46 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > On 11/1/07, Andre-John Mas wrote: > > > > Fabio, > > > > Turns out there was a small error in my example. The test should be: > > > > (numBytes = in.read(buffer)) > -1 > > > > This is because -1 indicates an end of file (end of data stream) > > > > Andre > > > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > > > Hi, > > > > > > I was using SerialEventListener in my project. But, as was said > > > here, id doesnt work very well with virtual serial ports. > > > So, I changed the strategy using the code posted here in this thread: > > > > > > try{ > > > in = port.getInputStream(); > > > out = port.getOutputStream(); > > > int numBytes = 0; > > > while(active){ > > > > > > byte[] buffer = new byte[10]; > > > > > > while ( (numBytes = in.read(buffer)) > 0) > > > { > > > String dataValue = new String(buffer,0,numBytes); > > > processInput(dataValue); > > > } > > > > > > if(numBytes==-1){ > > > break; > > > } > > > > > > Thread.sleep(50); > > > } > > > > > > }catch(IOException e){ > > > logger.info("falha de comunicacao "+ > > > getReceptor().getPort() ); > > > > > > }catch(InterruptedException e){ > > > logger.info ("Interrompendo leitura da porta "+ > > > getReceptor().getPort() ); > > > } > > > > > > The thing is that in my tests I could notice that in.read(buffer) > > > never blocks. Even when there's nothing to read. Instead of blocking > > > when there's nothing to read it returns 0. > > > > > > So, my questions are: > > > > > > 1. Am I doing something wrong? > > > 2. If not, wouldnt this decrease performance? (the thread would be > > > locked in a loop that does nothing.) > > > 3. Is there a better way to do the job? > > > > > > Thanks in advance!! > > > > > > F?bio > > > -------- > > > > > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > > 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 > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > > > > > -- > > > Atenciosamente, > > > F?bio Cristiano dos Anjos > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/5306c4b1/attachment-0019.html From nick.circelli at infrasafe.com Fri Nov 2 07:01:17 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Fri, 2 Nov 2007 08:01:17 -0500 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com><29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com><90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca><29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Message-ID: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> I'm pretty sure that not blocking has to do with you virtual ports. Cause it should block. Maybe you should try: while ((numBytes = in.available()) > 0) { If (numBytes > buffer.length) { numBytes = buffer.length; // in case you have buffer overflow } numBytes = in.read(buffer, 0 , numBytes)); String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } Also, just for optimization, I'd move that byte[] buffer = new byte[10]; out of the while since you don't need to reallocate it every iteration. ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of F?bio Cristiano dos Anjos Sent: Friday, November 02, 2007 8:35 AM To: RXTX Developers and Users Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream (); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas < ajmas at sympatico.ca > wrote: Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info ("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Atenciosamente, F?bio Cristiano dos Anjos -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/4de7f6a3/attachment-0019.html From fabioanjos at gmail.com Fri Nov 2 07:36:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 10:36:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> Message-ID: <29788b250711020636q1588c88fgaa5e27f5504164fb@mail.gmail.com> Hi Nick, Actually, it doesnt block for physical ports too. And, the method avaiable does not block either, so when there's nothing avaiable the loop ends and the thread stops lintening to the port. But I did some more test with serialEventListener, and now its working. I realy dont know what I've done to get it working. I just start woking as soon as I decided to test it again. It was said here that serialEventListener is not reliable for virtual serial ports. Is there another way to read it, without compromising performance? Tanks again!! F?bio ------- On 11/2/07, Nick Circelli wrote: > > I'm pretty sure that not blocking has to do with you virtual ports. > Cause it should block. > > Maybe you should try: > > > > while ((numBytes = in.available()) > 0) > > { > > If (numBytes > buffer.length) { > > numBytes = buffer.length; // in case you have buffer overflow > > } > > numBytes = in.read(buffer, 0 , numBytes)); > > String dataValue = new String(buffer,0,numBytes,"ASCII"); > > processInput(dataValue); > > } > > > > Also, just for optimization, I'd move that byte[] buffer = new > byte[10]; > > out of the while since you don't need to reallocate it every iteration. > > > ------------------------------ > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On Behalf > Of *F?bio Cristiano dos Anjos > *Sent:* Friday, November 02, 2007 8:35 AM > *To:* RXTX Developers and Users > *Subject:* Re: [Rxtx] serialEvent(SerialPortEvent event) never be > triggered > > > > Hi, > > I think i missunderstand something here. > The code you post here was meant to be used inside serialEvent method, > right? > > The think is, that i cannot user SerialEventListener to read serial ports, > because i need to read virual serial ports and id does not behaves well, as > said here before. serialEvent is never triggered. > > So what I quit using SerialEventListener and created a thread to listen to > the port: > > public void run(){ > try{ > in = port.getInputStream(); > out = port.getOutputStream (); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new > String(buffer,0,numBytes,"ASCII"); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ getReceptor().getPort() > ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > } > > > So, the problem is that in.read(buffer) always returns 0 when there is > nothing to read, instead of blocking the flow, and the thread becames locked > in the loop. > > I hope you can help me solve this. > > Thanks in advance! > > F?bio > -------- > > On 11/2/07, *F?bio Cristiano dos Anjos* wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > > > On 11/1/07, *Andre-John Mas* < ajmas at sympatico.ca> wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info ("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/571df6ea/attachment-0018.html From tjarvi at qbang.org Fri Nov 2 08:32:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Nov 2007 08:32:15 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: References: Message-ID: On Fri, 2 Nov 2007, Greg Johnson wrote: > Hi Trent, folks, > Having a single rxtx that is suitable for commercial uses and hobbyists both > would be a great idea? Perhaps it would be worth submitting rxtx as a > proposal to Codehaus - they not only provide excellent tools (Jira (bug > tracker), Confluence (wiki)) but also support build management ( > maestro, continuum, bamboo). Relying on your personal machine (btw, frii.com > / rxtx.org is down again?) seems like a burden you shouldn't have to shoulder > alone. Hi Greg, There may be a little confusion here. There is no need to have two seperate rxtx releases. What I'm trying to encourage is a discussion between some of the people responsible for making sure rxtx does not break their products each release. Usually these people are interested in testing a set of functionality their product depends upon. They do not work with rxtx code but rather traps to catch when rxtx developers break something. This goes on all the time in isolated labs. There are many services that offer to do various pieces of a project for you if you... Anyone is free to do the 'if you' portion with rxtx and see how it goes. I'm actually interested in doing less of that than more. The rxtx.org work I do just happens to overlap with other things I do for personal/family use. The reason I suggest the amazon solution is that anyone can take full control of the environment for a day and it costs less than a package of gum without causing harm to what anyone else is doing. I assume the down question was with respect to a mod_security setting that has been resolved. If not, please post a url to the problem. -- Trent Jarvi tjarvi at qbang.org From nsayer at kfu.com Sat Nov 3 20:17:49 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 19:17:49 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? Message-ID: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Has anyone got RXTX working with an app under Leopard? My app hangs on port open (it works fine with Tiger). The relevant thread looks like this in the activity monitor: 1536 JVM_InvokeMethod 1536 0x48ccd0 1536 0x46f8a0 1536 0x4c3ff4 1536 0x4c4284 1536 0x357d160 1536 0x357faac 1536 Java_gnu_io_RXTXPort_open 1536 open $NOCANCEL$UNIX2003 1536 open $NOCANCEL$UNIX2003 From ajmas at sympatico.ca Sat Nov 3 22:02:04 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 00:02:04 -0400 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> RXTX works for me with Leopard. I am currently using it communicate with a Bluetooth GPS. What computer and device are you trying to use? Is the driver for your serial device compatible with MacOS X 10.5? Andre On 3-Nov-07, at 22:17 , Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From nsayer at kfu.com Sat Nov 3 22:17:47 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 21:17:47 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> Message-ID: <1720F723-3643-438C-B3AB-E09A67536977@kfu.com> On Nov 3, 2007, at 9:02 PM, Andre-John Mas wrote: > RXTX works for me with Leopard. I am currently using it communicate > with a Bluetooth GPS. > > What computer and device are you trying to use? Is the driver for > your serial device compatible with MacOS X 10.5? An Intel mac mini The FTDI USB serial driver an XMPCR, which is just a fancy serial controlled radio and an FTDI usb-to-serial chip I've successfully used the FTDI driver with another FTDI device in another context. > > > Andre > > On 3-Nov-07, at 22:17 , Nick Sayer wrote: > >> Has anyone got RXTX working with an app under Leopard? >> >> My app hangs on port open (it works fine with Tiger). The relevant >> thread looks like this in the activity monitor: >> >> 1536 JVM_InvokeMethod >> 1536 0x48ccd0 >> 1536 0x46f8a0 >> 1536 0x4c3ff4 >> 1536 0x4c4284 >> 1536 0x357d160 >> 1536 0x357faac >> 1536 >> Java_gnu_io_RXTXPort_open >> 1536 open >> $NOCANCEL$UNIX2003 >> 1536 open >> $NOCANCEL$UNIX2003 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From racecar at gmail.com Sat Nov 3 22:25:53 2007 From: racecar at gmail.com (Kevin Mateo Lim) Date: Sat, 3 Nov 2007 21:25:53 -0700 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: Message-ID: I am alternating between two errors. After i run the macosx_setup.command, "everyone" is set to Read only in /var/lock. I notice in the terminal that the group for these perms is _uucp, not uucp. In that state, I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 check_group_uucp(): error testing lock file creation Error details:Permission deniedcheck_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException : Error inside Serial.() at processing.serial.Serial.errorMessage(Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.( Serial.java:102) at Temporary_829_3245.setup(Temporary_829_3245.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java :690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) Then, I hand edit the "everyone" permissions for /var/lock/ to Read and Write (note /var/spool/uucp is Read/Write in all cases, and doesn't change). I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX uucp_lock() /var/lock/LK.003.009.000 is there gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException: Error inside Serial.() at processing.serial.Serial.errorMessage (Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.(Serial.java:102) at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java:690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) See here: http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071103/f1a2c467/attachment-0017.html From greg.johnson at manchester.ac.uk Sun Nov 4 02:31:13 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sun, 4 Nov 2007 10:31:13 +0100 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <28B5E0A0-0802-4C74-AC21-87ED35F3B9A2@manchester.ac.uk> Hi Nick, I also had problems initially with Leopard, but it was resolved by reinstalling the serial USB driver (FTDI in my case). The symptoms were a non-detection of any ports (but I twigged when I tried ZTerm and it had the same problem). Good luck! Cheers, greg PS I did a "Archive and install" which may be the reason my FTDI driver had disappeared - I don't think the driver has changed for 10.5 ------------------------------------------------------------------------- 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 4 Nov 2007, at 03:17, Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Sun Nov 4 13:01:12 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 15:01:12 -0500 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: Message-ID: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Hi, You will need to get the 2.1-8 code from CVS. See the FAQ for more information: http://rxtx.qbang.org/wiki/index.php/FAQ Andre On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > I am alternating between two errors. > > After i run the macosx_setup.command, "everyone" is set to Read only > in /var/lock. I notice in the terminal that the group for these > perms is _uucp, not uucp. > > In that state, I get this error: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > check_group_uucp(): error testing lock file creation Error > details:Permission deniedcheck_lock_status: No permission to create > lock file. > please see: How can I use Lock Files with rxtx? in INSTALL > gnu.io.PortInUseException: Unknown Application > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > java.lang.RuntimeException : Error inside Serial.() > > at processing.serial.Serial.errorMessage(Serial.java:583) > > at processing.serial.Serial.(Serial.java:148) > > at processing.serial.Serial.( Serial.java:102) > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > at processing.core.PApplet.run(PApplet.java:1556) > > at java.lang.Thread.run(Thread.java:613) > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > and Write (note /var/spool/uucp is Read/Write in all cases, and > doesn't change). I get this error: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > gnu.io.PortInUseException: Unknown Application > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > java.lang.RuntimeException: Error inside Serial.() > > at processing.serial.Serial.errorMessage (Serial.java:583) > > at processing.serial.Serial.(Serial.java:148) > > at processing.serial.Serial.(Serial.java:102) > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > at processing.core.PApplet.run(PApplet.java:1556) > > at java.lang.Thread.run(Thread.java:613) > > See here: > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From netbeans at gatworks.com Sun Nov 4 14:33:35 2007 From: netbeans at gatworks.com (U. George) Date: Sun, 04 Nov 2007 16:33:35 -0500 Subject: [Rxtx] #ifndef TIOCSERGETLSR Message-ID: <472E3AAF.7050709@gatworks.com> For Linux, it seems that you need the code for both *having* a TIOCSERGETLSR, and *not having* a TIOCSERGETLSR. Maybe the ioctl exists system wide, but not necessarily for the device driver itself ( always returns -1 ) . Are there systems that have a *functioning* TIOCSERGETLSR for all their devices? Then this would be the case where the "#ifndef TIOCSERGETLSR" directive could be useful is eliminating the unnecessary code and tests. And for those systems that dont have a TIOCSERGETLSR, then the code for TIOCSERGETLSR can be eliminated. It would be a simple case to have, as a foundation, all the code to simulate the missing TIOCSERGETLSR ioctl. If the system does have the ioctl, then that code can be ifdef'd in, and co-exist with the functionality of the code that simulates the missing TIOCSERGETLSR ioctl. From racecar at gmail.com Sun Nov 4 17:30:19 2007 From: racecar at gmail.com (Kevin Mateo Lim) Date: Sun, 4 Nov 2007 17:30:19 -0700 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: the README.OSX reads: Put libSerial.jnilib in the directory of the application (the JavaVM will find it there). Add RXTXComm.jar to the application classpath or include the classes in the application jar. (Some applications already include the RXTX classes in their application jar, in which case only the file libSerial.jnilib is required). I can't find libSerial.jnilib I put librxtxSerial.jnilib into my Processing /libraries/serial/library/ directory. Yet it still sees the old version: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 On 11/4/07, Andre-John Mas wrote: > > Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > 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/20071104/c0a83f91/attachment-0016.html From ajmas at sympatico.ca Sun Nov 4 17:41:47 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 19:41:47 -0500 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> If you are wanting it to be available for all applications, - for all users: /Library/Java/Extensions - for your user: ~/Library/Java/Extensions Or just for your application, then it should be in the same directory from which yo are launching your application. If you are getting the 2.1-8 source, then the library built is called: librxtxSerial.jnilib despite what the docs say. Andre On 4-Nov-07, at 19:30 , Kevin Mateo Lim wrote: > > the README.OSX reads: > Put > libSerial.jnilib > in the directory of the application (the JavaVM will find it there). > Add > RXTXComm.jar > to the application classpath or include the classes in the > application jar. > (Some applications already include the RXTX classes in their > application jar, > in which case only the file libSerial.jnilib is required). > > > I can't find libSerial.jnilib > I put librxtxSerial.jnilib into my Processing /libraries/serial/ > library/ directory. > > Yet it still sees the old version: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > On 11/4/07, Andre-John Mas wrote: Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial .(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay (PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > From bschlining at gmail.com Sun Nov 4 19:46:23 2007 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 4 Nov 2007 18:46:23 -0800 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> Message-ID: > > Or just for your application, then it should be in the same directory > from which yo are launching your application. Just wanted to add one more way of specifying the native lib location... If you don't want to define it globally by putting it in /Library/Java/Extensions (and you don't, it's a very very bad practice) you can also specify the location of the native library when starting the JVM by specifying the 'java.library.path' property. For example: java -Djava.library.path=/Path/To/Directory/With/RXTX/Library YourMainClass -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071104/c5af6980/attachment-0016.html From greg.johnson at manchester.ac.uk Mon Nov 5 01:39:02 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Mon, 5 Nov 2007 09:39:02 +0100 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: The 2.1-8 code reports 2.1-7, hence your (and my) confusion. But as long as you've removed all traces of the old library, it really _is_ 2.1-8. And if you specify the library path to the VM, don't make my mistake (on OSX at least) - you need to respecify the entire library path it had by default, as the command line argument replaces the path, rather than appending to it. 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 5 Nov 2007, at 01:30, Kevin Mateo Lim wrote: > > the README.OSX reads: > Put > libSerial.jnilib > in the directory of the application (the JavaVM will find it there). > Add > RXTXComm.jar > to the application classpath or include the classes in the > application jar. > (Some applications already include the RXTX classes in their > application jar, > in which case only the file libSerial.jnilib is required). > > > I can't find libSerial.jnilib > I put librxtxSerial.jnilib into my Processing /libraries/serial/ > library/ directory. > > Yet it still sees the old version: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > On 11/4/07, Andre-John Mas wrote: > Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial .(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay (PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > 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 HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071105/7f50506d/attachment-0016.html From cyrille.dumont at tatexpress.fr Mon Nov 5 05:46:03 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 05 Nov 2007 13:46:03 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: References: <472727F1.1000704@tatexpress.fr> Message-ID: <472F108B.2090101@tatexpress.fr> Thanks a lot for your solution ... but I'm not a expert in JAVA ... (sorry) For the moment I've this function : """ public void serialEvent(SerialPortEvent e) { StringBuffer inputBuffer = new StringBuffer(); int newData = 0; switch (e.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } //-- Manag. Data from Scanner this.MngDataScanner(inputBuffer.toString()); break; case SerialPortEvent.BI:; //-- Break Received } } """ How can I do what you write ? ( maybe a simple ex ? ) PS : I don't know the PDF417 size (could be, for example, 338 char, or 500 ... ; what I know is that it can't be more than 800 char) Thanks in advance. Best regards. Trent Jarvi a ?crit : > 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 Martin.Oberhuber at windriver.com Mon Nov 5 08:47:50 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 5 Nov 2007 16:47:50 +0100 Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> Hi Trent, are the interestes of hobbyists really so different from commercial ones? Both should be interested in high quality and innovation the like. I haven't seen too many Open Source projects from the "inside" but those that I have seen did not have separate mailing lists for quality/testing/qa versus innovation/development. What I have seen with the Open Source projects that one would call "successful" is a good deal of process around automated builds, automated unit tests, predictable release dates and milestones, and policies around commiting/contributing/reviewing changes. I think that all of these benefit commercial users and hobbyists the like. If you were just asking about who's interested in discussing changes to foster more quality, count me in. I'm just not sure whether discussing these on a separate mailing list or other channel is the right thing to do. Cheers, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From toupsz at cs.tamu.edu Tue Nov 6 14:27:04 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 15:27:04 -0600 Subject: [Rxtx] reading TTL level signals from serial? Message-ID: Dear RXTX community- I've been using RXTX to handle communicating with several hardware devices in Java (a GPS and some custom audio circuitry for my dissertation work). I have a new, high-accuracy GPS which only communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there any way to communicate with this device using RXTX, perhaps by modding the native code for Windows? If so, does anyone have any tips on how to do it? Has it perhaps already been done? Another option is for me to invert / amplify the signal in hardware, but this is difficult for me to pull off due to the sensitivity of the electronics involved...I'll likely end up using a much less accurate piece of equipment rather than go that far! If anyone could help out, I'd really appreciate it! Thanks! -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/b6c59c2b/attachment-0014.html From netbeans at gatworks.com Tue Nov 6 14:55:22 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 06 Nov 2007 16:55:22 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: Message-ID: <4730E2CA.3090009@gatworks.com> This is really a hardware issue. Is there any device ( ie the serial port ) on your computer that will accept the voltage signals ( and load ) that your device produces? Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it happen safely ( ie u dont cook the GPS device ) I have a new, high-accuracy GPS which only > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there > any way to communicate with this device using RXTX, From toupsz at cs.tamu.edu Tue Nov 6 15:14:01 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 16:14:01 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4730E2CA.3090009@gatworks.com> References: <4730E2CA.3090009@gatworks.com> Message-ID: Actually, the device runs over USB, but shows up as a virtual serial port and is outputting these signals. The software that comes with the device (a u-blox ANTARIS 4 eval kit) is able to communicate. RXTX is able to detect and properly configure the port, but does not get any of the data from it. :-/ It seems like there must be some way to do it (obviously, ublox knows how)... -Zach On Nov 6, 2007 3:55 PM, U. George wrote: > This is really a hardware issue. > Is there any device ( ie the serial port ) on your computer that will > accept the voltage signals ( and load ) that your device produces? > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it > happen safely ( ie u dont cook the GPS device ) > > > I have a new, high-accuracy GPS which only > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there > > any way to communicate with this device using RXTX, > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/15ae7a0b/attachment-0014.html From keithvz at verizon.net Tue Nov 6 16:16:55 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 06 Nov 2007 18:16:55 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> Message-ID: <4730F5E7.1030704@verizon.net> Zach Toups wrote: > On Nov 6, 2007 3:55 PM, U. George > wrote: > > This is really a hardware issue. > Is there any device ( ie the serial port ) on your computer that will > accept the voltage signals ( and load ) that your device produces? > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it > happen safely ( ie u dont cook the GPS device ) > > > I have a new, high-accuracy GPS which only > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is > there > > any way to communicate with this device using RXTX, > _______________________________________________ As UGeorge intimated, it's a hardware issue. If your device outputs TTL level voltages, and your USB to serial converter is RS-232, then you've got a physical hardware differences. Inverted leads and voltage issues are mainly the problem. MAXIM makes a neat little chip called the MAX233 (better than the 232, no extern caps required) You can't solve this in software. Now, there are TTL level compatible USB to serial converters available, I happen to be using one right now. This unit below is from a UK company (there might be sources in the US) http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm Parallax makes one that does 3.3 and 5v http://www.parallax.com/detail.asp?product_id=32201 (but only supports RX, TX, GND, AND DTR towards device) (i've tested a variant of the unit above, and it works with RXTX) In both cases, you'll need some creative wiring depending on the interface on your GPS. Hope this helps Keith From toupsz at cs.tamu.edu Tue Nov 6 16:53:01 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 17:53:01 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4730F5E7.1030704@verizon.net> References: <4730E2CA.3090009@gatworks.com> <4730F5E7.1030704@verizon.net> Message-ID: Yeah...I used an FTDI chip to handle USB/serial conversion on the audio equipment I built. I'm leery of trying to build a board for this ublox GPS due to all the grounding/shielding issues around it. Anyway, I apreciate the help...just sad that I can't handle the problem in software! Ublox did send me the source code for their USB drivers...but as a Java programmer, it's a bit tough for me to sort out. ;) Thanks again! -Zach On Nov 6, 2007 5:16 PM, Keith Monahan wrote: > Zach Toups wrote: > > > On Nov 6, 2007 3:55 PM, U. George > > wrote: > > > > This is really a hardware issue. > > Is there any device ( ie the serial port ) on your computer that > will > > accept the voltage signals ( and load ) that your device produces? > > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make > it > > happen safely ( ie u dont cook the GPS device ) > > > > > > I have a new, high-accuracy GPS which only > > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is > > there > > > any way to communicate with this device using RXTX, > > _______________________________________________ > > As UGeorge intimated, it's a hardware issue. > > If your device outputs TTL level voltages, and your USB to serial > converter is RS-232, then you've got a physical hardware differences. > Inverted leads and voltage issues are mainly the problem. MAXIM makes a > neat little chip called the MAX233 (better than the 232, no extern caps > required) > > You can't solve this in software. > > Now, there are TTL level compatible USB to serial converters available, > I happen to be using one right now. > > This unit below is from a UK company (there might be sources in the US) > > http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm > > Parallax makes one that does 3.3 and 5v > > http://www.parallax.com/detail.asp?product_id=32201 > (but only supports RX, TX, GND, AND DTR towards device) > > (i've tested a variant of the unit above, and it works with RXTX) > > In both cases, you'll need some creative wiring depending on the > interface on your GPS. > > Hope this helps > > Keith > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/06e88ad4/attachment-0014.html From netbeans at gatworks.com Tue Nov 6 17:14:01 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 06 Nov 2007 19:14:01 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> <4730F5E7.1030704@verizon.net> Message-ID: <47310349.5000406@gatworks.com> what gps chipset do u have? > Ublox did send me the source code for their USB drivers...but as a Java > programmer, it's a bit tough for me to sort out. ;) From Steffen.DETTMER at ingenico.com Wed Nov 7 03:10:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 7 Nov 2007 11:10:01 +0100 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> Message-ID: <20071107101000.GN10978@elberon.bln.de.ingenico.com> * Zach Toups wrote on Tue, Nov 06, 2007 at 16:14 -0600: > Actually, the device runs over USB, but shows up as a virtual > serial port and is outputting these signals. Ahh, so what you want is to use rxtx on the serial port that is created by the driver and mapped maybe as some COM8 or whatever? I this case then IMHO it would be no hardware question but maybe a problem in your application, or some driver or indeed a rxtx issue. > The software that > comes with the device (a u-blox ANTARIS 4 eval kit) is able to > communicate. Is it sure that this software is really using the virtual serial port and only this port? oki, Steffen -- About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Wed Nov 7 04:59:10 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 06:59:10 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <20071107101000.GN10978@elberon.bln.de.ingenico.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> Message-ID: <4731A88E.6080705@gatworks.com> >> The software that >> comes with the device (a u-blox ANTARIS 4 eval kit) is able to >> communicate. > > Is it sure that this software is really using the virtual serial > port and only this port? > I have tried to read the docs. I have yet to find any explanation on a (windoz) device driver for this device ( the usb device ). That magic is not explained. For a developer thats important magic. Maybe a call to their support team is in order? From netbeans at gatworks.com Wed Nov 7 05:01:38 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 07:01:38 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <20071107101000.GN10978@elberon.bln.de.ingenico.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> Message-ID: <4731A922.7@gatworks.com> Steffen DETTMER wrote: > * Zach Toups wrote on Tue, Nov 06, 2007 at 16:14 -0600: >> Actually, the device runs over USB, but shows up as a virtual BTW: it seems that I am not getting all the Rxtx mail. Is there still a problem? From toupsz at cs.tamu.edu Wed Nov 7 07:36:20 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Wed, 7 Nov 2007 08:36:20 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4731A88E.6080705@gatworks.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> <4731A88E.6080705@gatworks.com> Message-ID: When I emailed them about this issue, they sent me their WinCE drivers, which are apparently based on this open source driver: http://www.yetanotherhomepage.com/j7xx/j7xx.html?/j7xx/software/util/usbdriver.html These include srcdll, and x86 subfolders, though it's not 100% clear to me that these are useful. The ublox communication suite appears to only communicate with serial ports...I've communicated with the ublox on two different comm ports (one with the serial adapter plugged into the serial port, one with the main USB connection), as well as a Garmin bluetooth GPS (which comes up as a bluetooth serial device). I'm not well versed in code this close to the hardware, but it seems to me that if you're running a virtual serial port, then you're virtually controlling the "voltages" that come in on this "port"...so why would they be "ttl level"? :-/ Shouldn't the USB driver be able to interpret the signals in whatever way it wants and just supply software with the binary interpretation? Thanks for all the help, guys, it's really appreciated! -Zach On Nov 7, 2007 5:59 AM, U. George wrote: > > >> The software that > >> comes with the device (a u-blox ANTARIS 4 eval kit) is able to > >> communicate. > > > > Is it sure that this software is really using the virtual serial > > port and only this port? > > > > I have tried to read the docs. I have yet to find any explanation on a > (windoz) device driver for this device ( the usb device ). That magic > is not explained. For a developer thats important magic. Maybe a call > to their support team is in order? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071107/18a13314/attachment-0013.html From netbeans at gatworks.com Wed Nov 7 08:55:55 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 10:55:55 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> <4731A88E.6080705@gatworks.com> Message-ID: <4731E00B.9030902@gatworks.com> There are 2 components to talking to hardware. There is the electrical specification, and then there is the software specification. there is the rs232 specification, parallel port specification, and the USB electrical specification. Generally these are used to plug in the various devices, and hook up electrically. Then there is the software side. There is the device driver, a software component that sits somewhere in the kernel that handles the USB ( in your case ) controller. The device driver generally does not care about the electrical component. There are various chips that handle USB signals, and these chips have I/O addresses so that signals and data can be properly routed. There is also the side that communicates to the user via the COM port device-name. The device driver that you mentioned is for the "Support PL2303 serial chip". This device driver, which hopefully works, handles the USB chip, and eventually recognzes the gps device, and hopefully creates an COM port so the user can open up and communicate. These are a lot of "HOPES". Since u have the web address of the device driver, and developer, I would think that the developer, and any docs, might be better able to help u to first determine if the GPS device is recognized, and the COM port ( maybe its called by another name ) is created, as per documentation. > > These include srcdll, and x86 subfolders, though it's not 100% clear to > me that these are useful. From tjarvi at qbang.org Sat Nov 10 17:46:13 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Nov 2007 17:46:13 -0700 (MST) Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 5 Nov 2007, Oberhuber, Martin wrote: > Hi Trent, > > are the interestes of hobbyists really so different > from commercial ones? Both should be interested in > high quality and innovation the like. > > I haven't seen too many Open Source projects from the > "inside" but those that I have seen did not have > separate mailing lists for quality/testing/qa > versus innovation/development. > > What I have seen with the Open Source projects that > one would call "successful" is a good deal of > process around automated builds, automated unit > tests, predictable release dates and milestones, > and policies around commiting/contributing/reviewing > changes. > > I think that all of these benefit commercial users > and hobbyists the like. > > If you were just asking about who's interested in > discussing changes to foster more quality, count > me in. I'm just not sure whether discussing these > on a separate mailing list or other channel is the > right thing to do. > Hi Martin, There are two issues I'm thinking about. The first is the generic unit testing and quality initiatives required to move rxtx forward. The second is the inevitable fact that rxtx connects to external hardware. The discussion deals with a different set of problems. Here is a simple example of what I'm getting at. We have the capability of setting custom baud rates in rxtx. We may be interested in seeing regressions in rxtx, the C library or the kernel. Some people may be doing some tests with loopback connections. These will always work even if the baud rate is not set to the expected value. Some people may use null modems between two ports. This may be able to catch the problem but not always. Will the build machines be able to test this? (no - for a few reasons) Will people be trying to catch these type of regressions? (yes) What type of coverage does the community have in the end? (?) We could include the discussions in the same list or another equally open list that may be of interest to some folks that deal with these types of problems on a regular basis. -- Trent Jarvi tjarvi at qbang.org From timlow84 at gmail.com Mon Nov 12 00:31:17 2007 From: timlow84 at gmail.com (Timothy Low) Date: Mon, 12 Nov 2007 15:31:17 +0800 Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> Message-ID: <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> ---------- Forwarded message ---------- From: Timothy Low Date: Nov 12, 2007 3:02 PM Subject: Building RXTX From Source To: taj at www.linux.org.uk Cc: ferdinand.tang at tangs.net, Timothy Low , chweehuat.ng at tangs.net Hi Trent, I tried building RXTX from source, and I got this error. I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm trying to get the necessary ".so" files to use for my serial port communication through java. My linux kernal information is: *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 x86_64 x86_64 x86_64 GNU/Linux* I'll most glad if you can provide me some direction on this. Thanks ! ---------------- [root at smsgateway rxtx-2.0-7pre1]# ./configure checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu configure: WARNING: Trying libtool. If the following fails install libtool checking for gcc... gcc checking for C compiler default output... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking for ld used by GCC... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking for a sed that does not truncate output... /bin/sed checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking command to parse /usr/bin/nm -B output... ok checking how to run the C preprocessor... gcc -E checking for egrep... grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for ranlib... ranlib checking for strip... strip checking for objdir... .libs checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.lo... yes checking if gcc supports -fno-rtti -fno-exceptions... yes checking whether the linker (/usr/bin/ld) supports shared libraries... yes checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking dynamic linker characteristics... GNU/Linux ld.so checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no checking whether -lc should be explicitly linked in... no creating libtool checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking for style of include used by make... GNU checking dependency style of gcc... none checking fcntl.h usability... yes checking fcntl.h presence... yes checking for fcntl.h... yes checking sys/fcntl.h usability... yes checking sys/fcntl.h presence... yes checking for sys/fcntl.h... yes checking sys/file.h usability... yes checking sys/file.h presence... yes checking for sys/file.h... yes checking sys/time.h usability... yes checking sys/time.h presence... yes checking for sys/time.h... yes checking sys/signal.h usability... yes checking sys/signal.h presence... yes checking for sys/signal.h... yes checking signal.h usability... yes checking signal.h presence... yes checking for signal.h.. . yes checking termios.h usability... yes checking termios.h presence... yes checking for termios.h... yes checking asm/termbits.h usability... yes checking asm/termbits.h presence... yes checking for asm/termbits.h... yes checking grp.h usability... yes checking grp.h presence... yes checking for grp.h... yes checking pwd.h usability... yes checking pwd.h presence... yes checking for pwd.h... yes checking whether gcc needs -traditional... no checking whether to enable maintainer-specific portions of Makefiles... no /usr/java/jdk1.5.0_13 configure: WARNING: using JAVA_HOME environmental variable adjusted java.home is /usr/java/jdk1.5.0_13 checking os.name Linux checking os.arch i386 checking java.vendor Sun Microsystems Inc. checking java.version 1.5.0_13 checking os.version 2.6.18-8.el5xen comm.jar appears to be installed already. conftest.c: In function 'main': conftest.c:6: warning: incompatible implicit declaration of built-in function 'printf' conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:6: error: (Each undeclared identifier is reported only once conftest.c:6: error: for each function it appears in.) conftest.c:6: error: expected ')' before string constant conftest.c:7: warning: incompatible implicit declaration of built-in function 'exit' ./configure: line 9649: ./conftest: No such file or directory ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected conftest.c: In function 'main': conftest.c:5: warning: incompatible implicit declaration of built-in function 'printf' conftest.c:10: warning: incompatible implicit declaration of built-in function 'exit' configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status : config.h is unchanged config.status: executing depfiles commands [root at smsgateway rxtx-2.0-7pre1]# make install /usr/java/jdk1.5.0_13/bin/javac -classpath .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d /home/jboss/sources/rxtx- 2.0-7pre1/ -O /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java /home/jboss/sources/rxtx-2.0-7pre1/./src/UnSupportedLoggerException.java /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o /home/jboss/sources/rxtx-2.0-7pre1/x86_64-unknown-linux-gnu/SerialImp.lo /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'init_threads': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: cast from pointer to integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_nativeDrain': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: cast to pointer from integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'read_byte_array': /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: cast to pointer from integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_readArray': /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: comparison is always false due to limited range of data type /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_readTerminatedArray': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: comparison is always false due to limited range of data type mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial- 2.0.7pre1.* gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so -o .libs/librxtxSerial-2.0.7pre1.so (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.0.7pre1.so librxtxSerial.so) creating librxtxSerial.la (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la librxtxSerial.la) gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/ParallelImp.lo /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function 'Java_javax_comm_LPRPort_readArray': /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: comparison is always false due to limited range of data type rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* .libs/librxtxParallel-2.0.7pre1.* gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so -o .libs/librxtxParallel- 2.0.7pre1.so (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.0.7pre1.so librxtxParallel.so) creating librxtxParallel.la (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la librxtxParallel.la) make all-am make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' libtool: install: `x86_64-unknown-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 ------------- Regards, Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071112/27758c3c/attachment-0009.html From tjarvi at qbang.org Mon Nov 12 01:02:09 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Nov 2007 01:02:09 -0700 (MST) Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> Message-ID: On Mon, 12 Nov 2007, Timothy Low wrote: > > Hi Trent, Hi Tim, Comments are inline. As I mentioned off the list, rxtx 2.0 is on the edge of deprecation. We can get it working but this is not the path of least resistance for future work. You will probably need to bounce another round of questions off the list. The following is intended to isolate the problem. > > I tried building RXTX from source, and I got this error. > > > I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm trying > to get the necessary ".so" files to use for my serial port communication > through java. > My linux kernal information is: > > *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 x86_64 > x86_64 x86_64 GNU/Linux* > > I'll most glad if you can provide me some direction on this. Thanks ! > > ---------------- > [root at smsgateway rxtx-2.0-7pre1]# ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > checking for C compiler default output... a.out > checking whether the C compiler works... yes > checking whether we are cross compiling... no > checking for suffix of executables... > checking for suffix of object files... o > checking whether we are using the GNU C compiler... yes > checking whether gcc accepts -g... yes > checking for gcc option to accept ANSI C... none needed > checking for ld used by GCC... /usr/bin/ld > checking if the linker (/usr/bin/ld) is GNU ld... yes > checking for /usr/bin/ld option to reload object files... -r > checking for BSD-compatible nm... /usr/bin/nm -B > checking for a sed that does not truncate output... /bin/sed > checking whether ln -s works... yes > checking how to recognise dependent libraries... pass_all > checking command to parse /usr/bin/nm -B output... ok > checking how to run the C preprocessor... gcc -E > checking for egrep... grep -E > checking for ANSI C header files... yes > checking for sys/types.h... yes > checking for sys/stat.h... yes > checking for stdlib.h... yes > checking for string.h... yes > checking for memory.h... yes > checking for strings.h... yes > checking for inttypes.h... yes > checking for stdint.h... yes > checking for unistd.h... yes > checking dlfcn.h usability... yes > checking dlfcn.h presence... yes > checking for dlfcn.h... yes > checking for ranlib... ranlib > checking for strip... strip > checking for objdir... .libs > checking for gcc option to produce PIC... -fPIC > checking if gcc PIC flag -fPIC works... yes > checking if gcc static flag -static works... yes > checking if gcc supports -c -o file.o... yes > checking if gcc supports -c -o file.lo... yes > checking if gcc supports -fno-rtti -fno-exceptions... yes > checking whether the linker (/usr/bin/ld) supports shared libraries... yes > checking how to hardcode library paths into programs... immediate > checking whether stripping libraries is possible... yes > checking dynamic linker characteristics... GNU/Linux ld.so > checking if libtool supports shared libraries... yes > checking whether to build shared libraries... yes > checking whether to build static libraries... no > checking whether -lc should be explicitly linked in... no > creating libtool > checking for a BSD-compatible install... /usr/bin/install -c > checking whether build environment is sane... yes > checking for gawk... gawk > checking whether make sets $(MAKE)... yes > checking for style of include used by make... GNU > checking dependency style of gcc... none > checking fcntl.h usability... yes > checking fcntl.h presence... yes > checking for fcntl.h... yes > checking sys/fcntl.h usability... yes > checking sys/fcntl.h presence... yes > checking for sys/fcntl.h... yes > checking sys/file.h usability... yes > checking sys/file.h presence... yes > checking for sys/file.h... yes > checking sys/time.h usability... yes > checking sys/time.h presence... yes > checking for sys/time.h... yes > checking sys/signal.h usability... yes > checking sys/signal.h presence... yes > checking for sys/signal.h... yes > checking signal.h usability... yes > checking signal.h presence... yes > checking for signal.h.. . yes > checking termios.h usability... yes > checking termios.h presence... yes > checking for termios.h... yes > checking asm/termbits.h usability... yes > checking asm/termbits.h presence... yes > checking for asm/termbits.h... yes > checking grp.h usability... yes > checking grp.h presence... yes > checking for grp.h... yes > checking pwd.h usability... yes > checking pwd.h presence... yes > checking for pwd.h... yes > checking whether gcc needs -traditional... no > checking whether to enable maintainer-specific portions of Makefiles... no > /usr/java/jdk1.5.0_13 > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /usr/java/jdk1.5.0_13 > checking os.name Linux > checking os.arch i386 > checking java.vendor Sun Microsystems Inc. > checking java.version 1.5.0_13 > checking os.version 2.6.18-8.el5xen > comm.jar appears to be installed already. > conftest.c: In function 'main': > conftest.c:6: warning: incompatible implicit declaration of built-in > function 'printf' > conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:6: error: (Each undeclared identifier is reported only once > conftest.c:6: error: for each function it appears in.) > conftest.c:6: error: expected ')' before string constant This is an outdated kernel version check for when headers and kernels could cause problems for rxtx. If we made it past this, then you are OK. > conftest.c:7: warning: incompatible implicit declaration of built-in > function 'exit' > ./configure: line 9649: ./conftest: No such file or directory > ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected It blew up but continues.. > conftest.c: In function 'main': > conftest.c:5: warning: incompatible implicit declaration of built-in > function 'printf' > conftest.c:10: warning: incompatible implicit declaration of built-in > function 'exit' > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status : config.h is unchanged > config.status: executing depfiles commands > [root at smsgateway rxtx-2.0-7pre1]# make install > /usr/java/jdk1.5.0_13/bin/javac -classpath > .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d > /home/jboss/sources/rxtx- 2.0-7pre1/ -O > /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java > /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/UnSupportedLoggerException.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java > Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or > overrides a deprecated API. > Note: Recompile with -Xlint:deprecation for details. > /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* The java jar should be fine now. You may need to change the source files as mentioned below. > gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. > -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g > -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o > /home/jboss/sources/rxtx-2.0-7pre1/x86_64-unknown-linux-gnu/SerialImp.lo > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'init_threads': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: cast > from pointer to integer of different size > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_nativeDrain': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: cast to > pointer from integer of different size > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'read_byte_array': > /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: cast to > pointer from integer of different size As I recall, this was caused by pointers (now 64 bit rather than 32 bit) being stored in java ints (jints). I would look at the diff between the CVS 2.1 SerialImp.c and RXTXPort.java files against 2.0. We did fix those issues. You have a .so file but the different pointer sizes will cause runtime errors. > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_readArray': > /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: > comparison is always false due to limited range of data type > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_readTerminatedArray': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: > comparison is always false due to limited range of data type > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial- > 2.0.7pre1.* > gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so -o > .libs/librxtxSerial-2.0.7pre1.so > (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.0.7pre1.so > librxtxSerial.so) > creating librxtxSerial.la > (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la > librxtxSerial.la) > gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. > -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g > -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o > /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/ParallelImp.lo > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function > 'Java_javax_comm_LPRPort_readArray': > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: > comparison is always false due to limited range of data type > rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* > .libs/librxtxParallel-2.0.7pre1.* > gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so -o > .libs/librxtxParallel- 2.0.7pre1.so > (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.0.7pre1.so > librxtxParallel.so) > creating librxtxParallel.la > (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la > librxtxParallel.la) > make all-am > make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' > make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' > libtool: install: `x86_64-unknown-linux-gnu' must be an absolute directory > name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 A libtool change? Assuming you ran configure && make install in /home/jboss/sources/rxtx- 2.0-7pre1, libtool is looking for /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/.libs/librxtxSerial-2.0.7pre1.so. I think you have this? The file is just being copied to ~JAVA/jre/lib/$(JAVA_ARCH). -- Trent Jarvi tjarvi at qbang.org From sarah_662005 at yahoo.com Mon Nov 12 16:10:28 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Mon, 12 Nov 2007 15:10:28 -0800 (PST) Subject: [Rxtx] [urgent] device's power off detection Message-ID: <766782.10076.qm@web55803.mail.re3.yahoo.com> Hello all, I have a small application built on top of rxtx api. This application can retrieve the incoming data from a device through a port. The device can be powered off after the port get closed from the application. I have been trying a couple of hours to find a way to detect the power switching from device. If anyone knows how to handle it through rxtx, could you please give me a help? Thank you very much. r, Sara ____________________________________________________________________________________ Get easy, one-click access to your favorites. Make Yahoo! your homepage. http://www.yahoo.com/r/hs -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071112/4599f3ec/attachment-0008.html From netbeans at gatworks.com Mon Nov 12 17:52:22 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 12 Nov 2007 19:52:22 -0500 Subject: [Rxtx] [urgent] device's power off detection In-Reply-To: <766782.10076.qm@web55803.mail.re3.yahoo.com> References: <766782.10076.qm@web55803.mail.re3.yahoo.com> Message-ID: <4738F546.5010101@gatworks.com> Not sure what u are asking for. Are u asking for a way to detect if the device is OFF? Are u asking how to power off the device - via software ? Is it a Serial device? is it a parallel device? is it a usb device? Sara Hugh wrote: > Hello all, > I have a small application built on top of rxtx api. This application > can retrieve the incoming data from a device through a port. The device > can be powered off after the port get closed from the application. I > have been trying a couple of hours to find a way to detect the power > switching from device. If anyone knows how to handle it through rxtx, > could you please give me a help? Thank you very much. From tjarvi at qbang.org Mon Nov 12 22:48:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Nov 2007 22:48:11 -0700 (MST) Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711120225x562db8cbxb750767ade3b0d73@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> <900c6ba90711120031p66edc001ted76f7ba24e34b98@mail.gmail.com> <900c6ba90711120225x562db8cbxb750767ade3b0d73@mail.gmail.com> Message-ID: Hi Tim, The gnu.io namespace looks just like the javax.comm 2.0 namespace. There are additional (discouraged) undocumented methods in gnu.io that you need not use. We just used the different namespace to avoid poluting Sun's by mistake and to make sure we stayed off any potential licensing related radar. Usuaully, you just change your imports and make sure you do not use the javax.comm namespace for anything like exception handling. As I mentioned off the list, there are no issues with rxtx going through the JSR process to be more Sun friendly other than time. rxtx has no hidden intentions there; anything that does not work like CommAPI 2.0 documented is a bug. The reason we do not support CommAPI 2.1 is technical in nature and is in the list archives as well as the front page of www.rxtx.org. On Mon, 12 Nov 2007, Timothy Low wrote: > Hi Trent, > > I'll move to use a JDK1.5 64-bit version... but do I need to make any source > code changes to use the package (gnu.io) in the RTXTcomm.jar instead of the > ones from the javacomm api ? > > > Regards, > Tim > > On Nov 12, 2007 5:22 PM, Trent Jarvi wrote: > >> >> Hi Tim, >> >> I see a couple things here. >> >> First your jdk is for i686 yet the library is compiled on a x86_64 >> machine. You may try passing configure the --target=i686-unknown-linux to >> try using the i686 backend to gcc if it is available. Or move to the 64 >> bit jdk. >> >> The other error I see is again the moved UTF_RELEASE define that we need >> to fix. You can probably get around that with: >> >> make -DUTF_RELEASE=`uname -r` >> >> even more simple would be to just specify the serial library which should >> be in configure --help. >> >> You can remove the UTF_RELEASE check from configure by editing >> configure.in, searching for the simple C program check and deleting it. >> Running autoconf after that will regenerate a new configure without the >> check. >> >> Note that you should remove the previous native libraries >> (librxtxSerial.so) when moving from rxtx 2.0 to 2.1. These are compiled >> for different namespaces (javax.comm/gnu.io). >> >> On Mon, 12 Nov 2007, Timothy Low wrote: >> >>> *Hi Trent, >>> >>> I moved on to rxtx 2.1.7r2, and updated my jre to 1.6.0 (64-bit)... I >> tried >>> the following 2 methods: >>> >>> (1) using the rxtx 2.1.7 binaries from the RXTX website* >>> *Are these binaries suitable for a 64-bit OS ? There mentioning of the >>> gnu.io that you've talked about previously...* >>> ------ >>> [root at smsgateway sources]# java -Djava.library.path=/usr/lib PortLister >>> Experimental: JNI_OnLoad called. >>> >>> java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion >>> ()Ljava/lang/String; >>> at gnu.io.RXTXCommDriver.nativeGetVersion(Native Method) >>> at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:85) >>> at java.lang.Class.forName0(Native Method) >>> at java.lang.Class.forName(Unknown Source) >>> at javax.comm.CommPortIdentifier.loadDriver( >> CommPortIdentifier.java >>> :237) >>> at javax.comm.CommPortIdentifier.(CommPortIdentifier.java >>> :109) >>> at PortLister.(PortLister.java:6) >>> at PortLister.main(PortLister.java:25) >>> Exception in thread "main" java.lang.UnsatisfiedLinkError: >>> com.sun.comm.SunrayInfo.isSessionActive()Z >>> at com.sun.comm.SunrayInfo.isSessionActive(Native Method) >>> at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java >> :155) >>> at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java >>> :100) >>> at javax.comm.CommPortIdentifier.(CommPortIdentifier.java >>> :138) >>> at PortLister.(PortLister.java:6) >>> at PortLister.main(PortLister.java:25) >>> >>> ------ >>> >>> (2) compiling the rxtx 2.1.7 from source >>> *but i got the following error while running ./configure and make all* >>> >>> ------ >>> [root at smsgateway rxtx-2.1-7r2]# ./configure >>> checking build system type... x86_64-unknown-linux-gnu >>> checking host system type... x86_64-unknown-linux-gnu >>> checking target system type... x86_64-unknown-linux-gnu >>> configure: WARNING: Trying libtool. If the following fails install >> libtool >>> checking for gcc... gcc >>> checking for C compiler default output file name... a.out >>> checking whether the C compiler works... yes >>> checking whether we are cross compiling... no >>> checking for suffix of executables... >>> checking for suffix of object files... o >>> checking whether we are using the GNU C compiler... yes >>> checking whether gcc accepts -g... yes >>> checking for gcc option to accept ANSI C... none needed >>> checking for a sed that does not truncate output... /bin/sed >>> checking for egrep... grep -E >>> checking for ld used by gcc... /usr/bin/ld >>> checking if the linker (/usr/bin/ld) is GNU ld... yes >>> checking for /usr/bin/ld option to reload object files... -r >>> checking for BSD-compatible nm... /usr/bin/nm -B >>> checking whether ln -s works... yes >>> checking how to recognise dependent libraries... pass_all >>> checking how to run the C preprocessor... gcc -E >>> checking for ANSI C header files... yes >>> checking for sys/types.h... yes >>> checking for sys/stat.h... yes >>> checking for stdlib.h... yes >>> checking for string.h... yes >>> checking for memory.h... yes >>> checking for strings.h... yes >>> checking for inttypes.h... yes >>> checking for stdint.h... yes >>> checking for unistd.h... yes >>> checking dlfcn.h usability... yes >>> checking dlfcn.h presence... yes >>> checking for dlfcn.h... yes >>> checking for g++... g++ >>> checking whether we are using the GNU C++ compiler... yes >>> checking whether g++ accepts -g... yes >>> checking how to run the C++ preprocessor... g++ -E >>> checking for g77... no >>> checking for f77... no >>> checking for xlf... no >>> checking for frt... no >>> checking for pgf77... no >>> checking for fort77... no >>> checking for fl32... no >>> checking for af77... no >>> checking for f90... no >>> checking for xlf90... no >>> checking for pgf90... no >>> checking for epcf90... no >>> checking for f95... f95 >>> checking whether we are using the GNU Fortran 77 compiler... yes >>> checking whether f95 accepts -g... yes >>> checking the maximum length of command line arguments... 32768 >>> checking command to parse /usr/bin/nm -B output from gcc object... ok >>> checking for objdir... .libs >>> checking for ar... ar >>> checking for ranlib... ranlib >>> checking for strip... strip >>> checking if gcc static flag works... yes >>> checking if gcc supports -fno-rtti -fno-exceptions... no >>> checking for gcc option to produce PIC... -fPIC >>> checking if gcc PIC flag -fPIC works... yes >>> checking if gcc supports -c -o file.o... yes >>> checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking whether -lc should be explicitly linked in... no >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> checking if libtool supports shared libraries... yes >>> checking whether to build shared libraries... yes >>> checking whether to build static libraries... no >>> configure: creating libtool >>> appending configuration tag "CXX" to libtool >>> checking for ld used by g++... /usr/bin/ld -m elf_x86_64 >>> checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes >>> checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking for g++ option to produce PIC... -fPIC >>> checking if g++ PIC flag -fPIC works... yes >>> checking if g++ supports -c -o file.o... yes >>> checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> appending configuration tag "F77" to libtool >>> checking if libtool supports shared libraries... yes >>> checking whether to build shared libraries... yes >>> checking whether to build static libraries... no >>> checking for f95 option to produce PIC... -fPIC >>> checking if f95 PIC flag -fPIC works... yes >>> checking if f95 supports -c -o file.o... yes >>> checking whether the f95 linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> checking for a BSD-compatible install... /usr/bin/install -c >>> checking whether build environment is sane... yes >>> checking for gawk... gawk >>> checking whether make sets $(MAKE)... yes >>> checking for style of include used by make... GNU >>> checking dependency style of gcc... none >>> checking dependency style of g++... none >>> checking fcntl.h usability... yes >>> checking fcntl.h presence... yes >>> checking for fcntl.h... yes >>> checking sys/fcntl.h usability... yes >>> checking sys/fcntl.h presence... yes >>> checking for sys/fcntl.h... yes >>> checking sys/file.h usability... yes >>> checking sys/file.h presence... yes >>> checking for sys/file.h... yes >>> checking sys/time.h usability... yes >>> checking sys/time.h presence... yes >>> checking for sys/time.h... yes >>> checking sys/signal.h usability... yes >>> checking sys/signal.h presence... yes >>> checking for sys/signal.h... yes >>> checking signal.h usability... yes >>> checking signal.h presence... yes >>> checking for signal.h... yes >>> checking termios.h usability... yes >>> checking termios.h presence... yes >>> checking for termios.h... yes >>> checking grp.h usability... yes >>> checking grp.h presence... yes >>> checking for grp.h... yes >>> checking pwd.h usability... yes >>> checking pwd.h presence... yes >>> checking for pwd.h... yes >>> checking whether gcc needs -traditional... no >>> checking whether to enable maintainer-specific portions of Makefiles... >> no >>> /usr/java/jdk1.5.0_13 >>> configure: WARNING: using JAVA_HOME environmental variable >>> adjusted java.home is /usr/java/jdk1.5.0_13 >>> checking os.name Linux >>> checking os.arch i386 >>> checking java.vendor Sun Microsystems Inc. >>> checking java.version 1.5.0_13 >>> checking os.version 2.6.18-8.el5xen >>> conftest.c: In function 'main': >>> conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this >> function) >>> conftest.c:8: error: (Each undeclared identifier is reported only once >>> conftest.c:8: error: for each function it appears in.) >>> conftest.c:8: error: expected ')' before string constant >>> ./configure: line 21462: ./conftest: No such file or directory >>> ./configure: line 21462: test: 2.6.18-8.el5xen: unary operator expected >>> configure: creating ./config.status >>> config.status: creating Makefile >>> config.status: creating config.h >>> config.status: executing depfiles commands >>> [root at smsgateway rxtx-2.1-7r2]# make install >>> /usr/java/jdk1.5.0_13/bin/javac -classpath .:/home/jboss/sources/rxtx- >>> >> 2.1-7r2:/home/jboss/sources/rxtx-2.1-7r2/src:/usr/java/jdk1.5.0_13/jre/lib/ext/RXTXcomm.jar-d >>> /home/jboss/sources/rxtx- >>> 2.1-7r2/ -O -source 1.3 -target 1.3 >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommDriver.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortEnumerator.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortIdentifier.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortOwnershipListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Configure.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2C.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/I2CPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/LPRPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/NoSuchPortException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/PortInUseException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Raw.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/RawPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RawPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RawPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/RS485PortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485PortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485Port.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXCommDriver.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXVersion.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPort.java >>> /home/jboss/sources/rxtx-2.1-7r2 >> /./src/UnsupportedCommOperationException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/UnSupportedLoggerException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Zystem.java >>> /usr/java/jdk1.5.0_13/bin/javah -classpath .:/home/jboss/sources/rxtx- >>> >> 2.1-7r2:/home/jboss/sources/rxtx-2.1-7r2/src:/usr/java/jdk1.5.0_13/jre/lib/ext/RXTXcomm.jar-d >>> x86_64-unknown-linux-gnu -jni `(for i in CommDriver CommPortEnumerator >>> CommPortIdentifier CommPort CommPortOwnershipListener Configure I2C >>> I2CPortEvent I2CPortEventListener I2CPort LPRPort NoSuchPortException >>> ParallelPortEvent ParallelPortEventListener ParallelPort >> PortInUseException >>> Raw RawPortEvent RawPortEventListener RawPort RS485 RS485PortEvent >>> RS485PortEventListener RS485Port RXTXCommDriver RXTXPort RXTXVersion >>> SerialPortEvent SerialPortEventListener SerialPort >>> UnsupportedCommOperationException UnSupportedLoggerException Zystem;do \ >>> if grep > /dev/null native.*\( /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/$i.java; then \ >>> echo gnu.io.$i; \ >>> fi; \ >>> done)` >>> /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialImp.c -o >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo; >>> \ >>> if [ "Serial" = "Serial" ]; >>> then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxSerial.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxSerial.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo; >> \ >>> fi; \ >>> ) >>> mkdir /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/.libs >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/SerialImp.o >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/fuserImp.o >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c: In function >> 'show_user': >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c:238: warning: cast >> from >>> pointer to integer of different size >>> gcc -shared /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/SerialImp.o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/fuserImp.o >>> -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7.so -o >> .libs/librxtxSerial- >>> 2.1-7.so >>> (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.1-7.so >>> librxtxSerial.so) >>> creating librxtxSerial.la >>> (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la >>> librxtxSerial.la) >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelImp.c -o >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/ParallelImp.lo; >>> \ >>> if [ "Parallel" = "Serial" ]; >>> then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxParallel.la -rpath >>> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/ParallelImp.lo >>> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxParallel.la -rpath >>> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/ParallelImp.lo; >>> \ >>> fi; \ >>> ) >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >>> /x86_64-unknown-linux-gnu/.libs/ParallelImp.o >>> gcc -shared /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/ParallelImp.o >>> -lpthread -Wl,-soname -Wl,librxtxParallel-2.1-7.so -o >>> .libs/librxtxParallel-2.1-7.so >>> (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.1-7.so >>> librxtxParallel.so) >>> creating librxtxParallel.la >>> (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la >>> librxtxParallel.la) >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo; >>> \ >>> if [ "I2C" = "Serial" ]; then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxI2C.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo >>> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxI2C.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo; >>> \ >>> fi; \ >>> ) >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/.libs/I2CImp.o >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c: In function >>> 'Java_gnu_io_I2CPort_Initialize': >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: 'UTS_RELEASE' >>> undeclared (first use in this function) >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: (Each >> undeclared >>> identifier is reported only once >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: for each >> function >>> it appears in.) >>> libtool: link: `/home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/I2CImp.lo' >>> is not a valid libtool object >>> make: *** [x86_64-unknown-linux-gnu/librxtxI2C.la] Error 1 >>> >>> ------ >>> >>> >>> >>> On Nov 12, 2007 4:02 PM, Trent Jarvi wrote: >>> >>>> On Mon, 12 Nov 2007, Timothy Low wrote: >>>>> >>>>> Hi Trent, >>>> >>>> Hi Tim, >>>> >>>> Comments are inline. As I mentioned off the list, rxtx 2.0 is on the >> edge >>>> of deprecation. We can get it working but this is not the path of >> least >>>> resistance for future work. >>>> >>>> You will probably need to bounce another round of questions off the >> list. >>>> The following is intended to isolate the problem. >>>> >>>>> >>>>> I tried building RXTX from source, and I got this error. >>>>> >>>>> >>>>> I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm >>>> trying >>>>> to get the necessary ".so" files to use for my serial port >> communication >>>>> through java. >>>>> My linux kernal information is: >>>>> >>>>> *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 >>>> x86_64 >>>>> x86_64 x86_64 GNU/Linux* >>>>> >>>>> I'll most glad if you can provide me some direction on this. Thanks ! >>>>> >>>>> ---------------- >>>>> [root at smsgateway rxtx-2.0-7pre1]# ./configure >>>>> checking build system type... x86_64-unknown-linux-gnu >>>>> checking host system type... x86_64-unknown-linux-gnu >>>>> checking target system type... x86_64-unknown-linux-gnu >>>>> configure: WARNING: Trying libtool. If the following fails install >>>> libtool >>>>> checking for gcc... gcc >>>>> checking for C compiler default output... a.out >>>>> checking whether the C compiler works... yes >>>>> checking whether we are cross compiling... no >>>>> checking for suffix of executables... >>>>> checking for suffix of object files... o >>>>> checking whether we are using the GNU C compiler... yes >>>>> checking whether gcc accepts -g... yes >>>>> checking for gcc option to accept ANSI C... none needed >>>>> checking for ld used by GCC... /usr/bin/ld >>>>> checking if the linker (/usr/bin/ld) is GNU ld... yes >>>>> checking for /usr/bin/ld option to reload object files... -r >>>>> checking for BSD-compatible nm... /usr/bin/nm -B >>>>> checking for a sed that does not truncate output... /bin/sed >>>>> checking whether ln -s works... yes >>>>> checking how to recognise dependent libraries... pass_all >>>>> checking command to parse /usr/bin/nm -B output... ok >>>>> checking how to run the C preprocessor... gcc -E >>>>> checking for egrep... grep -E >>>>> checking for ANSI C header files... yes >>>>> checking for sys/types.h... yes >>>>> checking for sys/stat.h... yes >>>>> checking for stdlib.h... yes >>>>> checking for string.h... yes >>>>> checking for memory.h... yes >>>>> checking for strings.h... yes >>>>> checking for inttypes.h... yes >>>>> checking for stdint.h... yes >>>>> checking for unistd.h... yes >>>>> checking dlfcn.h usability... yes >>>>> checking dlfcn.h presence... yes >>>>> checking for dlfcn.h... yes >>>>> checking for ranlib... ranlib >>>>> checking for strip... strip >>>>> checking for objdir... .libs >>>>> checking for gcc option to produce PIC... -fPIC >>>>> checking if gcc PIC flag -fPIC works... yes >>>>> checking if gcc static flag -static works... yes >>>>> checking if gcc supports -c -o file.o... yes >>>>> checking if gcc supports -c -o file.lo... yes >>>>> checking if gcc supports -fno-rtti -fno-exceptions... yes >>>>> checking whether the linker (/usr/bin/ld) supports shared libraries... >>>> yes >>>>> checking how to hardcode library paths into programs... immediate >>>>> checking whether stripping libraries is possible... yes >>>>> checking dynamic linker characteristics... GNU/Linux ld.so >>>>> checking if libtool supports shared libraries... yes >>>>> checking whether to build shared libraries... yes >>>>> checking whether to build static libraries... no >>>>> checking whether -lc should be explicitly linked in... no >>>>> creating libtool >>>>> checking for a BSD-compatible install... /usr/bin/install -c >>>>> checking whether build environment is sane... yes >>>>> checking for gawk... gawk >>>>> checking whether make sets $(MAKE)... yes >>>>> checking for style of include used by make... GNU >>>>> checking dependency style of gcc... none >>>>> checking fcntl.h usability... yes >>>>> checking fcntl.h presence... yes >>>>> checking for fcntl.h... yes >>>>> checking sys/fcntl.h usability... yes >>>>> checking sys/fcntl.h presence... yes >>>>> checking for sys/fcntl.h... yes >>>>> checking sys/file.h usability... yes >>>>> checking sys/file.h presence... yes >>>>> checking for sys/file.h... yes >>>>> checking sys/time.h usability... yes >>>>> checking sys/time.h presence... yes >>>>> checking for sys/time.h... yes >>>>> checking sys/signal.h usability... yes >>>>> checking sys/signal.h presence... yes >>>>> checking for sys/signal.h... yes >>>>> checking signal.h usability... yes >>>>> checking signal.h presence... yes >>>>> checking for signal.h.. . yes >>>>> checking termios.h usability... yes >>>>> checking termios.h presence... yes >>>>> checking for termios.h... yes >>>>> checking asm/termbits.h usability... yes >>>>> checking asm/termbits.h presence... yes >>>>> checking for asm/termbits.h... yes >>>>> checking grp.h usability... yes >>>>> checking grp.h presence... yes >>>>> checking for grp.h... yes >>>>> checking pwd.h usability... yes >>>>> checking pwd.h presence... yes >>>>> checking for pwd.h... yes >>>>> checking whether gcc needs -traditional... no >>>>> checking whether to enable maintainer-specific portions of >> Makefiles... >>>> no >>>>> /usr/java/jdk1.5.0_13 >>>>> configure: WARNING: using JAVA_HOME environmental variable >>>>> adjusted java.home is /usr/java/jdk1.5.0_13 >>>>> checking os.name Linux >>>>> checking os.arch i386 >>>>> checking java.vendor Sun Microsystems Inc. >>>>> checking java.version 1.5.0_13 >>>>> checking os.version 2.6.18-8.el5xen >>>>> comm.jar appears to be installed already. >>>>> conftest.c: In function 'main': >>>>> conftest.c:6: warning: incompatible implicit declaration of built-in >>>>> function 'printf' >>>>> conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this >>>> function) >>>>> conftest.c:6: error: (Each undeclared identifier is reported only once >>>>> conftest.c:6: error: for each function it appears in.) >>>>> conftest.c:6: error: expected ')' before string constant >>>> >>>> >>>> This is an outdated kernel version check for when headers and kernels >>>> could cause problems for rxtx. If we made it past this, then you are >> OK. >>>> >>>> >>>>> conftest.c:7: warning: incompatible implicit declaration of built-in >>>>> function 'exit' >>>>> ./configure: line 9649: ./conftest: No such file or directory >>>>> ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected >>>> >>>> It blew up but continues.. >>>> >>>>> conftest.c: In function 'main': >>>>> conftest.c:5: warning: incompatible implicit declaration of built-in >>>>> function 'printf' >>>>> conftest.c:10: warning: incompatible implicit declaration of built-in >>>>> function 'exit' >>>>> configure: creating ./config.status >>>>> config.status: creating Makefile >>>>> config.status: creating config.h >>>>> config.status : config.h is unchanged >>>>> config.status: executing depfiles commands >>>>> [root at smsgateway rxtx-2.0-7pre1]# make install >>>>> /usr/java/jdk1.5.0_13/bin/javac -classpath >>>>> .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/ -O >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1 >> /./src/UnSupportedLoggerException.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java >>>>> Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or >>>>> overrides a deprecated API. >>>>> Note: Recompile with -Xlint:deprecation for details. >>>>> /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* >>>> >>>> >>>> The java jar should be fine now. You may need to change the source >> files >>>> as mentioned below. >>>> >>>>> gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu >> -I. >>>>> -I/usr/java/jdk1.5.0_13/include >> -I/usr/java/jdk1.5.0_13/include/./linux/ >>>> -g >>>>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o >>>>> /home/jboss/sources/rxtx-2.0-7pre1 >> /x86_64-unknown-linux-gnu/SerialImp.lo >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'init_threads': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: >>>> cast >>>>> from pointer to integer of different size >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_nativeDrain': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: >>>> cast to >>>>> pointer from integer of different size >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'read_byte_array': >>>>> /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: >>>> cast to >>>>> pointer from integer of different size >>>> >>>> >>>> As I recall, this was caused by pointers (now 64 bit rather than 32 >> bit) >>>> being stored in java ints (jints). I would look at the diff between >> the >>>> CVS 2.1 SerialImp.c and RXTXPort.java files against 2.0. We >>>> did fix those issues. >>>> >>>> You have a .so file but the different pointer sizes will cause runtime >>>> errors. >>>> >>>> >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_readArray': >>>>> /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: >>>>> comparison is always false due to limited range of data type >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_readTerminatedArray': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: >>>>> comparison is always false due to limited range of data type >>>>> mkdir .libs >>>>> rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* >> .libs/librxtxSerial- >>>>> 2.0.7pre1.* >>>>> gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so-o >>>>> .libs/librxtxSerial-2.0.7pre1.so >>>>> (cd .libs && rm -f librxtxSerial.so && ln -s >> librxtxSerial-2.0.7pre1.so >>>>> librxtxSerial.so) >>>>> creating librxtxSerial.la >>>>> (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la >>>>> librxtxSerial.la) >>>>> gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu >> -I. >>>>> -I/usr/java/jdk1.5.0_13/include >> -I/usr/java/jdk1.5.0_13/include/./linux/ >>>> -g >>>>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o >>>>> /home/jboss/sources/rxtx- 2.0-7pre1 >>>> /x86_64-unknown-linux-gnu/ParallelImp.lo >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function >>>>> 'Java_javax_comm_LPRPort_readArray': >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: >>>>> comparison is always false due to limited range of data type >>>>> rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* >>>>> .libs/librxtxParallel-2.0.7pre1.* >>>>> gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so-o >>>>> .libs/librxtxParallel- 2.0.7pre1.so >>>>> (cd .libs && rm -f librxtxParallel.so && ln -s >>>> librxtxParallel-2.0.7pre1.so >>>>> librxtxParallel.so) >>>>> creating librxtxParallel.la >>>>> (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la >>>>> librxtxParallel.la) >>>>> make all-am >>>>> make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' >>>>> make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' >>>>> libtool: install: `x86_64-unknown-linux-gnu' must be an absolute >>>> directory >>>>> name >>>>> Try `libtool --help --mode=install' for more information. >>>>> make: *** [install] Error 1 >>>> >>>> A libtool change? Assuming you ran configure && make install in >>>> /home/jboss/sources/rxtx- 2.0-7pre1, libtool is looking for >>>> /home/jboss/sources/rxtx- >>>> 2.0-7pre1/x86_64-unknown-linux-gnu/.libs/librxtxSerial-2.0.7pre1.so. >>>> >>>> I think you have this? The file is just being copied to >>>> ~JAVA/jre/lib/$(JAVA_ARCH). >>>> >>>> -- >>>> Trent Jarvi >>>> tjarvi at qbang.org >>>> >>> >> > From guido.vogt at celsi.ch Tue Nov 13 00:28:01 2007 From: guido.vogt at celsi.ch (Guido Vogt) Date: Tue, 13 Nov 2007 08:28:01 +0100 Subject: [Rxtx] RTS Line can't be set Message-ID: <47395201.1050400@celsi.ch> I'm working on an Windows XP /SP2 System. Version of RXTX: 2.1.7. The serial line is connected to a modem. As I can see, the RTS-Line of the serial Port is inactive, when the port is opened (flowcontrol=none). Obviously, no data is coming from the modem. If I use the setRTS(true) command after open, the comport does not send out my data any more. This behaviour is regardless of flowcontrol. Anybody has an idea what do do? Thanks for help. From Martin.Oberhuber at windriver.com Tue Nov 13 08:58:23 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 13 Nov 2007 16:58:23 +0100 Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803880918@ism-mail03.corp.ad.wrs.com> Hi Trent, as said before, I like the idea of discussing such quality engineering issues, but why hide these away from the rest of the public? Anyways, if you do want to create a new mailing list for these kinds of things I'll happily subscribe. 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: Sunday, November 11, 2007 1:46 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: RE: [Rxtx] Quality Engineering with rxtx > > On Mon, 5 Nov 2007, Oberhuber, Martin wrote: > > > Hi Trent, > > > > are the interestes of hobbyists really so different > > from commercial ones? Both should be interested in > > high quality and innovation the like. > > > > I haven't seen too many Open Source projects from the > > "inside" but those that I have seen did not have > > separate mailing lists for quality/testing/qa > > versus innovation/development. > > > > What I have seen with the Open Source projects that > > one would call "successful" is a good deal of > > process around automated builds, automated unit > > tests, predictable release dates and milestones, > > and policies around commiting/contributing/reviewing > > changes. > > > > I think that all of these benefit commercial users > > and hobbyists the like. > > > > If you were just asking about who's interested in > > discussing changes to foster more quality, count > > me in. I'm just not sure whether discussing these > > on a separate mailing list or other channel is the > > right thing to do. > > > > Hi Martin, > > There are two issues I'm thinking about. The first is the > generic unit > testing and quality initiatives required to move rxtx > forward. The second > is the inevitable fact that rxtx connects to external hardware. The > discussion deals with a different set of problems. > > Here is a simple example of what I'm getting at. > > We have the capability of setting custom baud rates in rxtx. > We may be > interested in seeing regressions in rxtx, the C library or > the kernel. > Some people may be doing some tests with loopback > connections. These will > always work even if the baud rate is not set to the expected > value. Some > people may use null modems between two ports. This may be > able to catch > the problem but not always. > > Will the build machines be able to test this? (no - for a few reasons) > Will people be trying to catch these type of regressions? (yes) > What type of coverage does the community have in the end? (?) > > We could include the discussions in the same list or another > equally open > list that may be of interest to some folks that deal with > these types of > problems on a regular basis. > > -- > Trent Jarvi > tjarvi at qbang.org > From toupsz at cs.tamu.edu Tue Nov 13 10:33:03 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 13 Nov 2007 11:33:03 -0600 Subject: [Rxtx] [urgent] device's power off detection In-Reply-To: <4738F546.5010101@gatworks.com> References: <766782.10076.qm@web55803.mail.re3.yahoo.com> <4738F546.5010101@gatworks.com> Message-ID: Lacking any other specification on it...but can you set up the device to notify your software when it turns off? Send a message or somesuch? Maybe it can signal using RTS or DTR? -Zach On Nov 12, 2007 6:52 PM, U. George wrote: > Not sure what u are asking for. Are u asking for a way to detect if the > device is OFF? Are u asking how to power off the device - via software ? > Is it a Serial device? > is it a parallel device? > is it a usb device? > > Sara Hugh wrote: > > Hello all, > > I have a small application built on top of rxtx api. This application > > can retrieve the incoming data from a device through a port. The device > > can be powered off after the port get closed from the application. I > > have been trying a couple of hours to find a way to detect the power > > switching from device. If anyone knows how to handle it through rxtx, > > could you please give me a help? Thank you very much. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071113/e5859e4d/attachment-0007.html From tjarvi at qbang.org Tue Nov 13 20:02:03 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 13 Nov 2007 20:02:03 -0700 (MST) Subject: [Rxtx] #ifndef TIOCSERGETLSR In-Reply-To: <472E3AAF.7050709@gatworks.com> References: <472E3AAF.7050709@gatworks.com> Message-ID: On Sun, 4 Nov 2007, U. George wrote: > For Linux, it seems that you need the code for both *having* a > TIOCSERGETLSR, and *not having* a TIOCSERGETLSR. Maybe the ioctl exists > system wide, but not necessarily for the device driver itself ( always > returns -1 ) . > > Are there systems that have a *functioning* TIOCSERGETLSR for all their > devices? Then this would be the case where the "#ifndef TIOCSERGETLSR" > directive could be useful is eliminating the unnecessary code and tests. > > And for those systems that dont have a TIOCSERGETLSR, then the code for > TIOCSERGETLSR can be eliminated. > > It would be a simple case to have, as a foundation, all the code to > simulate the missing TIOCSERGETLSR ioctl. If the system does have the > ioctl, then that code can be ifdef'd in, and co-exist with the > functionality of the code that simulates the missing TIOCSERGETLSR ioctl. > Ah, there is the post. Sorry I was on vacation. Hi George, Yes there are systems that have functioning TIOCSERGETLSR for all of their devices. These are machines that just use traditional UARTs. If you mean operating systems, then probably not. Let me explain a bit about the history of those #ifdefs to help clear up a mess. RXTX aims to follow POSIX. TIOCSERGETLSR turns out to not be POSIX at all as I understand. It isn't in BSD, Solaris, AIX or HP-UX. It certainly provides access to important information. I assumed it was standard when I coded rxtx on a Linux system. Ya, laugh. Then I looked at Win32.. Oh you are still laughing? ..I could not navigate msft's web site at the time [still can't really find anything today]. So google pointed me to someones 'reverse documentation' of the w32 API and an example msft put together back in the win3.0 days. It was enough but maybe not 100% correct. They covered overlapped IO which was important for events in rxtx. Looking at Win32 and Linux, it made sense to implement TIOCSERGETLSR for win32 with the way rxtx works. That was how things matched up. But when I got feedback about other systems, it didn't match up. When people used multiport cards with money saving designs in Linux, it didn't match up. And today, there are drivers for unusual serial ports that don't match up. Now we have some ugly logic that mostly works for most serial ports. It isn't right though. The important aspect of TIOSERGETLSR is knowing when the output is really gone. But POSIX tcdrain tells us the same thing. So there is logic in the ifdefs to match that up as you suggest. Perhaps a more formal solution along those lines would be worth looking into. I would suggest the roles should be switched though. We should use POSIX calls on all systems and hide things that don't work on everything like we have with other undocumented calls. TIOSERGETLSR is nice and would be great if it was standard. It isn't as far as I can tell. In the end, many people write Java code because they want portability. The TIOSERGETLSR does not really fit. In someways, this is limiting to the least common denominator which is Solaris if you have seen it's serial kernel driver code. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 15 09:10:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 15 Nov 2007 17:10:59 +0100 Subject: [Rxtx] RXTX blocking on unconnected virtual port Message-ID: <460801A4097E3D4CA04CC64EE648584803919080@ism-mail03.corp.ad.wrs.com> Hello, we came across the following issue: * Set up a virtual serial port, e.g. with com0com: http://com0com.sourceforge.net/ * Connect RXTX to one end, e.g. cnc1a * Do not connect the other end, e.g. cnc1b * Have RXTX write data to the port --> Since the data is not being read, RXTX blocks - RXTXPort.SerialOutputStream.write increases the RXTXPort.IOLocked variable - it then calls the native writeByte or writeArray method (which blocks) closing the RXTXPort hangs for ever too: - RXTXPort.close() has a while( IOLocked > 0 ) {..Thread.sleep(500);...} which spins for ever ==> once the communication hangs, it cannot recover. Has anybody else seen such a problem before, or even got an idea how to solve it? When I connect Hyperterminal to the same half-open port, and type a character, it hangs for about 3 seconds but then times out and is available again. I guess that's what I'd like to see in RXTX as well, with a (configurable) timeout. Our big problem with the current situation is that once RXTX gets stuck, there is nothing at all we can do to make it go live again - that's why our original workaround of writing to the port in a background thread is not good enough. For more background information, the issue is being tracked in https://bugs.eclipse.org/bugs/show_bug.cgi?id=208185 Thanks for any hints or ideas, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Sun Nov 18 09:43:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 09:43:26 -0700 (MST) Subject: [Rxtx] PortInUseException - Cannot close and reopen serial port In-Reply-To: <460801A4097E3D4CA04CC64EE64858480351C711@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858480351C711@ism-mail03.corp.ad.wrs.com> Message-ID: These have been submitted to CVS and the bugzilla entries have been changed to reflect the changes. ChangeLog: find ports which were added after program startup on Mac OS X. Martin Oberhuber http://bugzilla.qbang.org/show_bug.cgi?id=48 Clean up CommPort Ownership code, avoid possible deadlocks, fix lost commport ownership events. http://bugzilla.qbang.org/show_bug.cgi?id=83 Martin Oberhuber On Wed, 24 Oct 2007, Oberhuber, Martin wrote: > 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) > > > > > > > > > > > > > > > From tjarvi at qbang.org Sun Nov 18 09:45:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 09:45:39 -0700 (MST) Subject: [Rxtx] PortInUseException - Cannot close and reopen serial port In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848020CAF26@ism-mail03.corp.ad.wrs.com> Message-ID: The current CVS code should have all the entries. With version information, I usually do not change the version until we tag and release a zip file. Any feedback would be appreciated. On Wed, 27 Jun 2007, Greg Johnson wrote: > 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) >> >> >> >> >> > From tjarvi at qbang.org Sun Nov 18 13:51:27 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 13:51:27 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs Message-ID: The following bugs have been closed and CVS updated as needed: CommPortIdentifier.getPortIdentifier throws NoSuchPortException http://bugzilla.qbang.org/show_bug.cgi?id=48 CommPortOwnership events not sent http://bugzilla.qbang.org/show_bug.cgi?id=83 JVM 1.6 builds http://bugzilla.qbang.org/show_bug.cgi?id=84 I'd like to give Martin Oberhuber CVS write access. He has been doing a great job of pushing safe patches into rxtx. I'll be preparing seperate patches for the changes I have and submitting them to the list. I'll need to work with George to do a couple things: 1) break the patch into smaller pieces to isolate issues for discussion. 2) work through the Line Status Register changes so it does not cause problems on other systems. George: If you could do the first one, it would be greatly appreciated. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Nov 18 15:33:36 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 15:33:36 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: Message-ID: I'm not running any tests at this point, I'm trying to apply the small safe patches and make sure everything is compiling. As mentioned at the bottom, there are 3 patches + the USB fix posted here that need more review before accepting. The following bugs have been closed and CVS updated as needed. Most of these are already in CVS. The diff will be small. configure script failed at line UTS_RELEASE megov http://bugzilla.qbang.org/show_bug.cgi?id=80 code cleanup patch (extra ';' creates bug for if statements + new String() calls removed) Xavier Le Vourch http://bugzilla.qbang.org/show_bug.cgi?id=77 Wont compile on linux ppc with glibc 2.5 - no sys/io.h Brian Johnson http://bugzilla.qbang.org/show_bug.cgi?id=72 rxtx overwrites System properties Andrew Gillett Nektarios K. Papadopoulos Neboj??a http://bugzilla.qbang.org/show_bug.cgi?id=64 Solaris ACM port support Dave Cleal http://bugzilla.qbang.org/show_bug.cgi?id=59 Setting of non-standard baud rate fails. Andrew Prunicki http://bugzilla.qbang.org/show_bug.cgi?id=58 RXTX uses lockfiles on MacOS X (instead of ioctl TIOCEXCL) Joachim Buechse http://bugzilla.qbang.org/show_bug.cgi?id=50 JavaDoc fixes Joachim Buechse http://bugzilla.qbang.org/show_bug.cgi?id=49 I need to further review the following: http://bugzilla.qbang.org/show_bug.cgi?id=53 http://bugzilla.qbang.org/show_bug.cgi?id=46 http://bugzilla.qbang.org/show_bug.cgi?id=41 On Sun, 18 Nov 2007, Trent Jarvi wrote: > > The following bugs have been closed and CVS updated as needed: > > CommPortIdentifier.getPortIdentifier throws NoSuchPortException > http://bugzilla.qbang.org/show_bug.cgi?id=48 > CommPortOwnership events not sent > http://bugzilla.qbang.org/show_bug.cgi?id=83 > JVM 1.6 builds > http://bugzilla.qbang.org/show_bug.cgi?id=84 > > I'd like to give Martin Oberhuber CVS write access. He has been doing a > great job of pushing safe patches into rxtx. > > I'll be preparing seperate patches for the changes I have and submitting > them to the list. > > I'll need to work with George to do a couple things: > > 1) break the patch into smaller pieces to isolate issues for discussion. > 2) work through the Line Status Register changes so it does not cause > problems on other systems. > > George: If you could do the first one, it would be greatly appreciated. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From netbeans at gatworks.com Sun Nov 18 16:20:02 2007 From: netbeans at gatworks.com (U. George) Date: Sun, 18 Nov 2007 18:20:02 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: Message-ID: <4740C8A2.6030908@gatworks.com> > I'll need to work with George to do a couple things: > > 1) break the patch into smaller pieces to isolate issues for discussion. > 2) work through the Line Status Register changes so it does not cause > problems on other systems. > > George: If you could do the first one, it would be greatly appreciated. there are ( probably ) 3 pieces: 1) the select() failure when the USB-serial device is unceremoniously unplugged ( causes rxtx to spin ) 2) TIOCSERGETLSR, need to have the simulation of it available for all os's . If the system has the capability, don't simulate for devices that have the capability. For devices that dont have the capability, but the OS still defines TIOCSERGETLSR, fall back to simulation. 3) I rearranged DEBUG ifdef's. This is probably the bulk of the patches. From tjarvi at qbang.org Sun Nov 18 18:26:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 18:26:26 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <4740C8A2.6030908@gatworks.com> References: <4740C8A2.6030908@gatworks.com> Message-ID: On Sun, 18 Nov 2007, U. George wrote: > >> I'll need to work with George to do a couple things: >> >> 1) break the patch into smaller pieces to isolate issues for discussion. >> 2) work through the Line Status Register changes so it does not cause >> problems on other systems. >> >> George: If you could do the first one, it would be greatly appreciated. > > there are ( probably ) 3 pieces: > 1) the select() failure when the USB-serial device is unceremoniously > unplugged ( causes rxtx to spin ) > 2) TIOCSERGETLSR, need to have the simulation of it available for all os's . > If the system has the capability, don't simulate for devices that have the > capability. For devices that dont have the capability, but the OS still > defines TIOCSERGETLSR, fall back to simulation. > 3) I rearranged DEBUG ifdef's. This is probably the bulk of the patches. > Hi George, I suspect if you do cvs update, there will be very few conflicts if any. While the list of fixes is fairly long, the changes are small. -- Trent Jarvi tjarvi at qbang.org From EdwardRF at xtremax.com Mon Nov 19 03:32:29 2007 From: EdwardRF at xtremax.com (Edward) Date: Mon, 19 Nov 2007 18:32:29 +0800 Subject: [Rxtx] Cannot Read under Windows XP Message-ID: <4741663D.4070200@xtremax.com> Hi Guys, I have a iTegno 3000 usb GSM modem, it is an usb-serial device. I am trying to use RXTX with it under Windows XP. The problem is it seems RXTX cannot read any data from it, but writing to it seems successful. I blindly issue a series of command to send off a SMS, it is successfully delivered, but neither the echo from the modem nor the "OK" response was received. I tried to connect to the modem directly using hyper terminal, there was no problem reading or writing. So can i assume it is not the driver problem? Then i turned to Serial Port Monitor for help, when I use hyper terminal, monitor shows both way traffic, and nothing abnormal, but when I connect using RXTX, only the data I sent to the modem is being detected, no input was detected. Does anyone else experience similar problem? Best Regards Edward From tjarvi at qbang.org Mon Nov 19 03:38:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Nov 2007 03:38:02 -0700 (MST) Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: <4741663D.4070200@xtremax.com> References: <4741663D.4070200@xtremax.com> Message-ID: On Mon, 19 Nov 2007, Edward wrote: > Hi Guys, > > I have a iTegno 3000 usb GSM modem, it is an usb-serial device. I am > trying to use RXTX with it under Windows XP. > The problem is it seems RXTX cannot read any data from it, but writing > to it seems successful. I blindly issue a series of command to send off > a SMS, it is successfully delivered, but neither the echo from the modem > nor the "OK" response was received. > > I tried to connect to the modem directly using hyper terminal, there was > no problem reading or writing. So can i assume it is not the driver problem? > > Then i turned to Serial Port Monitor for help, when I use hyper > terminal, monitor shows both way traffic, and nothing abnormal, but when > I connect using RXTX, only the data I sent to the modem is being > detected, no input was detected. > > Does anyone else experience similar problem? > Hi Edward, A common mistake is to send Strings to the modem which are i18n. You want to send the bytes. Examples of doing this are in the contrib directory with the sourcecode. ie SimpleSnuV1.java -- Trent Jarvi tjarvi at qbang.org From EdwardRF at xtremax.com Mon Nov 19 04:42:16 2007 From: EdwardRF at xtremax.com (Edward) Date: Mon, 19 Nov 2007 19:42:16 +0800 Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: References: <4741663D.4070200@xtremax.com> Message-ID: <47417698.3060705@xtremax.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071119/b0f08ba9/attachment-0001.html From netbeans at gatworks.com Mon Nov 19 06:31:30 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 19 Nov 2007 08:31:30 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: <4740C8A2.6030908@gatworks.com> Message-ID: <47419032.8080406@gatworks.com> Did the "make install". The install does not want to go to or use Makefiles's prefix = /usr/local/rxtx-devel Not terribly happy that it installed in /home/gat/JAVA/JDK14/j2sdk1.4.2_08/jre/lib/i386 Trent Jarvi wrote: > > I suspect if you do cvs update, there will be very few conflicts if any. > While the list of fixes is fairly long, the changes are small. > > -- > Trent Jarvi > tjarvi at qbang.org > > From Martin.Oberhuber at windriver.com Mon Nov 19 07:00:48 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 19 Nov 2007 15:00:48 +0100 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE6485848039986E6@ism-mail03.corp.ad.wrs.com> It's great to see things progressing - thanks Trent! I checked CVS, and it seems that most of the patch authors are yet missing from the AUTHORS file, is this intentional? The issues areound RXTXPort.close() are interesting for us in the context of Eclipse as well: https://bugs.eclipse.org/bugs/show_bug.cgi?id=208185#c3 I did a quick review and found some issues / comments: http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 http://bugzilla.qbang.org/show_bug.cgi?id=53#c9 Thanks for proposing CVS write access for me. I promise to use these thoughtfully, and discuss potential fixes openly (on bugzilla) before applying them [unless it's really trivial issues only like obvious Javadoc syntax or spelling errors]. Cheers, -- 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 Mon Nov 19 07:24:16 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 19 Nov 2007 15:24:16 +0100 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803998711@ism-mail03.corp.ad.wrs.com> Hi all, I think I've got a better version for RXTXCommDriver.checkSolaris(): http://bugzilla.qbang.org/show_bug.cgi?id=77#c3 Cheers, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From netbeans at gatworks.com Mon Nov 19 09:01:22 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 19 Nov 2007 11:01:22 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <47419032.8080406@gatworks.com> References: <4740C8A2.6030908@gatworks.com> <47419032.8080406@gatworks.com> Message-ID: <4741B352.8070205@gatworks.com> U. George wrote: > Did the "make install". The install does not want to go to or use > Makefiles's prefix = /usr/local/rxtx-devel > > Not terribly happy that it installed in > /home/gat/JAVA/JDK14/j2sdk1.4.2_08/jre/lib/i386 > Put libs and jar in MY preferential places. Ran application. And it loves to spin. Deja gnu all over again. :-/ It did find the avail /dev/ttyUSB0 port connected to LINUX usbserial/pl2303 device driver. Now to find the spin. and apply simpler set of patches From tjarvi at qbang.org Mon Nov 19 10:14:38 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Nov 2007 10:14:38 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <4741B352.8070205@gatworks.com> References: <4740C8A2.6030908@gatworks.com> <47419032.8080406@gatworks.com> <4741B352.8070205@gatworks.com> Message-ID: On Mon, 19 Nov 2007, U. George wrote: > U. George wrote: >> Did the "make install". The install does not want to go to or use >> Makefiles's prefix = /usr/local/rxtx-devel >> >> Not terribly happy that it installed in >> /home/gat/JAVA/JDK14/j2sdk1.4.2_08/jre/lib/i386 >> > Put libs and jar in MY preferential places. Ran application. And it loves to > spin. Deja gnu all over again. :-/ > > It did find the avail /dev/ttyUSB0 port connected to LINUX usbserial/pl2303 > device driver. > > Now to find the spin. and apply simpler set of patches > Hi George, When the prefix code was stomped on and the library was installed in the jre, It wasnt clear how the layout would end up looking. I'm still not sure. My usual attack was to dump a jdk onto the filesystem, set JAVA_HOME and install. When I was done, I would nuke the jdk. Obviously that may not be what people want but I'm not sure a prefix is enough to let us know what they do want. For a shared library prefix /usr/local means the library goes in /usr/local/lib. What would it mean for the jar and shared library in Java? -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Nov 19 10:24:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Nov 2007 10:24:08 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <460801A4097E3D4CA04CC64EE6485848039986E6@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848039986E6@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 19 Nov 2007, Oberhuber, Martin wrote: > > I checked CVS, and it seems that most of the patch > authors are yet missing from the AUTHORS file, > is this intentional? > There isn't a hard rule covering who goes into AUTHORS. If I recognize a person from previous patches, I try to make sure they are in. Everyone contributing (authors) is in the ChangeLog with what they did going all the way back to the first release. AUTHORS is more of a summary of what they did after a few submissions. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Nov 19 11:39:51 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 19 Nov 2007 13:39:51 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: <4740C8A2.6030908@gatworks.com> <47419032.8080406@gatworks.com> <4741B352.8070205@gatworks.com> Message-ID: <4741D877.80203@gatworks.com> For me, the makefile/prefix = /usr/local sorta suggest thats where the libs/bins/jars/... should eventually wind up. If a user does not like /usr/local, then a quick change would put it somewhere else. At this moment I dont care where the jar winds up ( in lib, or a jar directory ). So I like to keep the jre/sdk directory protected from meddling, and changes. But if a user has a penchant to use 'java -jar', then the RXTXcomm.jar file should be stuffed with the other jre/sdk jar files. From ajmas at sympatico.ca Mon Nov 19 11:54:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 19 Nov 2007 13:54:29 -0500 Subject: [Rxtx] CVS updates and closed bugs Message-ID: <20071119185429.SPYK18413.tomts22-srv.bellnexxia.net@smtp1.sympatico.ca> On this day in November "U. George" wrote: > > For me, the makefile/prefix = /usr/local sorta suggest thats where the > libs/bins/jars/... should eventually wind up. > If a user does not like /usr/local, then a quick change would put it > somewhere else. At this moment I dont care where the jar winds up ( in > lib, or a jar directory ). > So I like to keep the jre/sdk directory protected from meddling, and > changes. > But if a user has a penchant to use 'java -jar', then the RXTXcomm.jar > file should be stuffed with the other jre/sdk jar files. It should be noted that some platforms, such as MacOS X might have different conventions. In the case of MacOS X there are two 'correct' places for Java libraries that aren't part of an application: - /Library/Java/Extensions/ - ~/Library/Java/Extensions/ Andre From keithvz at verizon.net Thu Nov 1 08:08:58 2007 From: keithvz at verizon.net (Keith) Date: Thu, 01 Nov 2007 10:08:58 -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: <4729DDFA.7080206@verizon.net> Trent Jarvi wrote: > 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? Well, I honestly don't know how all this fits together. I think it's just a matter of enabling the right flow control option within the standard serial framework to tell the device driver, "HEY START USING DTR/DSR FOR FLOW CONTROL." If what UGeorge said,(about that type of nitty-gritty lead control being done within the device driver), is true, then this confirms my suspicion. I tried narrowing down within the Linux drivers what you are looking for, but I can't entirely tell wth I'm looking at. (virtual com port drivers -- they are included compiled by default with Ubuntu, source included) http://www.ftdichip.com/Drivers/VCP/Linux/ftdi_sio.tar.gz Hahahaa, they make a reference to DTR flow control being supported but say (UGH) in parenthesis. You can also use their direct device driver library on Ubuntu -- libftd2xx.so.0.4.13. No source code. http://www.ftdichip.com/Drivers/D2XX/Linux/libftd2xx0.4.13.tar.gz In that case, you make a call to their FT_SetFlowControl() function. FT_STATUS FT_SetFlowControl (FT_HANDLE ftHandle, USHORT usFlowControl, UCHAR uXon,UCHAR uXoff) Parameters ftHandle Handle of the device. usFlowControl Must be one of FT_FLOW_NONE, FT_FLOW_RTS_CTS, ****FT_FLOW_DTR_DSR**** or FT_FLOW_XON_XOFF. uXon Character used to signal Xon. Only used if flow control is FT_FLOW_XON_XOFF. uXoff Character used to signal Xoff. Only used if flow control is FT_FLOW_XON_XOFF. This is from their programming guide http://www.ftdichip.com/Documents/ProgramGuides/D2XXPG34.pdf I actually want to take this a step further and say that I think the flow control is actually handled right on the device itself in hardware/firmware. It's enabled through the device driver, but I think the maintaining of buffers, asserting/deasserting of leads, etc is handled by the device. For the time being, I've switched to jd2xx, https://jd2xx.dev.java.net/ and http://bleyer.org/jd2xx/ These are Java wrappers for the device driver libraries. It allows almost direct access to the well-documented device drivers from Java. I hope this helps Keith From tjarvi at qbang.org Thu Nov 1 11:09:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:09:51 -0600 (MDT) 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: Hi Martin, What I usually have done is allow changes that do not impact working software including changes to methods not documented in CommAPI (which remain undocumented in rxtx) and fixes to known problems in the documented portions. That way if you use the documented API, the releases should only become better with time. If you use the undocumented portions, the behavior is not as predictable but open for improvement. On Wed, 31 Oct 2007, 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 >> > From tjarvi at qbang.org Thu Nov 1 11:15:52 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:15:52 -0600 (MDT) 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: I too use rxtx in commercial products. The problem I've been trying to address while bringing the server back was how to make it possible for hobby folks to build the same software as companies so we can move rxtx along a little faster. Exposing internal tools is not an option at this time, the public rxtx builds have been done on my home machine which has drives hanging out of it all over the place dying one at a time. This isn't maintainable. I'm currently looking at the possibility of making an S3 image available on Amazon's EC. These are machines you can rent for ~10 cents an hour which is more than enough to build rxtx. The S3 image is not changed when people use it so everyone has the same starting point. With this, we could all build rxtx for ~20 platforms for a small price and eliminate tool issues. On Wed, 31 Oct 2007, Greg Johnson wrote: > 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 tjarvi at qbang.org Thu Nov 1 11:19:55 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:19:55 -0600 (MDT) 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: On Wed, 31 Oct 2007, 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. I was helping Dmitry do the Mac OS X port without access to a machine when we put that in. In the archives there is information (easily found with google on Apple's site) that describes how their API (and others) can determine if a port is used and ignore it. I think these changes are in CVS but need to confirm. The bottom line is that rxtx should not have used lock files on Mac. It was just ignorance of the system on my part. -- Trent Jarvi tjarvi at qbang.org From fabioanjos at gmail.com Thu Nov 1 12:35:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Thu, 1 Nov 2007 15:35:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Hi, I was using SerialEventListener in my project. But, as was said here, id doesnt work very well with virtual serial ports. So, I changed the strategy using the code posted here in this thread: try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > 0) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } The thing is that in my tests I could notice that in.read(buffer) never blocks. Even when there's nothing to read. Instead of blocking when there's nothing to read it returns 0. So, my questions are: 1. Am I doing something wrong? 2. If not, wouldnt this decrease performance? (the thread would be locked in a loop that does nothing.) 3. Is there a better way to do the job? Thanks in advance!! F?bio -------- On 10/31/07, Andre-John Mas wrote: > > > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/0aee59d0/attachment-0020.html From ajmas at sympatico.ca Thu Nov 1 16:07:55 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Nov 2007 18:07:55 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Message-ID: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From sarah_662005 at yahoo.com Thu Nov 1 17:10:05 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Thu, 1 Nov 2007 16:10:05 -0700 (PDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Message-ID: <351433.37166.qm@web55814.mail.re3.yahoo.com> Thank you very much for your help. Now the application works fine. the serialEvent gets triggered. Rxtx is cool! ----- Original Message ---- From: Andre-John Mas To: Sara Hugh ; RXTX Developers and Users Sent: Wednesday, October 31, 2007 9:55:45 AM Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered 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 __________________________________________________ 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/20071101/4a86bea6/attachment-0020.html From tjarvi at qbang.org Thu Nov 1 17:58:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 17:58:02 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx Message-ID: The rxtx.org site is primarily interested in the hobby aspects of rxtx. Obviously, there are some companies following the work too. These interests bring larger workflows and concerns about details hobby folks may not care about. They also bring many more users. I know the company I work for has a quality engineering effort going on which includes rxtx. While the server was down, I was contacted by another company that was missing the binaries for their testing. Several people have mentioned concerns about a stable release for like reasons. Would there be interest on the quality side of the coin to get together? It could be just sharing email's with each other or a seperate list for QE/QA. I can not say for sure, but we may be able to share some of our efforts/results that could help keep rxtx releases stable. -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Fri Nov 2 01:42:55 2007 From: scldad at sdc.com.au (Stephen Davies) Date: Fri, 2 Nov 2007 18:12:55 +1030 Subject: [Rxtx] Multiple modems Message-ID: <200711021812.56047.scldad@sdc.com.au> This may or may not be related to the Multiple Ports thread. I have an application which uses rxtx on Linux (via cron jobs) to connect multiple modems to remote sensing devices. The application works fine most of the time but occasionally fails to connect if two (or more) connection attempts happen at about the same time. When it fails, it looks as if it may get confused as to which port it is talking to. The app has a "base" component that looks for an available port, opens it and then creates an input thread and an output thread for the connection and data transfer. The "base" component uses this code: // loop round all known ports until one is available. Give up after three minutes Counter ptimeout = new Counter(); while(!portFound && ptimeout.elapsed() < 180000) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // special case. ttyS0 is not available to us on this server. if (!portId.isCurrentlyOwned() && !portId.getName().equals("/dev/ttyS0")) { gLog.debug(lognm + ": Found port " + portId.getName()); try { serialPort = (RXTXPort) portId.open("AguaModem", 10000); } catch (Exception e) { gLog.error(lognm + ": Port " + portId.getName() + " will not open."); gLog.error(e.getMessage()); continue; } AguaModem aguamodem = new AguaModem(); portFound = true; break; } gLog.debug(lognm + ": Port " + portId.getName() + " is busy"); } } } I am wondering about the isCurrentlyOwned method. Does this actually tell me whether a port is currently being used by another process? TIA, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From fabioanjos at gmail.com Fri Nov 2 04:59:58 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 07:59:58 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Message-ID: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/9009eb1d/attachment-0020.html From netbeans at gatworks.com Fri Nov 2 06:28:13 2007 From: netbeans at gatworks.com (U. George) Date: Fri, 02 Nov 2007 08:28:13 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <472B17DD.1050508@gatworks.com> It should normally block ( unless eof / event ) . so its a :{ whats the device ( to recreate if possible ) and how do u open. > My question is, is there a way to make in.read block the thead until > there's something to read? > From fabioanjos at gmail.com Fri Nov 2 06:34:46 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 09:34:46 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > On 11/1/07, Andre-John Mas wrote: > > > > Fabio, > > > > Turns out there was a small error in my example. The test should be: > > > > (numBytes = in.read(buffer)) > -1 > > > > This is because -1 indicates an end of file (end of data stream) > > > > Andre > > > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > > > Hi, > > > > > > I was using SerialEventListener in my project. But, as was said > > > here, id doesnt work very well with virtual serial ports. > > > So, I changed the strategy using the code posted here in this thread: > > > > > > try{ > > > in = port.getInputStream(); > > > out = port.getOutputStream(); > > > int numBytes = 0; > > > while(active){ > > > > > > byte[] buffer = new byte[10]; > > > > > > while ( (numBytes = in.read(buffer)) > 0) > > > { > > > String dataValue = new String(buffer,0,numBytes); > > > processInput(dataValue); > > > } > > > > > > if(numBytes==-1){ > > > break; > > > } > > > > > > Thread.sleep(50); > > > } > > > > > > }catch(IOException e){ > > > logger.info("falha de comunicacao "+ > > > getReceptor().getPort() ); > > > > > > }catch(InterruptedException e){ > > > logger.info ("Interrompendo leitura da porta "+ > > > getReceptor().getPort() ); > > > } > > > > > > The thing is that in my tests I could notice that in.read(buffer) > > > never blocks. Even when there's nothing to read. Instead of blocking > > > when there's nothing to read it returns 0. > > > > > > So, my questions are: > > > > > > 1. Am I doing something wrong? > > > 2. If not, wouldnt this decrease performance? (the thread would be > > > locked in a loop that does nothing.) > > > 3. Is there a better way to do the job? > > > > > > Thanks in advance!! > > > > > > F?bio > > > -------- > > > > > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > > 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 > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > > > > > -- > > > Atenciosamente, > > > F?bio Cristiano dos Anjos > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/5306c4b1/attachment-0020.html From nick.circelli at infrasafe.com Fri Nov 2 07:01:17 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Fri, 2 Nov 2007 08:01:17 -0500 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com><29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com><90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca><29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Message-ID: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> I'm pretty sure that not blocking has to do with you virtual ports. Cause it should block. Maybe you should try: while ((numBytes = in.available()) > 0) { If (numBytes > buffer.length) { numBytes = buffer.length; // in case you have buffer overflow } numBytes = in.read(buffer, 0 , numBytes)); String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } Also, just for optimization, I'd move that byte[] buffer = new byte[10]; out of the while since you don't need to reallocate it every iteration. ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of F?bio Cristiano dos Anjos Sent: Friday, November 02, 2007 8:35 AM To: RXTX Developers and Users Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream (); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas < ajmas at sympatico.ca > wrote: Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info ("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Atenciosamente, F?bio Cristiano dos Anjos -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/4de7f6a3/attachment-0020.html From fabioanjos at gmail.com Fri Nov 2 07:36:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 10:36:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> Message-ID: <29788b250711020636q1588c88fgaa5e27f5504164fb@mail.gmail.com> Hi Nick, Actually, it doesnt block for physical ports too. And, the method avaiable does not block either, so when there's nothing avaiable the loop ends and the thread stops lintening to the port. But I did some more test with serialEventListener, and now its working. I realy dont know what I've done to get it working. I just start woking as soon as I decided to test it again. It was said here that serialEventListener is not reliable for virtual serial ports. Is there another way to read it, without compromising performance? Tanks again!! F?bio ------- On 11/2/07, Nick Circelli wrote: > > I'm pretty sure that not blocking has to do with you virtual ports. > Cause it should block. > > Maybe you should try: > > > > while ((numBytes = in.available()) > 0) > > { > > If (numBytes > buffer.length) { > > numBytes = buffer.length; // in case you have buffer overflow > > } > > numBytes = in.read(buffer, 0 , numBytes)); > > String dataValue = new String(buffer,0,numBytes,"ASCII"); > > processInput(dataValue); > > } > > > > Also, just for optimization, I'd move that byte[] buffer = new > byte[10]; > > out of the while since you don't need to reallocate it every iteration. > > > ------------------------------ > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On Behalf > Of *F?bio Cristiano dos Anjos > *Sent:* Friday, November 02, 2007 8:35 AM > *To:* RXTX Developers and Users > *Subject:* Re: [Rxtx] serialEvent(SerialPortEvent event) never be > triggered > > > > Hi, > > I think i missunderstand something here. > The code you post here was meant to be used inside serialEvent method, > right? > > The think is, that i cannot user SerialEventListener to read serial ports, > because i need to read virual serial ports and id does not behaves well, as > said here before. serialEvent is never triggered. > > So what I quit using SerialEventListener and created a thread to listen to > the port: > > public void run(){ > try{ > in = port.getInputStream(); > out = port.getOutputStream (); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new > String(buffer,0,numBytes,"ASCII"); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ getReceptor().getPort() > ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > } > > > So, the problem is that in.read(buffer) always returns 0 when there is > nothing to read, instead of blocking the flow, and the thread becames locked > in the loop. > > I hope you can help me solve this. > > Thanks in advance! > > F?bio > -------- > > On 11/2/07, *F?bio Cristiano dos Anjos* wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > > > On 11/1/07, *Andre-John Mas* < ajmas at sympatico.ca> wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info ("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/571df6ea/attachment-0019.html From tjarvi at qbang.org Fri Nov 2 08:32:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Nov 2007 08:32:15 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: References: Message-ID: On Fri, 2 Nov 2007, Greg Johnson wrote: > Hi Trent, folks, > Having a single rxtx that is suitable for commercial uses and hobbyists both > would be a great idea? Perhaps it would be worth submitting rxtx as a > proposal to Codehaus - they not only provide excellent tools (Jira (bug > tracker), Confluence (wiki)) but also support build management ( > maestro, continuum, bamboo). Relying on your personal machine (btw, frii.com > / rxtx.org is down again?) seems like a burden you shouldn't have to shoulder > alone. Hi Greg, There may be a little confusion here. There is no need to have two seperate rxtx releases. What I'm trying to encourage is a discussion between some of the people responsible for making sure rxtx does not break their products each release. Usually these people are interested in testing a set of functionality their product depends upon. They do not work with rxtx code but rather traps to catch when rxtx developers break something. This goes on all the time in isolated labs. There are many services that offer to do various pieces of a project for you if you... Anyone is free to do the 'if you' portion with rxtx and see how it goes. I'm actually interested in doing less of that than more. The rxtx.org work I do just happens to overlap with other things I do for personal/family use. The reason I suggest the amazon solution is that anyone can take full control of the environment for a day and it costs less than a package of gum without causing harm to what anyone else is doing. I assume the down question was with respect to a mod_security setting that has been resolved. If not, please post a url to the problem. -- Trent Jarvi tjarvi at qbang.org From nsayer at kfu.com Sat Nov 3 20:17:49 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 19:17:49 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? Message-ID: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Has anyone got RXTX working with an app under Leopard? My app hangs on port open (it works fine with Tiger). The relevant thread looks like this in the activity monitor: 1536 JVM_InvokeMethod 1536 0x48ccd0 1536 0x46f8a0 1536 0x4c3ff4 1536 0x4c4284 1536 0x357d160 1536 0x357faac 1536 Java_gnu_io_RXTXPort_open 1536 open $NOCANCEL$UNIX2003 1536 open $NOCANCEL$UNIX2003 From ajmas at sympatico.ca Sat Nov 3 22:02:04 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 00:02:04 -0400 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> RXTX works for me with Leopard. I am currently using it communicate with a Bluetooth GPS. What computer and device are you trying to use? Is the driver for your serial device compatible with MacOS X 10.5? Andre On 3-Nov-07, at 22:17 , Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From nsayer at kfu.com Sat Nov 3 22:17:47 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 21:17:47 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> Message-ID: <1720F723-3643-438C-B3AB-E09A67536977@kfu.com> On Nov 3, 2007, at 9:02 PM, Andre-John Mas wrote: > RXTX works for me with Leopard. I am currently using it communicate > with a Bluetooth GPS. > > What computer and device are you trying to use? Is the driver for > your serial device compatible with MacOS X 10.5? An Intel mac mini The FTDI USB serial driver an XMPCR, which is just a fancy serial controlled radio and an FTDI usb-to-serial chip I've successfully used the FTDI driver with another FTDI device in another context. > > > Andre > > On 3-Nov-07, at 22:17 , Nick Sayer wrote: > >> Has anyone got RXTX working with an app under Leopard? >> >> My app hangs on port open (it works fine with Tiger). The relevant >> thread looks like this in the activity monitor: >> >> 1536 JVM_InvokeMethod >> 1536 0x48ccd0 >> 1536 0x46f8a0 >> 1536 0x4c3ff4 >> 1536 0x4c4284 >> 1536 0x357d160 >> 1536 0x357faac >> 1536 >> Java_gnu_io_RXTXPort_open >> 1536 open >> $NOCANCEL$UNIX2003 >> 1536 open >> $NOCANCEL$UNIX2003 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From racecar at gmail.com Sat Nov 3 22:25:53 2007 From: racecar at gmail.com (Kevin Mateo Lim) Date: Sat, 3 Nov 2007 21:25:53 -0700 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: Message-ID: I am alternating between two errors. After i run the macosx_setup.command, "everyone" is set to Read only in /var/lock. I notice in the terminal that the group for these perms is _uucp, not uucp. In that state, I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 check_group_uucp(): error testing lock file creation Error details:Permission deniedcheck_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException : Error inside Serial.() at processing.serial.Serial.errorMessage(Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.( Serial.java:102) at Temporary_829_3245.setup(Temporary_829_3245.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java :690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) Then, I hand edit the "everyone" permissions for /var/lock/ to Read and Write (note /var/spool/uucp is Read/Write in all cases, and doesn't change). I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX uucp_lock() /var/lock/LK.003.009.000 is there gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException: Error inside Serial.() at processing.serial.Serial.errorMessage (Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.(Serial.java:102) at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java:690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) See here: http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071103/f1a2c467/attachment-0018.html From greg.johnson at manchester.ac.uk Sun Nov 4 02:31:13 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sun, 4 Nov 2007 10:31:13 +0100 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <28B5E0A0-0802-4C74-AC21-87ED35F3B9A2@manchester.ac.uk> Hi Nick, I also had problems initially with Leopard, but it was resolved by reinstalling the serial USB driver (FTDI in my case). The symptoms were a non-detection of any ports (but I twigged when I tried ZTerm and it had the same problem). Good luck! Cheers, greg PS I did a "Archive and install" which may be the reason my FTDI driver had disappeared - I don't think the driver has changed for 10.5 ------------------------------------------------------------------------- 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 4 Nov 2007, at 03:17, Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Sun Nov 4 13:01:12 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 15:01:12 -0500 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: Message-ID: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Hi, You will need to get the 2.1-8 code from CVS. See the FAQ for more information: http://rxtx.qbang.org/wiki/index.php/FAQ Andre On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > I am alternating between two errors. > > After i run the macosx_setup.command, "everyone" is set to Read only > in /var/lock. I notice in the terminal that the group for these > perms is _uucp, not uucp. > > In that state, I get this error: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > check_group_uucp(): error testing lock file creation Error > details:Permission deniedcheck_lock_status: No permission to create > lock file. > please see: How can I use Lock Files with rxtx? in INSTALL > gnu.io.PortInUseException: Unknown Application > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > java.lang.RuntimeException : Error inside Serial.() > > at processing.serial.Serial.errorMessage(Serial.java:583) > > at processing.serial.Serial.(Serial.java:148) > > at processing.serial.Serial.( Serial.java:102) > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > at processing.core.PApplet.run(PApplet.java:1556) > > at java.lang.Thread.run(Thread.java:613) > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > and Write (note /var/spool/uucp is Read/Write in all cases, and > doesn't change). I get this error: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > gnu.io.PortInUseException: Unknown Application > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > java.lang.RuntimeException: Error inside Serial.() > > at processing.serial.Serial.errorMessage (Serial.java:583) > > at processing.serial.Serial.(Serial.java:148) > > at processing.serial.Serial.(Serial.java:102) > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > at processing.core.PApplet.run(PApplet.java:1556) > > at java.lang.Thread.run(Thread.java:613) > > See here: > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From netbeans at gatworks.com Sun Nov 4 14:33:35 2007 From: netbeans at gatworks.com (U. George) Date: Sun, 04 Nov 2007 16:33:35 -0500 Subject: [Rxtx] #ifndef TIOCSERGETLSR Message-ID: <472E3AAF.7050709@gatworks.com> For Linux, it seems that you need the code for both *having* a TIOCSERGETLSR, and *not having* a TIOCSERGETLSR. Maybe the ioctl exists system wide, but not necessarily for the device driver itself ( always returns -1 ) . Are there systems that have a *functioning* TIOCSERGETLSR for all their devices? Then this would be the case where the "#ifndef TIOCSERGETLSR" directive could be useful is eliminating the unnecessary code and tests. And for those systems that dont have a TIOCSERGETLSR, then the code for TIOCSERGETLSR can be eliminated. It would be a simple case to have, as a foundation, all the code to simulate the missing TIOCSERGETLSR ioctl. If the system does have the ioctl, then that code can be ifdef'd in, and co-exist with the functionality of the code that simulates the missing TIOCSERGETLSR ioctl. From racecar at gmail.com Sun Nov 4 17:30:19 2007 From: racecar at gmail.com (Kevin Mateo Lim) Date: Sun, 4 Nov 2007 17:30:19 -0700 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: the README.OSX reads: Put libSerial.jnilib in the directory of the application (the JavaVM will find it there). Add RXTXComm.jar to the application classpath or include the classes in the application jar. (Some applications already include the RXTX classes in their application jar, in which case only the file libSerial.jnilib is required). I can't find libSerial.jnilib I put librxtxSerial.jnilib into my Processing /libraries/serial/library/ directory. Yet it still sees the old version: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 On 11/4/07, Andre-John Mas wrote: > > Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > 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/20071104/c0a83f91/attachment-0017.html From ajmas at sympatico.ca Sun Nov 4 17:41:47 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 19:41:47 -0500 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> If you are wanting it to be available for all applications, - for all users: /Library/Java/Extensions - for your user: ~/Library/Java/Extensions Or just for your application, then it should be in the same directory from which yo are launching your application. If you are getting the 2.1-8 source, then the library built is called: librxtxSerial.jnilib despite what the docs say. Andre On 4-Nov-07, at 19:30 , Kevin Mateo Lim wrote: > > the README.OSX reads: > Put > libSerial.jnilib > in the directory of the application (the JavaVM will find it there). > Add > RXTXComm.jar > to the application classpath or include the classes in the > application jar. > (Some applications already include the RXTX classes in their > application jar, > in which case only the file libSerial.jnilib is required). > > > I can't find libSerial.jnilib > I put librxtxSerial.jnilib into my Processing /libraries/serial/ > library/ directory. > > Yet it still sees the old version: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > On 11/4/07, Andre-John Mas wrote: Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial .(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay (PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > From bschlining at gmail.com Sun Nov 4 19:46:23 2007 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 4 Nov 2007 18:46:23 -0800 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> Message-ID: > > Or just for your application, then it should be in the same directory > from which yo are launching your application. Just wanted to add one more way of specifying the native lib location... If you don't want to define it globally by putting it in /Library/Java/Extensions (and you don't, it's a very very bad practice) you can also specify the location of the native library when starting the JVM by specifying the 'java.library.path' property. For example: java -Djava.library.path=/Path/To/Directory/With/RXTX/Library YourMainClass -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071104/c5af6980/attachment-0017.html From greg.johnson at manchester.ac.uk Mon Nov 5 01:39:02 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Mon, 5 Nov 2007 09:39:02 +0100 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: The 2.1-8 code reports 2.1-7, hence your (and my) confusion. But as long as you've removed all traces of the old library, it really _is_ 2.1-8. And if you specify the library path to the VM, don't make my mistake (on OSX at least) - you need to respecify the entire library path it had by default, as the command line argument replaces the path, rather than appending to it. 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 5 Nov 2007, at 01:30, Kevin Mateo Lim wrote: > > the README.OSX reads: > Put > libSerial.jnilib > in the directory of the application (the JavaVM will find it there). > Add > RXTXComm.jar > to the application classpath or include the classes in the > application jar. > (Some applications already include the RXTX classes in their > application jar, > in which case only the file libSerial.jnilib is required). > > > I can't find libSerial.jnilib > I put librxtxSerial.jnilib into my Processing /libraries/serial/ > library/ directory. > > Yet it still sees the old version: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > On 11/4/07, Andre-John Mas wrote: > Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial .(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay (PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > 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 HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071105/7f50506d/attachment-0017.html From cyrille.dumont at tatexpress.fr Mon Nov 5 05:46:03 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 05 Nov 2007 13:46:03 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: References: <472727F1.1000704@tatexpress.fr> Message-ID: <472F108B.2090101@tatexpress.fr> Thanks a lot for your solution ... but I'm not a expert in JAVA ... (sorry) For the moment I've this function : """ public void serialEvent(SerialPortEvent e) { StringBuffer inputBuffer = new StringBuffer(); int newData = 0; switch (e.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } //-- Manag. Data from Scanner this.MngDataScanner(inputBuffer.toString()); break; case SerialPortEvent.BI:; //-- Break Received } } """ How can I do what you write ? ( maybe a simple ex ? ) PS : I don't know the PDF417 size (could be, for example, 338 char, or 500 ... ; what I know is that it can't be more than 800 char) Thanks in advance. Best regards. Trent Jarvi a ?crit : > 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 Martin.Oberhuber at windriver.com Mon Nov 5 08:47:50 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 5 Nov 2007 16:47:50 +0100 Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> Hi Trent, are the interestes of hobbyists really so different from commercial ones? Both should be interested in high quality and innovation the like. I haven't seen too many Open Source projects from the "inside" but those that I have seen did not have separate mailing lists for quality/testing/qa versus innovation/development. What I have seen with the Open Source projects that one would call "successful" is a good deal of process around automated builds, automated unit tests, predictable release dates and milestones, and policies around commiting/contributing/reviewing changes. I think that all of these benefit commercial users and hobbyists the like. If you were just asking about who's interested in discussing changes to foster more quality, count me in. I'm just not sure whether discussing these on a separate mailing list or other channel is the right thing to do. Cheers, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From toupsz at cs.tamu.edu Tue Nov 6 14:27:04 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 15:27:04 -0600 Subject: [Rxtx] reading TTL level signals from serial? Message-ID: Dear RXTX community- I've been using RXTX to handle communicating with several hardware devices in Java (a GPS and some custom audio circuitry for my dissertation work). I have a new, high-accuracy GPS which only communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there any way to communicate with this device using RXTX, perhaps by modding the native code for Windows? If so, does anyone have any tips on how to do it? Has it perhaps already been done? Another option is for me to invert / amplify the signal in hardware, but this is difficult for me to pull off due to the sensitivity of the electronics involved...I'll likely end up using a much less accurate piece of equipment rather than go that far! If anyone could help out, I'd really appreciate it! Thanks! -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/b6c59c2b/attachment-0015.html From netbeans at gatworks.com Tue Nov 6 14:55:22 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 06 Nov 2007 16:55:22 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: Message-ID: <4730E2CA.3090009@gatworks.com> This is really a hardware issue. Is there any device ( ie the serial port ) on your computer that will accept the voltage signals ( and load ) that your device produces? Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it happen safely ( ie u dont cook the GPS device ) I have a new, high-accuracy GPS which only > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there > any way to communicate with this device using RXTX, From toupsz at cs.tamu.edu Tue Nov 6 15:14:01 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 16:14:01 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4730E2CA.3090009@gatworks.com> References: <4730E2CA.3090009@gatworks.com> Message-ID: Actually, the device runs over USB, but shows up as a virtual serial port and is outputting these signals. The software that comes with the device (a u-blox ANTARIS 4 eval kit) is able to communicate. RXTX is able to detect and properly configure the port, but does not get any of the data from it. :-/ It seems like there must be some way to do it (obviously, ublox knows how)... -Zach On Nov 6, 2007 3:55 PM, U. George wrote: > This is really a hardware issue. > Is there any device ( ie the serial port ) on your computer that will > accept the voltage signals ( and load ) that your device produces? > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it > happen safely ( ie u dont cook the GPS device ) > > > I have a new, high-accuracy GPS which only > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there > > any way to communicate with this device using RXTX, > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/15ae7a0b/attachment-0015.html From keithvz at verizon.net Tue Nov 6 16:16:55 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 06 Nov 2007 18:16:55 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> Message-ID: <4730F5E7.1030704@verizon.net> Zach Toups wrote: > On Nov 6, 2007 3:55 PM, U. George > wrote: > > This is really a hardware issue. > Is there any device ( ie the serial port ) on your computer that will > accept the voltage signals ( and load ) that your device produces? > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it > happen safely ( ie u dont cook the GPS device ) > > > I have a new, high-accuracy GPS which only > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is > there > > any way to communicate with this device using RXTX, > _______________________________________________ As UGeorge intimated, it's a hardware issue. If your device outputs TTL level voltages, and your USB to serial converter is RS-232, then you've got a physical hardware differences. Inverted leads and voltage issues are mainly the problem. MAXIM makes a neat little chip called the MAX233 (better than the 232, no extern caps required) You can't solve this in software. Now, there are TTL level compatible USB to serial converters available, I happen to be using one right now. This unit below is from a UK company (there might be sources in the US) http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm Parallax makes one that does 3.3 and 5v http://www.parallax.com/detail.asp?product_id=32201 (but only supports RX, TX, GND, AND DTR towards device) (i've tested a variant of the unit above, and it works with RXTX) In both cases, you'll need some creative wiring depending on the interface on your GPS. Hope this helps Keith From toupsz at cs.tamu.edu Tue Nov 6 16:53:01 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 17:53:01 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4730F5E7.1030704@verizon.net> References: <4730E2CA.3090009@gatworks.com> <4730F5E7.1030704@verizon.net> Message-ID: Yeah...I used an FTDI chip to handle USB/serial conversion on the audio equipment I built. I'm leery of trying to build a board for this ublox GPS due to all the grounding/shielding issues around it. Anyway, I apreciate the help...just sad that I can't handle the problem in software! Ublox did send me the source code for their USB drivers...but as a Java programmer, it's a bit tough for me to sort out. ;) Thanks again! -Zach On Nov 6, 2007 5:16 PM, Keith Monahan wrote: > Zach Toups wrote: > > > On Nov 6, 2007 3:55 PM, U. George > > wrote: > > > > This is really a hardware issue. > > Is there any device ( ie the serial port ) on your computer that > will > > accept the voltage signals ( and load ) that your device produces? > > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make > it > > happen safely ( ie u dont cook the GPS device ) > > > > > > I have a new, high-accuracy GPS which only > > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is > > there > > > any way to communicate with this device using RXTX, > > _______________________________________________ > > As UGeorge intimated, it's a hardware issue. > > If your device outputs TTL level voltages, and your USB to serial > converter is RS-232, then you've got a physical hardware differences. > Inverted leads and voltage issues are mainly the problem. MAXIM makes a > neat little chip called the MAX233 (better than the 232, no extern caps > required) > > You can't solve this in software. > > Now, there are TTL level compatible USB to serial converters available, > I happen to be using one right now. > > This unit below is from a UK company (there might be sources in the US) > > http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm > > Parallax makes one that does 3.3 and 5v > > http://www.parallax.com/detail.asp?product_id=32201 > (but only supports RX, TX, GND, AND DTR towards device) > > (i've tested a variant of the unit above, and it works with RXTX) > > In both cases, you'll need some creative wiring depending on the > interface on your GPS. > > Hope this helps > > Keith > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/06e88ad4/attachment-0015.html From netbeans at gatworks.com Tue Nov 6 17:14:01 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 06 Nov 2007 19:14:01 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> <4730F5E7.1030704@verizon.net> Message-ID: <47310349.5000406@gatworks.com> what gps chipset do u have? > Ublox did send me the source code for their USB drivers...but as a Java > programmer, it's a bit tough for me to sort out. ;) From Steffen.DETTMER at ingenico.com Wed Nov 7 03:10:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 7 Nov 2007 11:10:01 +0100 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> Message-ID: <20071107101000.GN10978@elberon.bln.de.ingenico.com> * Zach Toups wrote on Tue, Nov 06, 2007 at 16:14 -0600: > Actually, the device runs over USB, but shows up as a virtual > serial port and is outputting these signals. Ahh, so what you want is to use rxtx on the serial port that is created by the driver and mapped maybe as some COM8 or whatever? I this case then IMHO it would be no hardware question but maybe a problem in your application, or some driver or indeed a rxtx issue. > The software that > comes with the device (a u-blox ANTARIS 4 eval kit) is able to > communicate. Is it sure that this software is really using the virtual serial port and only this port? oki, Steffen -- About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Wed Nov 7 04:59:10 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 06:59:10 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <20071107101000.GN10978@elberon.bln.de.ingenico.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> Message-ID: <4731A88E.6080705@gatworks.com> >> The software that >> comes with the device (a u-blox ANTARIS 4 eval kit) is able to >> communicate. > > Is it sure that this software is really using the virtual serial > port and only this port? > I have tried to read the docs. I have yet to find any explanation on a (windoz) device driver for this device ( the usb device ). That magic is not explained. For a developer thats important magic. Maybe a call to their support team is in order? From netbeans at gatworks.com Wed Nov 7 05:01:38 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 07:01:38 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <20071107101000.GN10978@elberon.bln.de.ingenico.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> Message-ID: <4731A922.7@gatworks.com> Steffen DETTMER wrote: > * Zach Toups wrote on Tue, Nov 06, 2007 at 16:14 -0600: >> Actually, the device runs over USB, but shows up as a virtual BTW: it seems that I am not getting all the Rxtx mail. Is there still a problem? From toupsz at cs.tamu.edu Wed Nov 7 07:36:20 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Wed, 7 Nov 2007 08:36:20 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4731A88E.6080705@gatworks.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> <4731A88E.6080705@gatworks.com> Message-ID: When I emailed them about this issue, they sent me their WinCE drivers, which are apparently based on this open source driver: http://www.yetanotherhomepage.com/j7xx/j7xx.html?/j7xx/software/util/usbdriver.html These include srcdll, and x86 subfolders, though it's not 100% clear to me that these are useful. The ublox communication suite appears to only communicate with serial ports...I've communicated with the ublox on two different comm ports (one with the serial adapter plugged into the serial port, one with the main USB connection), as well as a Garmin bluetooth GPS (which comes up as a bluetooth serial device). I'm not well versed in code this close to the hardware, but it seems to me that if you're running a virtual serial port, then you're virtually controlling the "voltages" that come in on this "port"...so why would they be "ttl level"? :-/ Shouldn't the USB driver be able to interpret the signals in whatever way it wants and just supply software with the binary interpretation? Thanks for all the help, guys, it's really appreciated! -Zach On Nov 7, 2007 5:59 AM, U. George wrote: > > >> The software that > >> comes with the device (a u-blox ANTARIS 4 eval kit) is able to > >> communicate. > > > > Is it sure that this software is really using the virtual serial > > port and only this port? > > > > I have tried to read the docs. I have yet to find any explanation on a > (windoz) device driver for this device ( the usb device ). That magic > is not explained. For a developer thats important magic. Maybe a call > to their support team is in order? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071107/18a13314/attachment-0014.html From netbeans at gatworks.com Wed Nov 7 08:55:55 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 10:55:55 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> <4731A88E.6080705@gatworks.com> Message-ID: <4731E00B.9030902@gatworks.com> There are 2 components to talking to hardware. There is the electrical specification, and then there is the software specification. there is the rs232 specification, parallel port specification, and the USB electrical specification. Generally these are used to plug in the various devices, and hook up electrically. Then there is the software side. There is the device driver, a software component that sits somewhere in the kernel that handles the USB ( in your case ) controller. The device driver generally does not care about the electrical component. There are various chips that handle USB signals, and these chips have I/O addresses so that signals and data can be properly routed. There is also the side that communicates to the user via the COM port device-name. The device driver that you mentioned is for the "Support PL2303 serial chip". This device driver, which hopefully works, handles the USB chip, and eventually recognzes the gps device, and hopefully creates an COM port so the user can open up and communicate. These are a lot of "HOPES". Since u have the web address of the device driver, and developer, I would think that the developer, and any docs, might be better able to help u to first determine if the GPS device is recognized, and the COM port ( maybe its called by another name ) is created, as per documentation. > > These include srcdll, and x86 subfolders, though it's not 100% clear to > me that these are useful. From tjarvi at qbang.org Sat Nov 10 17:46:13 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Nov 2007 17:46:13 -0700 (MST) Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 5 Nov 2007, Oberhuber, Martin wrote: > Hi Trent, > > are the interestes of hobbyists really so different > from commercial ones? Both should be interested in > high quality and innovation the like. > > I haven't seen too many Open Source projects from the > "inside" but those that I have seen did not have > separate mailing lists for quality/testing/qa > versus innovation/development. > > What I have seen with the Open Source projects that > one would call "successful" is a good deal of > process around automated builds, automated unit > tests, predictable release dates and milestones, > and policies around commiting/contributing/reviewing > changes. > > I think that all of these benefit commercial users > and hobbyists the like. > > If you were just asking about who's interested in > discussing changes to foster more quality, count > me in. I'm just not sure whether discussing these > on a separate mailing list or other channel is the > right thing to do. > Hi Martin, There are two issues I'm thinking about. The first is the generic unit testing and quality initiatives required to move rxtx forward. The second is the inevitable fact that rxtx connects to external hardware. The discussion deals with a different set of problems. Here is a simple example of what I'm getting at. We have the capability of setting custom baud rates in rxtx. We may be interested in seeing regressions in rxtx, the C library or the kernel. Some people may be doing some tests with loopback connections. These will always work even if the baud rate is not set to the expected value. Some people may use null modems between two ports. This may be able to catch the problem but not always. Will the build machines be able to test this? (no - for a few reasons) Will people be trying to catch these type of regressions? (yes) What type of coverage does the community have in the end? (?) We could include the discussions in the same list or another equally open list that may be of interest to some folks that deal with these types of problems on a regular basis. -- Trent Jarvi tjarvi at qbang.org From timlow84 at gmail.com Mon Nov 12 00:31:17 2007 From: timlow84 at gmail.com (Timothy Low) Date: Mon, 12 Nov 2007 15:31:17 +0800 Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> Message-ID: <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> ---------- Forwarded message ---------- From: Timothy Low Date: Nov 12, 2007 3:02 PM Subject: Building RXTX From Source To: taj at www.linux.org.uk Cc: ferdinand.tang at tangs.net, Timothy Low , chweehuat.ng at tangs.net Hi Trent, I tried building RXTX from source, and I got this error. I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm trying to get the necessary ".so" files to use for my serial port communication through java. My linux kernal information is: *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 x86_64 x86_64 x86_64 GNU/Linux* I'll most glad if you can provide me some direction on this. Thanks ! ---------------- [root at smsgateway rxtx-2.0-7pre1]# ./configure checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu configure: WARNING: Trying libtool. If the following fails install libtool checking for gcc... gcc checking for C compiler default output... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking for ld used by GCC... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking for a sed that does not truncate output... /bin/sed checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking command to parse /usr/bin/nm -B output... ok checking how to run the C preprocessor... gcc -E checking for egrep... grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for ranlib... ranlib checking for strip... strip checking for objdir... .libs checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.lo... yes checking if gcc supports -fno-rtti -fno-exceptions... yes checking whether the linker (/usr/bin/ld) supports shared libraries... yes checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking dynamic linker characteristics... GNU/Linux ld.so checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no checking whether -lc should be explicitly linked in... no creating libtool checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking for style of include used by make... GNU checking dependency style of gcc... none checking fcntl.h usability... yes checking fcntl.h presence... yes checking for fcntl.h... yes checking sys/fcntl.h usability... yes checking sys/fcntl.h presence... yes checking for sys/fcntl.h... yes checking sys/file.h usability... yes checking sys/file.h presence... yes checking for sys/file.h... yes checking sys/time.h usability... yes checking sys/time.h presence... yes checking for sys/time.h... yes checking sys/signal.h usability... yes checking sys/signal.h presence... yes checking for sys/signal.h... yes checking signal.h usability... yes checking signal.h presence... yes checking for signal.h.. . yes checking termios.h usability... yes checking termios.h presence... yes checking for termios.h... yes checking asm/termbits.h usability... yes checking asm/termbits.h presence... yes checking for asm/termbits.h... yes checking grp.h usability... yes checking grp.h presence... yes checking for grp.h... yes checking pwd.h usability... yes checking pwd.h presence... yes checking for pwd.h... yes checking whether gcc needs -traditional... no checking whether to enable maintainer-specific portions of Makefiles... no /usr/java/jdk1.5.0_13 configure: WARNING: using JAVA_HOME environmental variable adjusted java.home is /usr/java/jdk1.5.0_13 checking os.name Linux checking os.arch i386 checking java.vendor Sun Microsystems Inc. checking java.version 1.5.0_13 checking os.version 2.6.18-8.el5xen comm.jar appears to be installed already. conftest.c: In function 'main': conftest.c:6: warning: incompatible implicit declaration of built-in function 'printf' conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:6: error: (Each undeclared identifier is reported only once conftest.c:6: error: for each function it appears in.) conftest.c:6: error: expected ')' before string constant conftest.c:7: warning: incompatible implicit declaration of built-in function 'exit' ./configure: line 9649: ./conftest: No such file or directory ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected conftest.c: In function 'main': conftest.c:5: warning: incompatible implicit declaration of built-in function 'printf' conftest.c:10: warning: incompatible implicit declaration of built-in function 'exit' configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status : config.h is unchanged config.status: executing depfiles commands [root at smsgateway rxtx-2.0-7pre1]# make install /usr/java/jdk1.5.0_13/bin/javac -classpath .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d /home/jboss/sources/rxtx- 2.0-7pre1/ -O /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java /home/jboss/sources/rxtx-2.0-7pre1/./src/UnSupportedLoggerException.java /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o /home/jboss/sources/rxtx-2.0-7pre1/x86_64-unknown-linux-gnu/SerialImp.lo /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'init_threads': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: cast from pointer to integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_nativeDrain': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: cast to pointer from integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'read_byte_array': /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: cast to pointer from integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_readArray': /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: comparison is always false due to limited range of data type /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_readTerminatedArray': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: comparison is always false due to limited range of data type mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial- 2.0.7pre1.* gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so -o .libs/librxtxSerial-2.0.7pre1.so (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.0.7pre1.so librxtxSerial.so) creating librxtxSerial.la (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la librxtxSerial.la) gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/ParallelImp.lo /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function 'Java_javax_comm_LPRPort_readArray': /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: comparison is always false due to limited range of data type rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* .libs/librxtxParallel-2.0.7pre1.* gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so -o .libs/librxtxParallel- 2.0.7pre1.so (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.0.7pre1.so librxtxParallel.so) creating librxtxParallel.la (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la librxtxParallel.la) make all-am make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' libtool: install: `x86_64-unknown-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 ------------- Regards, Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071112/27758c3c/attachment-0010.html From tjarvi at qbang.org Mon Nov 12 01:02:09 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Nov 2007 01:02:09 -0700 (MST) Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> Message-ID: On Mon, 12 Nov 2007, Timothy Low wrote: > > Hi Trent, Hi Tim, Comments are inline. As I mentioned off the list, rxtx 2.0 is on the edge of deprecation. We can get it working but this is not the path of least resistance for future work. You will probably need to bounce another round of questions off the list. The following is intended to isolate the problem. > > I tried building RXTX from source, and I got this error. > > > I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm trying > to get the necessary ".so" files to use for my serial port communication > through java. > My linux kernal information is: > > *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 x86_64 > x86_64 x86_64 GNU/Linux* > > I'll most glad if you can provide me some direction on this. Thanks ! > > ---------------- > [root at smsgateway rxtx-2.0-7pre1]# ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > checking for C compiler default output... a.out > checking whether the C compiler works... yes > checking whether we are cross compiling... no > checking for suffix of executables... > checking for suffix of object files... o > checking whether we are using the GNU C compiler... yes > checking whether gcc accepts -g... yes > checking for gcc option to accept ANSI C... none needed > checking for ld used by GCC... /usr/bin/ld > checking if the linker (/usr/bin/ld) is GNU ld... yes > checking for /usr/bin/ld option to reload object files... -r > checking for BSD-compatible nm... /usr/bin/nm -B > checking for a sed that does not truncate output... /bin/sed > checking whether ln -s works... yes > checking how to recognise dependent libraries... pass_all > checking command to parse /usr/bin/nm -B output... ok > checking how to run the C preprocessor... gcc -E > checking for egrep... grep -E > checking for ANSI C header files... yes > checking for sys/types.h... yes > checking for sys/stat.h... yes > checking for stdlib.h... yes > checking for string.h... yes > checking for memory.h... yes > checking for strings.h... yes > checking for inttypes.h... yes > checking for stdint.h... yes > checking for unistd.h... yes > checking dlfcn.h usability... yes > checking dlfcn.h presence... yes > checking for dlfcn.h... yes > checking for ranlib... ranlib > checking for strip... strip > checking for objdir... .libs > checking for gcc option to produce PIC... -fPIC > checking if gcc PIC flag -fPIC works... yes > checking if gcc static flag -static works... yes > checking if gcc supports -c -o file.o... yes > checking if gcc supports -c -o file.lo... yes > checking if gcc supports -fno-rtti -fno-exceptions... yes > checking whether the linker (/usr/bin/ld) supports shared libraries... yes > checking how to hardcode library paths into programs... immediate > checking whether stripping libraries is possible... yes > checking dynamic linker characteristics... GNU/Linux ld.so > checking if libtool supports shared libraries... yes > checking whether to build shared libraries... yes > checking whether to build static libraries... no > checking whether -lc should be explicitly linked in... no > creating libtool > checking for a BSD-compatible install... /usr/bin/install -c > checking whether build environment is sane... yes > checking for gawk... gawk > checking whether make sets $(MAKE)... yes > checking for style of include used by make... GNU > checking dependency style of gcc... none > checking fcntl.h usability... yes > checking fcntl.h presence... yes > checking for fcntl.h... yes > checking sys/fcntl.h usability... yes > checking sys/fcntl.h presence... yes > checking for sys/fcntl.h... yes > checking sys/file.h usability... yes > checking sys/file.h presence... yes > checking for sys/file.h... yes > checking sys/time.h usability... yes > checking sys/time.h presence... yes > checking for sys/time.h... yes > checking sys/signal.h usability... yes > checking sys/signal.h presence... yes > checking for sys/signal.h... yes > checking signal.h usability... yes > checking signal.h presence... yes > checking for signal.h.. . yes > checking termios.h usability... yes > checking termios.h presence... yes > checking for termios.h... yes > checking asm/termbits.h usability... yes > checking asm/termbits.h presence... yes > checking for asm/termbits.h... yes > checking grp.h usability... yes > checking grp.h presence... yes > checking for grp.h... yes > checking pwd.h usability... yes > checking pwd.h presence... yes > checking for pwd.h... yes > checking whether gcc needs -traditional... no > checking whether to enable maintainer-specific portions of Makefiles... no > /usr/java/jdk1.5.0_13 > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /usr/java/jdk1.5.0_13 > checking os.name Linux > checking os.arch i386 > checking java.vendor Sun Microsystems Inc. > checking java.version 1.5.0_13 > checking os.version 2.6.18-8.el5xen > comm.jar appears to be installed already. > conftest.c: In function 'main': > conftest.c:6: warning: incompatible implicit declaration of built-in > function 'printf' > conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:6: error: (Each undeclared identifier is reported only once > conftest.c:6: error: for each function it appears in.) > conftest.c:6: error: expected ')' before string constant This is an outdated kernel version check for when headers and kernels could cause problems for rxtx. If we made it past this, then you are OK. > conftest.c:7: warning: incompatible implicit declaration of built-in > function 'exit' > ./configure: line 9649: ./conftest: No such file or directory > ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected It blew up but continues.. > conftest.c: In function 'main': > conftest.c:5: warning: incompatible implicit declaration of built-in > function 'printf' > conftest.c:10: warning: incompatible implicit declaration of built-in > function 'exit' > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status : config.h is unchanged > config.status: executing depfiles commands > [root at smsgateway rxtx-2.0-7pre1]# make install > /usr/java/jdk1.5.0_13/bin/javac -classpath > .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d > /home/jboss/sources/rxtx- 2.0-7pre1/ -O > /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java > /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/UnSupportedLoggerException.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java > Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or > overrides a deprecated API. > Note: Recompile with -Xlint:deprecation for details. > /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* The java jar should be fine now. You may need to change the source files as mentioned below. > gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. > -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g > -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o > /home/jboss/sources/rxtx-2.0-7pre1/x86_64-unknown-linux-gnu/SerialImp.lo > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'init_threads': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: cast > from pointer to integer of different size > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_nativeDrain': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: cast to > pointer from integer of different size > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'read_byte_array': > /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: cast to > pointer from integer of different size As I recall, this was caused by pointers (now 64 bit rather than 32 bit) being stored in java ints (jints). I would look at the diff between the CVS 2.1 SerialImp.c and RXTXPort.java files against 2.0. We did fix those issues. You have a .so file but the different pointer sizes will cause runtime errors. > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_readArray': > /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: > comparison is always false due to limited range of data type > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_readTerminatedArray': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: > comparison is always false due to limited range of data type > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial- > 2.0.7pre1.* > gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so -o > .libs/librxtxSerial-2.0.7pre1.so > (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.0.7pre1.so > librxtxSerial.so) > creating librxtxSerial.la > (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la > librxtxSerial.la) > gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. > -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g > -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o > /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/ParallelImp.lo > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function > 'Java_javax_comm_LPRPort_readArray': > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: > comparison is always false due to limited range of data type > rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* > .libs/librxtxParallel-2.0.7pre1.* > gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so -o > .libs/librxtxParallel- 2.0.7pre1.so > (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.0.7pre1.so > librxtxParallel.so) > creating librxtxParallel.la > (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la > librxtxParallel.la) > make all-am > make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' > make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' > libtool: install: `x86_64-unknown-linux-gnu' must be an absolute directory > name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 A libtool change? Assuming you ran configure && make install in /home/jboss/sources/rxtx- 2.0-7pre1, libtool is looking for /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/.libs/librxtxSerial-2.0.7pre1.so. I think you have this? The file is just being copied to ~JAVA/jre/lib/$(JAVA_ARCH). -- Trent Jarvi tjarvi at qbang.org From sarah_662005 at yahoo.com Mon Nov 12 16:10:28 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Mon, 12 Nov 2007 15:10:28 -0800 (PST) Subject: [Rxtx] [urgent] device's power off detection Message-ID: <766782.10076.qm@web55803.mail.re3.yahoo.com> Hello all, I have a small application built on top of rxtx api. This application can retrieve the incoming data from a device through a port. The device can be powered off after the port get closed from the application. I have been trying a couple of hours to find a way to detect the power switching from device. If anyone knows how to handle it through rxtx, could you please give me a help? Thank you very much. r, Sara ____________________________________________________________________________________ Get easy, one-click access to your favorites. Make Yahoo! your homepage. http://www.yahoo.com/r/hs -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071112/4599f3ec/attachment-0009.html From netbeans at gatworks.com Mon Nov 12 17:52:22 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 12 Nov 2007 19:52:22 -0500 Subject: [Rxtx] [urgent] device's power off detection In-Reply-To: <766782.10076.qm@web55803.mail.re3.yahoo.com> References: <766782.10076.qm@web55803.mail.re3.yahoo.com> Message-ID: <4738F546.5010101@gatworks.com> Not sure what u are asking for. Are u asking for a way to detect if the device is OFF? Are u asking how to power off the device - via software ? Is it a Serial device? is it a parallel device? is it a usb device? Sara Hugh wrote: > Hello all, > I have a small application built on top of rxtx api. This application > can retrieve the incoming data from a device through a port. The device > can be powered off after the port get closed from the application. I > have been trying a couple of hours to find a way to detect the power > switching from device. If anyone knows how to handle it through rxtx, > could you please give me a help? Thank you very much. From tjarvi at qbang.org Mon Nov 12 22:48:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Nov 2007 22:48:11 -0700 (MST) Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711120225x562db8cbxb750767ade3b0d73@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> <900c6ba90711120031p66edc001ted76f7ba24e34b98@mail.gmail.com> <900c6ba90711120225x562db8cbxb750767ade3b0d73@mail.gmail.com> Message-ID: Hi Tim, The gnu.io namespace looks just like the javax.comm 2.0 namespace. There are additional (discouraged) undocumented methods in gnu.io that you need not use. We just used the different namespace to avoid poluting Sun's by mistake and to make sure we stayed off any potential licensing related radar. Usuaully, you just change your imports and make sure you do not use the javax.comm namespace for anything like exception handling. As I mentioned off the list, there are no issues with rxtx going through the JSR process to be more Sun friendly other than time. rxtx has no hidden intentions there; anything that does not work like CommAPI 2.0 documented is a bug. The reason we do not support CommAPI 2.1 is technical in nature and is in the list archives as well as the front page of www.rxtx.org. On Mon, 12 Nov 2007, Timothy Low wrote: > Hi Trent, > > I'll move to use a JDK1.5 64-bit version... but do I need to make any source > code changes to use the package (gnu.io) in the RTXTcomm.jar instead of the > ones from the javacomm api ? > > > Regards, > Tim > > On Nov 12, 2007 5:22 PM, Trent Jarvi wrote: > >> >> Hi Tim, >> >> I see a couple things here. >> >> First your jdk is for i686 yet the library is compiled on a x86_64 >> machine. You may try passing configure the --target=i686-unknown-linux to >> try using the i686 backend to gcc if it is available. Or move to the 64 >> bit jdk. >> >> The other error I see is again the moved UTF_RELEASE define that we need >> to fix. You can probably get around that with: >> >> make -DUTF_RELEASE=`uname -r` >> >> even more simple would be to just specify the serial library which should >> be in configure --help. >> >> You can remove the UTF_RELEASE check from configure by editing >> configure.in, searching for the simple C program check and deleting it. >> Running autoconf after that will regenerate a new configure without the >> check. >> >> Note that you should remove the previous native libraries >> (librxtxSerial.so) when moving from rxtx 2.0 to 2.1. These are compiled >> for different namespaces (javax.comm/gnu.io). >> >> On Mon, 12 Nov 2007, Timothy Low wrote: >> >>> *Hi Trent, >>> >>> I moved on to rxtx 2.1.7r2, and updated my jre to 1.6.0 (64-bit)... I >> tried >>> the following 2 methods: >>> >>> (1) using the rxtx 2.1.7 binaries from the RXTX website* >>> *Are these binaries suitable for a 64-bit OS ? There mentioning of the >>> gnu.io that you've talked about previously...* >>> ------ >>> [root at smsgateway sources]# java -Djava.library.path=/usr/lib PortLister >>> Experimental: JNI_OnLoad called. >>> >>> java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion >>> ()Ljava/lang/String; >>> at gnu.io.RXTXCommDriver.nativeGetVersion(Native Method) >>> at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:85) >>> at java.lang.Class.forName0(Native Method) >>> at java.lang.Class.forName(Unknown Source) >>> at javax.comm.CommPortIdentifier.loadDriver( >> CommPortIdentifier.java >>> :237) >>> at javax.comm.CommPortIdentifier.(CommPortIdentifier.java >>> :109) >>> at PortLister.(PortLister.java:6) >>> at PortLister.main(PortLister.java:25) >>> Exception in thread "main" java.lang.UnsatisfiedLinkError: >>> com.sun.comm.SunrayInfo.isSessionActive()Z >>> at com.sun.comm.SunrayInfo.isSessionActive(Native Method) >>> at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java >> :155) >>> at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java >>> :100) >>> at javax.comm.CommPortIdentifier.(CommPortIdentifier.java >>> :138) >>> at PortLister.(PortLister.java:6) >>> at PortLister.main(PortLister.java:25) >>> >>> ------ >>> >>> (2) compiling the rxtx 2.1.7 from source >>> *but i got the following error while running ./configure and make all* >>> >>> ------ >>> [root at smsgateway rxtx-2.1-7r2]# ./configure >>> checking build system type... x86_64-unknown-linux-gnu >>> checking host system type... x86_64-unknown-linux-gnu >>> checking target system type... x86_64-unknown-linux-gnu >>> configure: WARNING: Trying libtool. If the following fails install >> libtool >>> checking for gcc... gcc >>> checking for C compiler default output file name... a.out >>> checking whether the C compiler works... yes >>> checking whether we are cross compiling... no >>> checking for suffix of executables... >>> checking for suffix of object files... o >>> checking whether we are using the GNU C compiler... yes >>> checking whether gcc accepts -g... yes >>> checking for gcc option to accept ANSI C... none needed >>> checking for a sed that does not truncate output... /bin/sed >>> checking for egrep... grep -E >>> checking for ld used by gcc... /usr/bin/ld >>> checking if the linker (/usr/bin/ld) is GNU ld... yes >>> checking for /usr/bin/ld option to reload object files... -r >>> checking for BSD-compatible nm... /usr/bin/nm -B >>> checking whether ln -s works... yes >>> checking how to recognise dependent libraries... pass_all >>> checking how to run the C preprocessor... gcc -E >>> checking for ANSI C header files... yes >>> checking for sys/types.h... yes >>> checking for sys/stat.h... yes >>> checking for stdlib.h... yes >>> checking for string.h... yes >>> checking for memory.h... yes >>> checking for strings.h... yes >>> checking for inttypes.h... yes >>> checking for stdint.h... yes >>> checking for unistd.h... yes >>> checking dlfcn.h usability... yes >>> checking dlfcn.h presence... yes >>> checking for dlfcn.h... yes >>> checking for g++... g++ >>> checking whether we are using the GNU C++ compiler... yes >>> checking whether g++ accepts -g... yes >>> checking how to run the C++ preprocessor... g++ -E >>> checking for g77... no >>> checking for f77... no >>> checking for xlf... no >>> checking for frt... no >>> checking for pgf77... no >>> checking for fort77... no >>> checking for fl32... no >>> checking for af77... no >>> checking for f90... no >>> checking for xlf90... no >>> checking for pgf90... no >>> checking for epcf90... no >>> checking for f95... f95 >>> checking whether we are using the GNU Fortran 77 compiler... yes >>> checking whether f95 accepts -g... yes >>> checking the maximum length of command line arguments... 32768 >>> checking command to parse /usr/bin/nm -B output from gcc object... ok >>> checking for objdir... .libs >>> checking for ar... ar >>> checking for ranlib... ranlib >>> checking for strip... strip >>> checking if gcc static flag works... yes >>> checking if gcc supports -fno-rtti -fno-exceptions... no >>> checking for gcc option to produce PIC... -fPIC >>> checking if gcc PIC flag -fPIC works... yes >>> checking if gcc supports -c -o file.o... yes >>> checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking whether -lc should be explicitly linked in... no >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> checking if libtool supports shared libraries... yes >>> checking whether to build shared libraries... yes >>> checking whether to build static libraries... no >>> configure: creating libtool >>> appending configuration tag "CXX" to libtool >>> checking for ld used by g++... /usr/bin/ld -m elf_x86_64 >>> checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes >>> checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking for g++ option to produce PIC... -fPIC >>> checking if g++ PIC flag -fPIC works... yes >>> checking if g++ supports -c -o file.o... yes >>> checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> appending configuration tag "F77" to libtool >>> checking if libtool supports shared libraries... yes >>> checking whether to build shared libraries... yes >>> checking whether to build static libraries... no >>> checking for f95 option to produce PIC... -fPIC >>> checking if f95 PIC flag -fPIC works... yes >>> checking if f95 supports -c -o file.o... yes >>> checking whether the f95 linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> checking for a BSD-compatible install... /usr/bin/install -c >>> checking whether build environment is sane... yes >>> checking for gawk... gawk >>> checking whether make sets $(MAKE)... yes >>> checking for style of include used by make... GNU >>> checking dependency style of gcc... none >>> checking dependency style of g++... none >>> checking fcntl.h usability... yes >>> checking fcntl.h presence... yes >>> checking for fcntl.h... yes >>> checking sys/fcntl.h usability... yes >>> checking sys/fcntl.h presence... yes >>> checking for sys/fcntl.h... yes >>> checking sys/file.h usability... yes >>> checking sys/file.h presence... yes >>> checking for sys/file.h... yes >>> checking sys/time.h usability... yes >>> checking sys/time.h presence... yes >>> checking for sys/time.h... yes >>> checking sys/signal.h usability... yes >>> checking sys/signal.h presence... yes >>> checking for sys/signal.h... yes >>> checking signal.h usability... yes >>> checking signal.h presence... yes >>> checking for signal.h... yes >>> checking termios.h usability... yes >>> checking termios.h presence... yes >>> checking for termios.h... yes >>> checking grp.h usability... yes >>> checking grp.h presence... yes >>> checking for grp.h... yes >>> checking pwd.h usability... yes >>> checking pwd.h presence... yes >>> checking for pwd.h... yes >>> checking whether gcc needs -traditional... no >>> checking whether to enable maintainer-specific portions of Makefiles... >> no >>> /usr/java/jdk1.5.0_13 >>> configure: WARNING: using JAVA_HOME environmental variable >>> adjusted java.home is /usr/java/jdk1.5.0_13 >>> checking os.name Linux >>> checking os.arch i386 >>> checking java.vendor Sun Microsystems Inc. >>> checking java.version 1.5.0_13 >>> checking os.version 2.6.18-8.el5xen >>> conftest.c: In function 'main': >>> conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this >> function) >>> conftest.c:8: error: (Each undeclared identifier is reported only once >>> conftest.c:8: error: for each function it appears in.) >>> conftest.c:8: error: expected ')' before string constant >>> ./configure: line 21462: ./conftest: No such file or directory >>> ./configure: line 21462: test: 2.6.18-8.el5xen: unary operator expected >>> configure: creating ./config.status >>> config.status: creating Makefile >>> config.status: creating config.h >>> config.status: executing depfiles commands >>> [root at smsgateway rxtx-2.1-7r2]# make install >>> /usr/java/jdk1.5.0_13/bin/javac -classpath .:/home/jboss/sources/rxtx- >>> >> 2.1-7r2:/home/jboss/sources/rxtx-2.1-7r2/src:/usr/java/jdk1.5.0_13/jre/lib/ext/RXTXcomm.jar-d >>> /home/jboss/sources/rxtx- >>> 2.1-7r2/ -O -source 1.3 -target 1.3 >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommDriver.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortEnumerator.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortIdentifier.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortOwnershipListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Configure.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2C.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/I2CPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/LPRPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/NoSuchPortException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/PortInUseException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Raw.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/RawPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RawPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RawPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/RS485PortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485PortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485Port.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXCommDriver.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXVersion.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPort.java >>> /home/jboss/sources/rxtx-2.1-7r2 >> /./src/UnsupportedCommOperationException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/UnSupportedLoggerException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Zystem.java >>> /usr/java/jdk1.5.0_13/bin/javah -classpath .:/home/jboss/sources/rxtx- >>> >> 2.1-7r2:/home/jboss/sources/rxtx-2.1-7r2/src:/usr/java/jdk1.5.0_13/jre/lib/ext/RXTXcomm.jar-d >>> x86_64-unknown-linux-gnu -jni `(for i in CommDriver CommPortEnumerator >>> CommPortIdentifier CommPort CommPortOwnershipListener Configure I2C >>> I2CPortEvent I2CPortEventListener I2CPort LPRPort NoSuchPortException >>> ParallelPortEvent ParallelPortEventListener ParallelPort >> PortInUseException >>> Raw RawPortEvent RawPortEventListener RawPort RS485 RS485PortEvent >>> RS485PortEventListener RS485Port RXTXCommDriver RXTXPort RXTXVersion >>> SerialPortEvent SerialPortEventListener SerialPort >>> UnsupportedCommOperationException UnSupportedLoggerException Zystem;do \ >>> if grep > /dev/null native.*\( /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/$i.java; then \ >>> echo gnu.io.$i; \ >>> fi; \ >>> done)` >>> /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialImp.c -o >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo; >>> \ >>> if [ "Serial" = "Serial" ]; >>> then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxSerial.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxSerial.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo; >> \ >>> fi; \ >>> ) >>> mkdir /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/.libs >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/SerialImp.o >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/fuserImp.o >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c: In function >> 'show_user': >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c:238: warning: cast >> from >>> pointer to integer of different size >>> gcc -shared /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/SerialImp.o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/fuserImp.o >>> -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7.so -o >> .libs/librxtxSerial- >>> 2.1-7.so >>> (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.1-7.so >>> librxtxSerial.so) >>> creating librxtxSerial.la >>> (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la >>> librxtxSerial.la) >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelImp.c -o >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/ParallelImp.lo; >>> \ >>> if [ "Parallel" = "Serial" ]; >>> then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxParallel.la -rpath >>> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/ParallelImp.lo >>> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxParallel.la -rpath >>> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/ParallelImp.lo; >>> \ >>> fi; \ >>> ) >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >>> /x86_64-unknown-linux-gnu/.libs/ParallelImp.o >>> gcc -shared /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/ParallelImp.o >>> -lpthread -Wl,-soname -Wl,librxtxParallel-2.1-7.so -o >>> .libs/librxtxParallel-2.1-7.so >>> (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.1-7.so >>> librxtxParallel.so) >>> creating librxtxParallel.la >>> (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la >>> librxtxParallel.la) >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo; >>> \ >>> if [ "I2C" = "Serial" ]; then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxI2C.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo >>> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxI2C.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo; >>> \ >>> fi; \ >>> ) >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/.libs/I2CImp.o >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c: In function >>> 'Java_gnu_io_I2CPort_Initialize': >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: 'UTS_RELEASE' >>> undeclared (first use in this function) >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: (Each >> undeclared >>> identifier is reported only once >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: for each >> function >>> it appears in.) >>> libtool: link: `/home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/I2CImp.lo' >>> is not a valid libtool object >>> make: *** [x86_64-unknown-linux-gnu/librxtxI2C.la] Error 1 >>> >>> ------ >>> >>> >>> >>> On Nov 12, 2007 4:02 PM, Trent Jarvi wrote: >>> >>>> On Mon, 12 Nov 2007, Timothy Low wrote: >>>>> >>>>> Hi Trent, >>>> >>>> Hi Tim, >>>> >>>> Comments are inline. As I mentioned off the list, rxtx 2.0 is on the >> edge >>>> of deprecation. We can get it working but this is not the path of >> least >>>> resistance for future work. >>>> >>>> You will probably need to bounce another round of questions off the >> list. >>>> The following is intended to isolate the problem. >>>> >>>>> >>>>> I tried building RXTX from source, and I got this error. >>>>> >>>>> >>>>> I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm >>>> trying >>>>> to get the necessary ".so" files to use for my serial port >> communication >>>>> through java. >>>>> My linux kernal information is: >>>>> >>>>> *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 >>>> x86_64 >>>>> x86_64 x86_64 GNU/Linux* >>>>> >>>>> I'll most glad if you can provide me some direction on this. Thanks ! >>>>> >>>>> ---------------- >>>>> [root at smsgateway rxtx-2.0-7pre1]# ./configure >>>>> checking build system type... x86_64-unknown-linux-gnu >>>>> checking host system type... x86_64-unknown-linux-gnu >>>>> checking target system type... x86_64-unknown-linux-gnu >>>>> configure: WARNING: Trying libtool. If the following fails install >>>> libtool >>>>> checking for gcc... gcc >>>>> checking for C compiler default output... a.out >>>>> checking whether the C compiler works... yes >>>>> checking whether we are cross compiling... no >>>>> checking for suffix of executables... >>>>> checking for suffix of object files... o >>>>> checking whether we are using the GNU C compiler... yes >>>>> checking whether gcc accepts -g... yes >>>>> checking for gcc option to accept ANSI C... none needed >>>>> checking for ld used by GCC... /usr/bin/ld >>>>> checking if the linker (/usr/bin/ld) is GNU ld... yes >>>>> checking for /usr/bin/ld option to reload object files... -r >>>>> checking for BSD-compatible nm... /usr/bin/nm -B >>>>> checking for a sed that does not truncate output... /bin/sed >>>>> checking whether ln -s works... yes >>>>> checking how to recognise dependent libraries... pass_all >>>>> checking command to parse /usr/bin/nm -B output... ok >>>>> checking how to run the C preprocessor... gcc -E >>>>> checking for egrep... grep -E >>>>> checking for ANSI C header files... yes >>>>> checking for sys/types.h... yes >>>>> checking for sys/stat.h... yes >>>>> checking for stdlib.h... yes >>>>> checking for string.h... yes >>>>> checking for memory.h... yes >>>>> checking for strings.h... yes >>>>> checking for inttypes.h... yes >>>>> checking for stdint.h... yes >>>>> checking for unistd.h... yes >>>>> checking dlfcn.h usability... yes >>>>> checking dlfcn.h presence... yes >>>>> checking for dlfcn.h... yes >>>>> checking for ranlib... ranlib >>>>> checking for strip... strip >>>>> checking for objdir... .libs >>>>> checking for gcc option to produce PIC... -fPIC >>>>> checking if gcc PIC flag -fPIC works... yes >>>>> checking if gcc static flag -static works... yes >>>>> checking if gcc supports -c -o file.o... yes >>>>> checking if gcc supports -c -o file.lo... yes >>>>> checking if gcc supports -fno-rtti -fno-exceptions... yes >>>>> checking whether the linker (/usr/bin/ld) supports shared libraries... >>>> yes >>>>> checking how to hardcode library paths into programs... immediate >>>>> checking whether stripping libraries is possible... yes >>>>> checking dynamic linker characteristics... GNU/Linux ld.so >>>>> checking if libtool supports shared libraries... yes >>>>> checking whether to build shared libraries... yes >>>>> checking whether to build static libraries... no >>>>> checking whether -lc should be explicitly linked in... no >>>>> creating libtool >>>>> checking for a BSD-compatible install... /usr/bin/install -c >>>>> checking whether build environment is sane... yes >>>>> checking for gawk... gawk >>>>> checking whether make sets $(MAKE)... yes >>>>> checking for style of include used by make... GNU >>>>> checking dependency style of gcc... none >>>>> checking fcntl.h usability... yes >>>>> checking fcntl.h presence... yes >>>>> checking for fcntl.h... yes >>>>> checking sys/fcntl.h usability... yes >>>>> checking sys/fcntl.h presence... yes >>>>> checking for sys/fcntl.h... yes >>>>> checking sys/file.h usability... yes >>>>> checking sys/file.h presence... yes >>>>> checking for sys/file.h... yes >>>>> checking sys/time.h usability... yes >>>>> checking sys/time.h presence... yes >>>>> checking for sys/time.h... yes >>>>> checking sys/signal.h usability... yes >>>>> checking sys/signal.h presence... yes >>>>> checking for sys/signal.h... yes >>>>> checking signal.h usability... yes >>>>> checking signal.h presence... yes >>>>> checking for signal.h.. . yes >>>>> checking termios.h usability... yes >>>>> checking termios.h presence... yes >>>>> checking for termios.h... yes >>>>> checking asm/termbits.h usability... yes >>>>> checking asm/termbits.h presence... yes >>>>> checking for asm/termbits.h... yes >>>>> checking grp.h usability... yes >>>>> checking grp.h presence... yes >>>>> checking for grp.h... yes >>>>> checking pwd.h usability... yes >>>>> checking pwd.h presence... yes >>>>> checking for pwd.h... yes >>>>> checking whether gcc needs -traditional... no >>>>> checking whether to enable maintainer-specific portions of >> Makefiles... >>>> no >>>>> /usr/java/jdk1.5.0_13 >>>>> configure: WARNING: using JAVA_HOME environmental variable >>>>> adjusted java.home is /usr/java/jdk1.5.0_13 >>>>> checking os.name Linux >>>>> checking os.arch i386 >>>>> checking java.vendor Sun Microsystems Inc. >>>>> checking java.version 1.5.0_13 >>>>> checking os.version 2.6.18-8.el5xen >>>>> comm.jar appears to be installed already. >>>>> conftest.c: In function 'main': >>>>> conftest.c:6: warning: incompatible implicit declaration of built-in >>>>> function 'printf' >>>>> conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this >>>> function) >>>>> conftest.c:6: error: (Each undeclared identifier is reported only once >>>>> conftest.c:6: error: for each function it appears in.) >>>>> conftest.c:6: error: expected ')' before string constant >>>> >>>> >>>> This is an outdated kernel version check for when headers and kernels >>>> could cause problems for rxtx. If we made it past this, then you are >> OK. >>>> >>>> >>>>> conftest.c:7: warning: incompatible implicit declaration of built-in >>>>> function 'exit' >>>>> ./configure: line 9649: ./conftest: No such file or directory >>>>> ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected >>>> >>>> It blew up but continues.. >>>> >>>>> conftest.c: In function 'main': >>>>> conftest.c:5: warning: incompatible implicit declaration of built-in >>>>> function 'printf' >>>>> conftest.c:10: warning: incompatible implicit declaration of built-in >>>>> function 'exit' >>>>> configure: creating ./config.status >>>>> config.status: creating Makefile >>>>> config.status: creating config.h >>>>> config.status : config.h is unchanged >>>>> config.status: executing depfiles commands >>>>> [root at smsgateway rxtx-2.0-7pre1]# make install >>>>> /usr/java/jdk1.5.0_13/bin/javac -classpath >>>>> .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/ -O >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1 >> /./src/UnSupportedLoggerException.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java >>>>> Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or >>>>> overrides a deprecated API. >>>>> Note: Recompile with -Xlint:deprecation for details. >>>>> /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* >>>> >>>> >>>> The java jar should be fine now. You may need to change the source >> files >>>> as mentioned below. >>>> >>>>> gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu >> -I. >>>>> -I/usr/java/jdk1.5.0_13/include >> -I/usr/java/jdk1.5.0_13/include/./linux/ >>>> -g >>>>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o >>>>> /home/jboss/sources/rxtx-2.0-7pre1 >> /x86_64-unknown-linux-gnu/SerialImp.lo >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'init_threads': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: >>>> cast >>>>> from pointer to integer of different size >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_nativeDrain': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: >>>> cast to >>>>> pointer from integer of different size >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'read_byte_array': >>>>> /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: >>>> cast to >>>>> pointer from integer of different size >>>> >>>> >>>> As I recall, this was caused by pointers (now 64 bit rather than 32 >> bit) >>>> being stored in java ints (jints). I would look at the diff between >> the >>>> CVS 2.1 SerialImp.c and RXTXPort.java files against 2.0. We >>>> did fix those issues. >>>> >>>> You have a .so file but the different pointer sizes will cause runtime >>>> errors. >>>> >>>> >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_readArray': >>>>> /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: >>>>> comparison is always false due to limited range of data type >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_readTerminatedArray': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: >>>>> comparison is always false due to limited range of data type >>>>> mkdir .libs >>>>> rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* >> .libs/librxtxSerial- >>>>> 2.0.7pre1.* >>>>> gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so-o >>>>> .libs/librxtxSerial-2.0.7pre1.so >>>>> (cd .libs && rm -f librxtxSerial.so && ln -s >> librxtxSerial-2.0.7pre1.so >>>>> librxtxSerial.so) >>>>> creating librxtxSerial.la >>>>> (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la >>>>> librxtxSerial.la) >>>>> gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu >> -I. >>>>> -I/usr/java/jdk1.5.0_13/include >> -I/usr/java/jdk1.5.0_13/include/./linux/ >>>> -g >>>>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o >>>>> /home/jboss/sources/rxtx- 2.0-7pre1 >>>> /x86_64-unknown-linux-gnu/ParallelImp.lo >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function >>>>> 'Java_javax_comm_LPRPort_readArray': >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: >>>>> comparison is always false due to limited range of data type >>>>> rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* >>>>> .libs/librxtxParallel-2.0.7pre1.* >>>>> gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so-o >>>>> .libs/librxtxParallel- 2.0.7pre1.so >>>>> (cd .libs && rm -f librxtxParallel.so && ln -s >>>> librxtxParallel-2.0.7pre1.so >>>>> librxtxParallel.so) >>>>> creating librxtxParallel.la >>>>> (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la >>>>> librxtxParallel.la) >>>>> make all-am >>>>> make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' >>>>> make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' >>>>> libtool: install: `x86_64-unknown-linux-gnu' must be an absolute >>>> directory >>>>> name >>>>> Try `libtool --help --mode=install' for more information. >>>>> make: *** [install] Error 1 >>>> >>>> A libtool change? Assuming you ran configure && make install in >>>> /home/jboss/sources/rxtx- 2.0-7pre1, libtool is looking for >>>> /home/jboss/sources/rxtx- >>>> 2.0-7pre1/x86_64-unknown-linux-gnu/.libs/librxtxSerial-2.0.7pre1.so. >>>> >>>> I think you have this? The file is just being copied to >>>> ~JAVA/jre/lib/$(JAVA_ARCH). >>>> >>>> -- >>>> Trent Jarvi >>>> tjarvi at qbang.org >>>> >>> >> > From guido.vogt at celsi.ch Tue Nov 13 00:28:01 2007 From: guido.vogt at celsi.ch (Guido Vogt) Date: Tue, 13 Nov 2007 08:28:01 +0100 Subject: [Rxtx] RTS Line can't be set Message-ID: <47395201.1050400@celsi.ch> I'm working on an Windows XP /SP2 System. Version of RXTX: 2.1.7. The serial line is connected to a modem. As I can see, the RTS-Line of the serial Port is inactive, when the port is opened (flowcontrol=none). Obviously, no data is coming from the modem. If I use the setRTS(true) command after open, the comport does not send out my data any more. This behaviour is regardless of flowcontrol. Anybody has an idea what do do? Thanks for help. From Martin.Oberhuber at windriver.com Tue Nov 13 08:58:23 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 13 Nov 2007 16:58:23 +0100 Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803880918@ism-mail03.corp.ad.wrs.com> Hi Trent, as said before, I like the idea of discussing such quality engineering issues, but why hide these away from the rest of the public? Anyways, if you do want to create a new mailing list for these kinds of things I'll happily subscribe. 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: Sunday, November 11, 2007 1:46 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: RE: [Rxtx] Quality Engineering with rxtx > > On Mon, 5 Nov 2007, Oberhuber, Martin wrote: > > > Hi Trent, > > > > are the interestes of hobbyists really so different > > from commercial ones? Both should be interested in > > high quality and innovation the like. > > > > I haven't seen too many Open Source projects from the > > "inside" but those that I have seen did not have > > separate mailing lists for quality/testing/qa > > versus innovation/development. > > > > What I have seen with the Open Source projects that > > one would call "successful" is a good deal of > > process around automated builds, automated unit > > tests, predictable release dates and milestones, > > and policies around commiting/contributing/reviewing > > changes. > > > > I think that all of these benefit commercial users > > and hobbyists the like. > > > > If you were just asking about who's interested in > > discussing changes to foster more quality, count > > me in. I'm just not sure whether discussing these > > on a separate mailing list or other channel is the > > right thing to do. > > > > Hi Martin, > > There are two issues I'm thinking about. The first is the > generic unit > testing and quality initiatives required to move rxtx > forward. The second > is the inevitable fact that rxtx connects to external hardware. The > discussion deals with a different set of problems. > > Here is a simple example of what I'm getting at. > > We have the capability of setting custom baud rates in rxtx. > We may be > interested in seeing regressions in rxtx, the C library or > the kernel. > Some people may be doing some tests with loopback > connections. These will > always work even if the baud rate is not set to the expected > value. Some > people may use null modems between two ports. This may be > able to catch > the problem but not always. > > Will the build machines be able to test this? (no - for a few reasons) > Will people be trying to catch these type of regressions? (yes) > What type of coverage does the community have in the end? (?) > > We could include the discussions in the same list or another > equally open > list that may be of interest to some folks that deal with > these types of > problems on a regular basis. > > -- > Trent Jarvi > tjarvi at qbang.org > From toupsz at cs.tamu.edu Tue Nov 13 10:33:03 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 13 Nov 2007 11:33:03 -0600 Subject: [Rxtx] [urgent] device's power off detection In-Reply-To: <4738F546.5010101@gatworks.com> References: <766782.10076.qm@web55803.mail.re3.yahoo.com> <4738F546.5010101@gatworks.com> Message-ID: Lacking any other specification on it...but can you set up the device to notify your software when it turns off? Send a message or somesuch? Maybe it can signal using RTS or DTR? -Zach On Nov 12, 2007 6:52 PM, U. George wrote: > Not sure what u are asking for. Are u asking for a way to detect if the > device is OFF? Are u asking how to power off the device - via software ? > Is it a Serial device? > is it a parallel device? > is it a usb device? > > Sara Hugh wrote: > > Hello all, > > I have a small application built on top of rxtx api. This application > > can retrieve the incoming data from a device through a port. The device > > can be powered off after the port get closed from the application. I > > have been trying a couple of hours to find a way to detect the power > > switching from device. If anyone knows how to handle it through rxtx, > > could you please give me a help? Thank you very much. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071113/e5859e4d/attachment-0008.html From tjarvi at qbang.org Tue Nov 13 20:02:03 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 13 Nov 2007 20:02:03 -0700 (MST) Subject: [Rxtx] #ifndef TIOCSERGETLSR In-Reply-To: <472E3AAF.7050709@gatworks.com> References: <472E3AAF.7050709@gatworks.com> Message-ID: On Sun, 4 Nov 2007, U. George wrote: > For Linux, it seems that you need the code for both *having* a > TIOCSERGETLSR, and *not having* a TIOCSERGETLSR. Maybe the ioctl exists > system wide, but not necessarily for the device driver itself ( always > returns -1 ) . > > Are there systems that have a *functioning* TIOCSERGETLSR for all their > devices? Then this would be the case where the "#ifndef TIOCSERGETLSR" > directive could be useful is eliminating the unnecessary code and tests. > > And for those systems that dont have a TIOCSERGETLSR, then the code for > TIOCSERGETLSR can be eliminated. > > It would be a simple case to have, as a foundation, all the code to > simulate the missing TIOCSERGETLSR ioctl. If the system does have the > ioctl, then that code can be ifdef'd in, and co-exist with the > functionality of the code that simulates the missing TIOCSERGETLSR ioctl. > Ah, there is the post. Sorry I was on vacation. Hi George, Yes there are systems that have functioning TIOCSERGETLSR for all of their devices. These are machines that just use traditional UARTs. If you mean operating systems, then probably not. Let me explain a bit about the history of those #ifdefs to help clear up a mess. RXTX aims to follow POSIX. TIOCSERGETLSR turns out to not be POSIX at all as I understand. It isn't in BSD, Solaris, AIX or HP-UX. It certainly provides access to important information. I assumed it was standard when I coded rxtx on a Linux system. Ya, laugh. Then I looked at Win32.. Oh you are still laughing? ..I could not navigate msft's web site at the time [still can't really find anything today]. So google pointed me to someones 'reverse documentation' of the w32 API and an example msft put together back in the win3.0 days. It was enough but maybe not 100% correct. They covered overlapped IO which was important for events in rxtx. Looking at Win32 and Linux, it made sense to implement TIOCSERGETLSR for win32 with the way rxtx works. That was how things matched up. But when I got feedback about other systems, it didn't match up. When people used multiport cards with money saving designs in Linux, it didn't match up. And today, there are drivers for unusual serial ports that don't match up. Now we have some ugly logic that mostly works for most serial ports. It isn't right though. The important aspect of TIOSERGETLSR is knowing when the output is really gone. But POSIX tcdrain tells us the same thing. So there is logic in the ifdefs to match that up as you suggest. Perhaps a more formal solution along those lines would be worth looking into. I would suggest the roles should be switched though. We should use POSIX calls on all systems and hide things that don't work on everything like we have with other undocumented calls. TIOSERGETLSR is nice and would be great if it was standard. It isn't as far as I can tell. In the end, many people write Java code because they want portability. The TIOSERGETLSR does not really fit. In someways, this is limiting to the least common denominator which is Solaris if you have seen it's serial kernel driver code. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 15 09:10:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 15 Nov 2007 17:10:59 +0100 Subject: [Rxtx] RXTX blocking on unconnected virtual port Message-ID: <460801A4097E3D4CA04CC64EE648584803919080@ism-mail03.corp.ad.wrs.com> Hello, we came across the following issue: * Set up a virtual serial port, e.g. with com0com: http://com0com.sourceforge.net/ * Connect RXTX to one end, e.g. cnc1a * Do not connect the other end, e.g. cnc1b * Have RXTX write data to the port --> Since the data is not being read, RXTX blocks - RXTXPort.SerialOutputStream.write increases the RXTXPort.IOLocked variable - it then calls the native writeByte or writeArray method (which blocks) closing the RXTXPort hangs for ever too: - RXTXPort.close() has a while( IOLocked > 0 ) {..Thread.sleep(500);...} which spins for ever ==> once the communication hangs, it cannot recover. Has anybody else seen such a problem before, or even got an idea how to solve it? When I connect Hyperterminal to the same half-open port, and type a character, it hangs for about 3 seconds but then times out and is available again. I guess that's what I'd like to see in RXTX as well, with a (configurable) timeout. Our big problem with the current situation is that once RXTX gets stuck, there is nothing at all we can do to make it go live again - that's why our original workaround of writing to the port in a background thread is not good enough. For more background information, the issue is being tracked in https://bugs.eclipse.org/bugs/show_bug.cgi?id=208185 Thanks for any hints or ideas, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Sun Nov 18 09:43:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 09:43:26 -0700 (MST) Subject: [Rxtx] PortInUseException - Cannot close and reopen serial port In-Reply-To: <460801A4097E3D4CA04CC64EE64858480351C711@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858480351C711@ism-mail03.corp.ad.wrs.com> Message-ID: These have been submitted to CVS and the bugzilla entries have been changed to reflect the changes. ChangeLog: find ports which were added after program startup on Mac OS X. Martin Oberhuber http://bugzilla.qbang.org/show_bug.cgi?id=48 Clean up CommPort Ownership code, avoid possible deadlocks, fix lost commport ownership events. http://bugzilla.qbang.org/show_bug.cgi?id=83 Martin Oberhuber On Wed, 24 Oct 2007, Oberhuber, Martin wrote: > 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) > > > > > > > > > > > > > > > From tjarvi at qbang.org Sun Nov 18 09:45:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 09:45:39 -0700 (MST) Subject: [Rxtx] PortInUseException - Cannot close and reopen serial port In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848020CAF26@ism-mail03.corp.ad.wrs.com> Message-ID: The current CVS code should have all the entries. With version information, I usually do not change the version until we tag and release a zip file. Any feedback would be appreciated. On Wed, 27 Jun 2007, Greg Johnson wrote: > 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) >> >> >> >> >> > From tjarvi at qbang.org Sun Nov 18 13:51:27 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 13:51:27 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs Message-ID: The following bugs have been closed and CVS updated as needed: CommPortIdentifier.getPortIdentifier throws NoSuchPortException http://bugzilla.qbang.org/show_bug.cgi?id=48 CommPortOwnership events not sent http://bugzilla.qbang.org/show_bug.cgi?id=83 JVM 1.6 builds http://bugzilla.qbang.org/show_bug.cgi?id=84 I'd like to give Martin Oberhuber CVS write access. He has been doing a great job of pushing safe patches into rxtx. I'll be preparing seperate patches for the changes I have and submitting them to the list. I'll need to work with George to do a couple things: 1) break the patch into smaller pieces to isolate issues for discussion. 2) work through the Line Status Register changes so it does not cause problems on other systems. George: If you could do the first one, it would be greatly appreciated. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Nov 18 15:33:36 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 15:33:36 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: Message-ID: I'm not running any tests at this point, I'm trying to apply the small safe patches and make sure everything is compiling. As mentioned at the bottom, there are 3 patches + the USB fix posted here that need more review before accepting. The following bugs have been closed and CVS updated as needed. Most of these are already in CVS. The diff will be small. configure script failed at line UTS_RELEASE megov http://bugzilla.qbang.org/show_bug.cgi?id=80 code cleanup patch (extra ';' creates bug for if statements + new String() calls removed) Xavier Le Vourch http://bugzilla.qbang.org/show_bug.cgi?id=77 Wont compile on linux ppc with glibc 2.5 - no sys/io.h Brian Johnson http://bugzilla.qbang.org/show_bug.cgi?id=72 rxtx overwrites System properties Andrew Gillett Nektarios K. Papadopoulos Neboj??a http://bugzilla.qbang.org/show_bug.cgi?id=64 Solaris ACM port support Dave Cleal http://bugzilla.qbang.org/show_bug.cgi?id=59 Setting of non-standard baud rate fails. Andrew Prunicki http://bugzilla.qbang.org/show_bug.cgi?id=58 RXTX uses lockfiles on MacOS X (instead of ioctl TIOCEXCL) Joachim Buechse http://bugzilla.qbang.org/show_bug.cgi?id=50 JavaDoc fixes Joachim Buechse http://bugzilla.qbang.org/show_bug.cgi?id=49 I need to further review the following: http://bugzilla.qbang.org/show_bug.cgi?id=53 http://bugzilla.qbang.org/show_bug.cgi?id=46 http://bugzilla.qbang.org/show_bug.cgi?id=41 On Sun, 18 Nov 2007, Trent Jarvi wrote: > > The following bugs have been closed and CVS updated as needed: > > CommPortIdentifier.getPortIdentifier throws NoSuchPortException > http://bugzilla.qbang.org/show_bug.cgi?id=48 > CommPortOwnership events not sent > http://bugzilla.qbang.org/show_bug.cgi?id=83 > JVM 1.6 builds > http://bugzilla.qbang.org/show_bug.cgi?id=84 > > I'd like to give Martin Oberhuber CVS write access. He has been doing a > great job of pushing safe patches into rxtx. > > I'll be preparing seperate patches for the changes I have and submitting > them to the list. > > I'll need to work with George to do a couple things: > > 1) break the patch into smaller pieces to isolate issues for discussion. > 2) work through the Line Status Register changes so it does not cause > problems on other systems. > > George: If you could do the first one, it would be greatly appreciated. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From netbeans at gatworks.com Sun Nov 18 16:20:02 2007 From: netbeans at gatworks.com (U. George) Date: Sun, 18 Nov 2007 18:20:02 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: Message-ID: <4740C8A2.6030908@gatworks.com> > I'll need to work with George to do a couple things: > > 1) break the patch into smaller pieces to isolate issues for discussion. > 2) work through the Line Status Register changes so it does not cause > problems on other systems. > > George: If you could do the first one, it would be greatly appreciated. there are ( probably ) 3 pieces: 1) the select() failure when the USB-serial device is unceremoniously unplugged ( causes rxtx to spin ) 2) TIOCSERGETLSR, need to have the simulation of it available for all os's . If the system has the capability, don't simulate for devices that have the capability. For devices that dont have the capability, but the OS still defines TIOCSERGETLSR, fall back to simulation. 3) I rearranged DEBUG ifdef's. This is probably the bulk of the patches. From tjarvi at qbang.org Sun Nov 18 18:26:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 18:26:26 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <4740C8A2.6030908@gatworks.com> References: <4740C8A2.6030908@gatworks.com> Message-ID: On Sun, 18 Nov 2007, U. George wrote: > >> I'll need to work with George to do a couple things: >> >> 1) break the patch into smaller pieces to isolate issues for discussion. >> 2) work through the Line Status Register changes so it does not cause >> problems on other systems. >> >> George: If you could do the first one, it would be greatly appreciated. > > there are ( probably ) 3 pieces: > 1) the select() failure when the USB-serial device is unceremoniously > unplugged ( causes rxtx to spin ) > 2) TIOCSERGETLSR, need to have the simulation of it available for all os's . > If the system has the capability, don't simulate for devices that have the > capability. For devices that dont have the capability, but the OS still > defines TIOCSERGETLSR, fall back to simulation. > 3) I rearranged DEBUG ifdef's. This is probably the bulk of the patches. > Hi George, I suspect if you do cvs update, there will be very few conflicts if any. While the list of fixes is fairly long, the changes are small. -- Trent Jarvi tjarvi at qbang.org From EdwardRF at xtremax.com Mon Nov 19 03:32:29 2007 From: EdwardRF at xtremax.com (Edward) Date: Mon, 19 Nov 2007 18:32:29 +0800 Subject: [Rxtx] Cannot Read under Windows XP Message-ID: <4741663D.4070200@xtremax.com> Hi Guys, I have a iTegno 3000 usb GSM modem, it is an usb-serial device. I am trying to use RXTX with it under Windows XP. The problem is it seems RXTX cannot read any data from it, but writing to it seems successful. I blindly issue a series of command to send off a SMS, it is successfully delivered, but neither the echo from the modem nor the "OK" response was received. I tried to connect to the modem directly using hyper terminal, there was no problem reading or writing. So can i assume it is not the driver problem? Then i turned to Serial Port Monitor for help, when I use hyper terminal, monitor shows both way traffic, and nothing abnormal, but when I connect using RXTX, only the data I sent to the modem is being detected, no input was detected. Does anyone else experience similar problem? Best Regards Edward From tjarvi at qbang.org Mon Nov 19 03:38:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Nov 2007 03:38:02 -0700 (MST) Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: <4741663D.4070200@xtremax.com> References: <4741663D.4070200@xtremax.com> Message-ID: On Mon, 19 Nov 2007, Edward wrote: > Hi Guys, > > I have a iTegno 3000 usb GSM modem, it is an usb-serial device. I am > trying to use RXTX with it under Windows XP. > The problem is it seems RXTX cannot read any data from it, but writing > to it seems successful. I blindly issue a series of command to send off > a SMS, it is successfully delivered, but neither the echo from the modem > nor the "OK" response was received. > > I tried to connect to the modem directly using hyper terminal, there was > no problem reading or writing. So can i assume it is not the driver problem? > > Then i turned to Serial Port Monitor for help, when I use hyper > terminal, monitor shows both way traffic, and nothing abnormal, but when > I connect using RXTX, only the data I sent to the modem is being > detected, no input was detected. > > Does anyone else experience similar problem? > Hi Edward, A common mistake is to send Strings to the modem which are i18n. You want to send the bytes. Examples of doing this are in the contrib directory with the sourcecode. ie SimpleSnuV1.java -- Trent Jarvi tjarvi at qbang.org From EdwardRF at xtremax.com Mon Nov 19 04:42:16 2007 From: EdwardRF at xtremax.com (Edward) Date: Mon, 19 Nov 2007 19:42:16 +0800 Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: References: <4741663D.4070200@xtremax.com> Message-ID: <47417698.3060705@xtremax.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071119/b0f08ba9/attachment-0003.html From netbeans at gatworks.com Mon Nov 19 06:31:30 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 19 Nov 2007 08:31:30 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: <4740C8A2.6030908@gatworks.com> Message-ID: <47419032.8080406@gatworks.com> Did the "make install". The install does not want to go to or use Makefiles's prefix = /usr/local/rxtx-devel Not terribly happy that it installed in /home/gat/JAVA/JDK14/j2sdk1.4.2_08/jre/lib/i386 Trent Jarvi wrote: > > I suspect if you do cvs update, there will be very few conflicts if any. > While the list of fixes is fairly long, the changes are small. > > -- > Trent Jarvi > tjarvi at qbang.org > > From Martin.Oberhuber at windriver.com Mon Nov 19 07:00:48 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 19 Nov 2007 15:00:48 +0100 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE6485848039986E6@ism-mail03.corp.ad.wrs.com> It's great to see things progressing - thanks Trent! I checked CVS, and it seems that most of the patch authors are yet missing from the AUTHORS file, is this intentional? The issues areound RXTXPort.close() are interesting for us in the context of Eclipse as well: https://bugs.eclipse.org/bugs/show_bug.cgi?id=208185#c3 I did a quick review and found some issues / comments: http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 http://bugzilla.qbang.org/show_bug.cgi?id=53#c9 Thanks for proposing CVS write access for me. I promise to use these thoughtfully, and discuss potential fixes openly (on bugzilla) before applying them [unless it's really trivial issues only like obvious Javadoc syntax or spelling errors]. Cheers, -- 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 Mon Nov 19 07:24:16 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 19 Nov 2007 15:24:16 +0100 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803998711@ism-mail03.corp.ad.wrs.com> Hi all, I think I've got a better version for RXTXCommDriver.checkSolaris(): http://bugzilla.qbang.org/show_bug.cgi?id=77#c3 Cheers, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From netbeans at gatworks.com Mon Nov 19 09:01:22 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 19 Nov 2007 11:01:22 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <47419032.8080406@gatworks.com> References: <4740C8A2.6030908@gatworks.com> <47419032.8080406@gatworks.com> Message-ID: <4741B352.8070205@gatworks.com> U. George wrote: > Did the "make install". The install does not want to go to or use > Makefiles's prefix = /usr/local/rxtx-devel > > Not terribly happy that it installed in > /home/gat/JAVA/JDK14/j2sdk1.4.2_08/jre/lib/i386 > Put libs and jar in MY preferential places. Ran application. And it loves to spin. Deja gnu all over again. :-/ It did find the avail /dev/ttyUSB0 port connected to LINUX usbserial/pl2303 device driver. Now to find the spin. and apply simpler set of patches From tjarvi at qbang.org Mon Nov 19 10:14:38 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Nov 2007 10:14:38 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <4741B352.8070205@gatworks.com> References: <4740C8A2.6030908@gatworks.com> <47419032.8080406@gatworks.com> <4741B352.8070205@gatworks.com> Message-ID: On Mon, 19 Nov 2007, U. George wrote: > U. George wrote: >> Did the "make install". The install does not want to go to or use >> Makefiles's prefix = /usr/local/rxtx-devel >> >> Not terribly happy that it installed in >> /home/gat/JAVA/JDK14/j2sdk1.4.2_08/jre/lib/i386 >> > Put libs and jar in MY preferential places. Ran application. And it loves to > spin. Deja gnu all over again. :-/ > > It did find the avail /dev/ttyUSB0 port connected to LINUX usbserial/pl2303 > device driver. > > Now to find the spin. and apply simpler set of patches > Hi George, When the prefix code was stomped on and the library was installed in the jre, It wasnt clear how the layout would end up looking. I'm still not sure. My usual attack was to dump a jdk onto the filesystem, set JAVA_HOME and install. When I was done, I would nuke the jdk. Obviously that may not be what people want but I'm not sure a prefix is enough to let us know what they do want. For a shared library prefix /usr/local means the library goes in /usr/local/lib. What would it mean for the jar and shared library in Java? -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Nov 19 10:24:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Nov 2007 10:24:08 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <460801A4097E3D4CA04CC64EE6485848039986E6@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848039986E6@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 19 Nov 2007, Oberhuber, Martin wrote: > > I checked CVS, and it seems that most of the patch > authors are yet missing from the AUTHORS file, > is this intentional? > There isn't a hard rule covering who goes into AUTHORS. If I recognize a person from previous patches, I try to make sure they are in. Everyone contributing (authors) is in the ChangeLog with what they did going all the way back to the first release. AUTHORS is more of a summary of what they did after a few submissions. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Nov 19 11:39:51 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 19 Nov 2007 13:39:51 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: <4740C8A2.6030908@gatworks.com> <47419032.8080406@gatworks.com> <4741B352.8070205@gatworks.com> Message-ID: <4741D877.80203@gatworks.com> For me, the makefile/prefix = /usr/local sorta suggest thats where the libs/bins/jars/... should eventually wind up. If a user does not like /usr/local, then a quick change would put it somewhere else. At this moment I dont care where the jar winds up ( in lib, or a jar directory ). So I like to keep the jre/sdk directory protected from meddling, and changes. But if a user has a penchant to use 'java -jar', then the RXTXcomm.jar file should be stuffed with the other jre/sdk jar files. From ajmas at sympatico.ca Mon Nov 19 11:54:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 19 Nov 2007 13:54:29 -0500 Subject: [Rxtx] CVS updates and closed bugs Message-ID: <20071119185429.SPYK18413.tomts22-srv.bellnexxia.net@smtp1.sympatico.ca> On this day in November "U. George" wrote: > > For me, the makefile/prefix = /usr/local sorta suggest thats where the > libs/bins/jars/... should eventually wind up. > If a user does not like /usr/local, then a quick change would put it > somewhere else. At this moment I dont care where the jar winds up ( in > lib, or a jar directory ). > So I like to keep the jre/sdk directory protected from meddling, and > changes. > But if a user has a penchant to use 'java -jar', then the RXTXcomm.jar > file should be stuffed with the other jre/sdk jar files. It should be noted that some platforms, such as MacOS X might have different conventions. In the case of MacOS X there are two 'correct' places for Java libraries that aren't part of an application: - /Library/Java/Extensions/ - ~/Library/Java/Extensions/ Andre From ajmas at sympatico.ca Mon Nov 19 18:15:37 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 19 Nov 2007 20:15:37 -0500 Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: <47417698.3060705@xtremax.com> References: <4741663D.4070200@xtremax.com> <47417698.3060705@xtremax.com> Message-ID: <3D24B671-06CA-4709-AE3C-BCDB542F427F@sympatico.ca> On 19-Nov-07, at 06:42 , Edward wrote: > Hi Trent, > > First of all, I did sent them as bytes, eg, > > output.write("at\r\n".getBytes()); > > And if writing is every the problem, it wouldn't be able to explain > why i could send out a sms successfully using RXTX. > If you have the section of code that does the communicating, could you share it with us? This should help us tell whether it is a coding issue or something more fundamental with RXTX. Andre From EdwardRF at xtremax.com Mon Nov 19 19:39:36 2007 From: EdwardRF at xtremax.com (EdwardRF) Date: Tue, 20 Nov 2007 10:39:36 +0800 Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: <3D24B671-06CA-4709-AE3C-BCDB542F427F@sympatico.ca> References: <4741663D.4070200@xtremax.com> <47417698.3060705@xtremax.com> <3D24B671-06CA-4709-AE3C-BCDB542F427F@sympatico.ca> Message-ID: <474248E8.7070002@xtremax.com> Hi Guys, Thanks for the help, i've finally found out the problem. It was a flow control issue, i did not set the flow control properly. Btw, what is the default flow control behavior for rxtx2.1.7? was it the same as 2.0? Because i remember i did not need to set the flow control when I use rxtx 2.0 2 years back. Best Regards Edward Andre-John Mas wrote: > > On 19-Nov-07, at 06:42 , Edward wrote: > >> Hi Trent, >> >> First of all, I did sent them as bytes, eg, >> >> output.write("at\r\n".getBytes()); >> >> And if writing is every the problem, it wouldn't be able to explain >> why i could send out a sms successfully using RXTX. >> > > If you have the section of code that does the communicating, could you > share it with us? This should help us tell whether it is a coding > issue or something more fundamental with RXTX. > > Andre > From netbeans at gatworks.com Tue Nov 20 06:23:26 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 20 Nov 2007 08:23:26 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: <4740C8A2.6030908@gatworks.com> Message-ID: <4742DFCE.5070504@gatworks.com> Here is the small subset of diffs just for TIOCSERGETLSR :) Next I'll pull out the usb device, and see if that also causes rxtx to spin. >> 2) TIOCSERGETLSR, need to have the simulation of it available for all >> os's . If the system has the capability, don't simulate for devices >> that have the capability. For devices that dont have the capability, >> but the OS still defines TIOCSERGETLSR, fall back to simulation. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: a Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20071120/2c5c8ee7/attachment.ksh From keithvz at verizon.net Thu Nov 1 08:08:58 2007 From: keithvz at verizon.net (Keith) Date: Thu, 01 Nov 2007 10:08:58 -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: <4729DDFA.7080206@verizon.net> Trent Jarvi wrote: > 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? Well, I honestly don't know how all this fits together. I think it's just a matter of enabling the right flow control option within the standard serial framework to tell the device driver, "HEY START USING DTR/DSR FOR FLOW CONTROL." If what UGeorge said,(about that type of nitty-gritty lead control being done within the device driver), is true, then this confirms my suspicion. I tried narrowing down within the Linux drivers what you are looking for, but I can't entirely tell wth I'm looking at. (virtual com port drivers -- they are included compiled by default with Ubuntu, source included) http://www.ftdichip.com/Drivers/VCP/Linux/ftdi_sio.tar.gz Hahahaa, they make a reference to DTR flow control being supported but say (UGH) in parenthesis. You can also use their direct device driver library on Ubuntu -- libftd2xx.so.0.4.13. No source code. http://www.ftdichip.com/Drivers/D2XX/Linux/libftd2xx0.4.13.tar.gz In that case, you make a call to their FT_SetFlowControl() function. FT_STATUS FT_SetFlowControl (FT_HANDLE ftHandle, USHORT usFlowControl, UCHAR uXon,UCHAR uXoff) Parameters ftHandle Handle of the device. usFlowControl Must be one of FT_FLOW_NONE, FT_FLOW_RTS_CTS, ****FT_FLOW_DTR_DSR**** or FT_FLOW_XON_XOFF. uXon Character used to signal Xon. Only used if flow control is FT_FLOW_XON_XOFF. uXoff Character used to signal Xoff. Only used if flow control is FT_FLOW_XON_XOFF. This is from their programming guide http://www.ftdichip.com/Documents/ProgramGuides/D2XXPG34.pdf I actually want to take this a step further and say that I think the flow control is actually handled right on the device itself in hardware/firmware. It's enabled through the device driver, but I think the maintaining of buffers, asserting/deasserting of leads, etc is handled by the device. For the time being, I've switched to jd2xx, https://jd2xx.dev.java.net/ and http://bleyer.org/jd2xx/ These are Java wrappers for the device driver libraries. It allows almost direct access to the well-documented device drivers from Java. I hope this helps Keith From tjarvi at qbang.org Thu Nov 1 11:09:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:09:51 -0600 (MDT) 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: Hi Martin, What I usually have done is allow changes that do not impact working software including changes to methods not documented in CommAPI (which remain undocumented in rxtx) and fixes to known problems in the documented portions. That way if you use the documented API, the releases should only become better with time. If you use the undocumented portions, the behavior is not as predictable but open for improvement. On Wed, 31 Oct 2007, 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 >> > From tjarvi at qbang.org Thu Nov 1 11:15:52 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:15:52 -0600 (MDT) 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: I too use rxtx in commercial products. The problem I've been trying to address while bringing the server back was how to make it possible for hobby folks to build the same software as companies so we can move rxtx along a little faster. Exposing internal tools is not an option at this time, the public rxtx builds have been done on my home machine which has drives hanging out of it all over the place dying one at a time. This isn't maintainable. I'm currently looking at the possibility of making an S3 image available on Amazon's EC. These are machines you can rent for ~10 cents an hour which is more than enough to build rxtx. The S3 image is not changed when people use it so everyone has the same starting point. With this, we could all build rxtx for ~20 platforms for a small price and eliminate tool issues. On Wed, 31 Oct 2007, Greg Johnson wrote: > 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 tjarvi at qbang.org Thu Nov 1 11:19:55 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:19:55 -0600 (MDT) 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: On Wed, 31 Oct 2007, 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. I was helping Dmitry do the Mac OS X port without access to a machine when we put that in. In the archives there is information (easily found with google on Apple's site) that describes how their API (and others) can determine if a port is used and ignore it. I think these changes are in CVS but need to confirm. The bottom line is that rxtx should not have used lock files on Mac. It was just ignorance of the system on my part. -- Trent Jarvi tjarvi at qbang.org From fabioanjos at gmail.com Thu Nov 1 12:35:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Thu, 1 Nov 2007 15:35:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Hi, I was using SerialEventListener in my project. But, as was said here, id doesnt work very well with virtual serial ports. So, I changed the strategy using the code posted here in this thread: try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > 0) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } The thing is that in my tests I could notice that in.read(buffer) never blocks. Even when there's nothing to read. Instead of blocking when there's nothing to read it returns 0. So, my questions are: 1. Am I doing something wrong? 2. If not, wouldnt this decrease performance? (the thread would be locked in a loop that does nothing.) 3. Is there a better way to do the job? Thanks in advance!! F?bio -------- On 10/31/07, Andre-John Mas wrote: > > > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/0aee59d0/attachment-0021.html From ajmas at sympatico.ca Thu Nov 1 16:07:55 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Nov 2007 18:07:55 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Message-ID: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From sarah_662005 at yahoo.com Thu Nov 1 17:10:05 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Thu, 1 Nov 2007 16:10:05 -0700 (PDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Message-ID: <351433.37166.qm@web55814.mail.re3.yahoo.com> Thank you very much for your help. Now the application works fine. the serialEvent gets triggered. Rxtx is cool! ----- Original Message ---- From: Andre-John Mas To: Sara Hugh ; RXTX Developers and Users Sent: Wednesday, October 31, 2007 9:55:45 AM Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered 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 __________________________________________________ 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/20071101/4a86bea6/attachment-0021.html From tjarvi at qbang.org Thu Nov 1 17:58:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 17:58:02 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx Message-ID: The rxtx.org site is primarily interested in the hobby aspects of rxtx. Obviously, there are some companies following the work too. These interests bring larger workflows and concerns about details hobby folks may not care about. They also bring many more users. I know the company I work for has a quality engineering effort going on which includes rxtx. While the server was down, I was contacted by another company that was missing the binaries for their testing. Several people have mentioned concerns about a stable release for like reasons. Would there be interest on the quality side of the coin to get together? It could be just sharing email's with each other or a seperate list for QE/QA. I can not say for sure, but we may be able to share some of our efforts/results that could help keep rxtx releases stable. -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Fri Nov 2 01:42:55 2007 From: scldad at sdc.com.au (Stephen Davies) Date: Fri, 2 Nov 2007 18:12:55 +1030 Subject: [Rxtx] Multiple modems Message-ID: <200711021812.56047.scldad@sdc.com.au> This may or may not be related to the Multiple Ports thread. I have an application which uses rxtx on Linux (via cron jobs) to connect multiple modems to remote sensing devices. The application works fine most of the time but occasionally fails to connect if two (or more) connection attempts happen at about the same time. When it fails, it looks as if it may get confused as to which port it is talking to. The app has a "base" component that looks for an available port, opens it and then creates an input thread and an output thread for the connection and data transfer. The "base" component uses this code: // loop round all known ports until one is available. Give up after three minutes Counter ptimeout = new Counter(); while(!portFound && ptimeout.elapsed() < 180000) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // special case. ttyS0 is not available to us on this server. if (!portId.isCurrentlyOwned() && !portId.getName().equals("/dev/ttyS0")) { gLog.debug(lognm + ": Found port " + portId.getName()); try { serialPort = (RXTXPort) portId.open("AguaModem", 10000); } catch (Exception e) { gLog.error(lognm + ": Port " + portId.getName() + " will not open."); gLog.error(e.getMessage()); continue; } AguaModem aguamodem = new AguaModem(); portFound = true; break; } gLog.debug(lognm + ": Port " + portId.getName() + " is busy"); } } } I am wondering about the isCurrentlyOwned method. Does this actually tell me whether a port is currently being used by another process? TIA, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From fabioanjos at gmail.com Fri Nov 2 04:59:58 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 07:59:58 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Message-ID: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/9009eb1d/attachment-0021.html From netbeans at gatworks.com Fri Nov 2 06:28:13 2007 From: netbeans at gatworks.com (U. George) Date: Fri, 02 Nov 2007 08:28:13 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <472B17DD.1050508@gatworks.com> It should normally block ( unless eof / event ) . so its a :{ whats the device ( to recreate if possible ) and how do u open. > My question is, is there a way to make in.read block the thead until > there's something to read? > From fabioanjos at gmail.com Fri Nov 2 06:34:46 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 09:34:46 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > On 11/1/07, Andre-John Mas wrote: > > > > Fabio, > > > > Turns out there was a small error in my example. The test should be: > > > > (numBytes = in.read(buffer)) > -1 > > > > This is because -1 indicates an end of file (end of data stream) > > > > Andre > > > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > > > Hi, > > > > > > I was using SerialEventListener in my project. But, as was said > > > here, id doesnt work very well with virtual serial ports. > > > So, I changed the strategy using the code posted here in this thread: > > > > > > try{ > > > in = port.getInputStream(); > > > out = port.getOutputStream(); > > > int numBytes = 0; > > > while(active){ > > > > > > byte[] buffer = new byte[10]; > > > > > > while ( (numBytes = in.read(buffer)) > 0) > > > { > > > String dataValue = new String(buffer,0,numBytes); > > > processInput(dataValue); > > > } > > > > > > if(numBytes==-1){ > > > break; > > > } > > > > > > Thread.sleep(50); > > > } > > > > > > }catch(IOException e){ > > > logger.info("falha de comunicacao "+ > > > getReceptor().getPort() ); > > > > > > }catch(InterruptedException e){ > > > logger.info ("Interrompendo leitura da porta "+ > > > getReceptor().getPort() ); > > > } > > > > > > The thing is that in my tests I could notice that in.read(buffer) > > > never blocks. Even when there's nothing to read. Instead of blocking > > > when there's nothing to read it returns 0. > > > > > > So, my questions are: > > > > > > 1. Am I doing something wrong? > > > 2. If not, wouldnt this decrease performance? (the thread would be > > > locked in a loop that does nothing.) > > > 3. Is there a better way to do the job? > > > > > > Thanks in advance!! > > > > > > F?bio > > > -------- > > > > > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > > 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 > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > > > > > -- > > > Atenciosamente, > > > F?bio Cristiano dos Anjos > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/5306c4b1/attachment-0021.html From nick.circelli at infrasafe.com Fri Nov 2 07:01:17 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Fri, 2 Nov 2007 08:01:17 -0500 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com><29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com><90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca><29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Message-ID: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> I'm pretty sure that not blocking has to do with you virtual ports. Cause it should block. Maybe you should try: while ((numBytes = in.available()) > 0) { If (numBytes > buffer.length) { numBytes = buffer.length; // in case you have buffer overflow } numBytes = in.read(buffer, 0 , numBytes)); String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } Also, just for optimization, I'd move that byte[] buffer = new byte[10]; out of the while since you don't need to reallocate it every iteration. ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of F?bio Cristiano dos Anjos Sent: Friday, November 02, 2007 8:35 AM To: RXTX Developers and Users Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream (); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas < ajmas at sympatico.ca > wrote: Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info ("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Atenciosamente, F?bio Cristiano dos Anjos -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/4de7f6a3/attachment-0021.html From fabioanjos at gmail.com Fri Nov 2 07:36:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 10:36:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> Message-ID: <29788b250711020636q1588c88fgaa5e27f5504164fb@mail.gmail.com> Hi Nick, Actually, it doesnt block for physical ports too. And, the method avaiable does not block either, so when there's nothing avaiable the loop ends and the thread stops lintening to the port. But I did some more test with serialEventListener, and now its working. I realy dont know what I've done to get it working. I just start woking as soon as I decided to test it again. It was said here that serialEventListener is not reliable for virtual serial ports. Is there another way to read it, without compromising performance? Tanks again!! F?bio ------- On 11/2/07, Nick Circelli wrote: > > I'm pretty sure that not blocking has to do with you virtual ports. > Cause it should block. > > Maybe you should try: > > > > while ((numBytes = in.available()) > 0) > > { > > If (numBytes > buffer.length) { > > numBytes = buffer.length; // in case you have buffer overflow > > } > > numBytes = in.read(buffer, 0 , numBytes)); > > String dataValue = new String(buffer,0,numBytes,"ASCII"); > > processInput(dataValue); > > } > > > > Also, just for optimization, I'd move that byte[] buffer = new > byte[10]; > > out of the while since you don't need to reallocate it every iteration. > > > ------------------------------ > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On Behalf > Of *F?bio Cristiano dos Anjos > *Sent:* Friday, November 02, 2007 8:35 AM > *To:* RXTX Developers and Users > *Subject:* Re: [Rxtx] serialEvent(SerialPortEvent event) never be > triggered > > > > Hi, > > I think i missunderstand something here. > The code you post here was meant to be used inside serialEvent method, > right? > > The think is, that i cannot user SerialEventListener to read serial ports, > because i need to read virual serial ports and id does not behaves well, as > said here before. serialEvent is never triggered. > > So what I quit using SerialEventListener and created a thread to listen to > the port: > > public void run(){ > try{ > in = port.getInputStream(); > out = port.getOutputStream (); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new > String(buffer,0,numBytes,"ASCII"); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ getReceptor().getPort() > ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > } > > > So, the problem is that in.read(buffer) always returns 0 when there is > nothing to read, instead of blocking the flow, and the thread becames locked > in the loop. > > I hope you can help me solve this. > > Thanks in advance! > > F?bio > -------- > > On 11/2/07, *F?bio Cristiano dos Anjos* wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > > > On 11/1/07, *Andre-John Mas* < ajmas at sympatico.ca> wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info ("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/571df6ea/attachment-0020.html From tjarvi at qbang.org Fri Nov 2 08:32:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Nov 2007 08:32:15 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: References: Message-ID: On Fri, 2 Nov 2007, Greg Johnson wrote: > Hi Trent, folks, > Having a single rxtx that is suitable for commercial uses and hobbyists both > would be a great idea? Perhaps it would be worth submitting rxtx as a > proposal to Codehaus - they not only provide excellent tools (Jira (bug > tracker), Confluence (wiki)) but also support build management ( > maestro, continuum, bamboo). Relying on your personal machine (btw, frii.com > / rxtx.org is down again?) seems like a burden you shouldn't have to shoulder > alone. Hi Greg, There may be a little confusion here. There is no need to have two seperate rxtx releases. What I'm trying to encourage is a discussion between some of the people responsible for making sure rxtx does not break their products each release. Usually these people are interested in testing a set of functionality their product depends upon. They do not work with rxtx code but rather traps to catch when rxtx developers break something. This goes on all the time in isolated labs. There are many services that offer to do various pieces of a project for you if you... Anyone is free to do the 'if you' portion with rxtx and see how it goes. I'm actually interested in doing less of that than more. The rxtx.org work I do just happens to overlap with other things I do for personal/family use. The reason I suggest the amazon solution is that anyone can take full control of the environment for a day and it costs less than a package of gum without causing harm to what anyone else is doing. I assume the down question was with respect to a mod_security setting that has been resolved. If not, please post a url to the problem. -- Trent Jarvi tjarvi at qbang.org From nsayer at kfu.com Sat Nov 3 20:17:49 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 19:17:49 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? Message-ID: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Has anyone got RXTX working with an app under Leopard? My app hangs on port open (it works fine with Tiger). The relevant thread looks like this in the activity monitor: 1536 JVM_InvokeMethod 1536 0x48ccd0 1536 0x46f8a0 1536 0x4c3ff4 1536 0x4c4284 1536 0x357d160 1536 0x357faac 1536 Java_gnu_io_RXTXPort_open 1536 open $NOCANCEL$UNIX2003 1536 open $NOCANCEL$UNIX2003 From ajmas at sympatico.ca Sat Nov 3 22:02:04 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 00:02:04 -0400 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> RXTX works for me with Leopard. I am currently using it communicate with a Bluetooth GPS. What computer and device are you trying to use? Is the driver for your serial device compatible with MacOS X 10.5? Andre On 3-Nov-07, at 22:17 , Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From nsayer at kfu.com Sat Nov 3 22:17:47 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 21:17:47 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> Message-ID: <1720F723-3643-438C-B3AB-E09A67536977@kfu.com> On Nov 3, 2007, at 9:02 PM, Andre-John Mas wrote: > RXTX works for me with Leopard. I am currently using it communicate > with a Bluetooth GPS. > > What computer and device are you trying to use? Is the driver for > your serial device compatible with MacOS X 10.5? An Intel mac mini The FTDI USB serial driver an XMPCR, which is just a fancy serial controlled radio and an FTDI usb-to-serial chip I've successfully used the FTDI driver with another FTDI device in another context. > > > Andre > > On 3-Nov-07, at 22:17 , Nick Sayer wrote: > >> Has anyone got RXTX working with an app under Leopard? >> >> My app hangs on port open (it works fine with Tiger). The relevant >> thread looks like this in the activity monitor: >> >> 1536 JVM_InvokeMethod >> 1536 0x48ccd0 >> 1536 0x46f8a0 >> 1536 0x4c3ff4 >> 1536 0x4c4284 >> 1536 0x357d160 >> 1536 0x357faac >> 1536 >> Java_gnu_io_RXTXPort_open >> 1536 open >> $NOCANCEL$UNIX2003 >> 1536 open >> $NOCANCEL$UNIX2003 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From racecar at gmail.com Sat Nov 3 22:25:53 2007 From: racecar at gmail.com (Kevin Mateo Lim) Date: Sat, 3 Nov 2007 21:25:53 -0700 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: Message-ID: I am alternating between two errors. After i run the macosx_setup.command, "everyone" is set to Read only in /var/lock. I notice in the terminal that the group for these perms is _uucp, not uucp. In that state, I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 check_group_uucp(): error testing lock file creation Error details:Permission deniedcheck_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException : Error inside Serial.() at processing.serial.Serial.errorMessage(Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.( Serial.java:102) at Temporary_829_3245.setup(Temporary_829_3245.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java :690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) Then, I hand edit the "everyone" permissions for /var/lock/ to Read and Write (note /var/spool/uucp is Read/Write in all cases, and doesn't change). I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX uucp_lock() /var/lock/LK.003.009.000 is there gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException: Error inside Serial.() at processing.serial.Serial.errorMessage (Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.(Serial.java:102) at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java:690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) See here: http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071103/f1a2c467/attachment-0019.html From greg.johnson at manchester.ac.uk Sun Nov 4 02:31:13 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sun, 4 Nov 2007 10:31:13 +0100 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <28B5E0A0-0802-4C74-AC21-87ED35F3B9A2@manchester.ac.uk> Hi Nick, I also had problems initially with Leopard, but it was resolved by reinstalling the serial USB driver (FTDI in my case). The symptoms were a non-detection of any ports (but I twigged when I tried ZTerm and it had the same problem). Good luck! Cheers, greg PS I did a "Archive and install" which may be the reason my FTDI driver had disappeared - I don't think the driver has changed for 10.5 ------------------------------------------------------------------------- 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 4 Nov 2007, at 03:17, Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Sun Nov 4 13:01:12 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 15:01:12 -0500 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: Message-ID: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Hi, You will need to get the 2.1-8 code from CVS. See the FAQ for more information: http://rxtx.qbang.org/wiki/index.php/FAQ Andre On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > I am alternating between two errors. > > After i run the macosx_setup.command, "everyone" is set to Read only > in /var/lock. I notice in the terminal that the group for these > perms is _uucp, not uucp. > > In that state, I get this error: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > check_group_uucp(): error testing lock file creation Error > details:Permission deniedcheck_lock_status: No permission to create > lock file. > please see: How can I use Lock Files with rxtx? in INSTALL > gnu.io.PortInUseException: Unknown Application > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > java.lang.RuntimeException : Error inside Serial.() > > at processing.serial.Serial.errorMessage(Serial.java:583) > > at processing.serial.Serial.(Serial.java:148) > > at processing.serial.Serial.( Serial.java:102) > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > at processing.core.PApplet.run(PApplet.java:1556) > > at java.lang.Thread.run(Thread.java:613) > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > and Write (note /var/spool/uucp is Read/Write in all cases, and > doesn't change). I get this error: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > gnu.io.PortInUseException: Unknown Application > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > java.lang.RuntimeException: Error inside Serial.() > > at processing.serial.Serial.errorMessage (Serial.java:583) > > at processing.serial.Serial.(Serial.java:148) > > at processing.serial.Serial.(Serial.java:102) > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > at processing.core.PApplet.run(PApplet.java:1556) > > at java.lang.Thread.run(Thread.java:613) > > See here: > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From netbeans at gatworks.com Sun Nov 4 14:33:35 2007 From: netbeans at gatworks.com (U. George) Date: Sun, 04 Nov 2007 16:33:35 -0500 Subject: [Rxtx] #ifndef TIOCSERGETLSR Message-ID: <472E3AAF.7050709@gatworks.com> For Linux, it seems that you need the code for both *having* a TIOCSERGETLSR, and *not having* a TIOCSERGETLSR. Maybe the ioctl exists system wide, but not necessarily for the device driver itself ( always returns -1 ) . Are there systems that have a *functioning* TIOCSERGETLSR for all their devices? Then this would be the case where the "#ifndef TIOCSERGETLSR" directive could be useful is eliminating the unnecessary code and tests. And for those systems that dont have a TIOCSERGETLSR, then the code for TIOCSERGETLSR can be eliminated. It would be a simple case to have, as a foundation, all the code to simulate the missing TIOCSERGETLSR ioctl. If the system does have the ioctl, then that code can be ifdef'd in, and co-exist with the functionality of the code that simulates the missing TIOCSERGETLSR ioctl. From racecar at gmail.com Sun Nov 4 17:30:19 2007 From: racecar at gmail.com (Kevin Mateo Lim) Date: Sun, 4 Nov 2007 17:30:19 -0700 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: the README.OSX reads: Put libSerial.jnilib in the directory of the application (the JavaVM will find it there). Add RXTXComm.jar to the application classpath or include the classes in the application jar. (Some applications already include the RXTX classes in their application jar, in which case only the file libSerial.jnilib is required). I can't find libSerial.jnilib I put librxtxSerial.jnilib into my Processing /libraries/serial/library/ directory. Yet it still sees the old version: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 On 11/4/07, Andre-John Mas wrote: > > Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > 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/20071104/c0a83f91/attachment-0018.html From ajmas at sympatico.ca Sun Nov 4 17:41:47 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 19:41:47 -0500 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> If you are wanting it to be available for all applications, - for all users: /Library/Java/Extensions - for your user: ~/Library/Java/Extensions Or just for your application, then it should be in the same directory from which yo are launching your application. If you are getting the 2.1-8 source, then the library built is called: librxtxSerial.jnilib despite what the docs say. Andre On 4-Nov-07, at 19:30 , Kevin Mateo Lim wrote: > > the README.OSX reads: > Put > libSerial.jnilib > in the directory of the application (the JavaVM will find it there). > Add > RXTXComm.jar > to the application classpath or include the classes in the > application jar. > (Some applications already include the RXTX classes in their > application jar, > in which case only the file libSerial.jnilib is required). > > > I can't find libSerial.jnilib > I put librxtxSerial.jnilib into my Processing /libraries/serial/ > library/ directory. > > Yet it still sees the old version: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > On 11/4/07, Andre-John Mas wrote: Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial .(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay (PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > From bschlining at gmail.com Sun Nov 4 19:46:23 2007 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 4 Nov 2007 18:46:23 -0800 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> Message-ID: > > Or just for your application, then it should be in the same directory > from which yo are launching your application. Just wanted to add one more way of specifying the native lib location... If you don't want to define it globally by putting it in /Library/Java/Extensions (and you don't, it's a very very bad practice) you can also specify the location of the native library when starting the JVM by specifying the 'java.library.path' property. For example: java -Djava.library.path=/Path/To/Directory/With/RXTX/Library YourMainClass -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071104/c5af6980/attachment-0018.html From greg.johnson at manchester.ac.uk Mon Nov 5 01:39:02 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Mon, 5 Nov 2007 09:39:02 +0100 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: The 2.1-8 code reports 2.1-7, hence your (and my) confusion. But as long as you've removed all traces of the old library, it really _is_ 2.1-8. And if you specify the library path to the VM, don't make my mistake (on OSX at least) - you need to respecify the entire library path it had by default, as the command line argument replaces the path, rather than appending to it. 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 5 Nov 2007, at 01:30, Kevin Mateo Lim wrote: > > the README.OSX reads: > Put > libSerial.jnilib > in the directory of the application (the JavaVM will find it there). > Add > RXTXComm.jar > to the application classpath or include the classes in the > application jar. > (Some applications already include the RXTX classes in their > application jar, > in which case only the file libSerial.jnilib is required). > > > I can't find libSerial.jnilib > I put librxtxSerial.jnilib into my Processing /libraries/serial/ > library/ directory. > > Yet it still sees the old version: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > On 11/4/07, Andre-John Mas wrote: > Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial .(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay (PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > 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 HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071105/7f50506d/attachment-0018.html From cyrille.dumont at tatexpress.fr Mon Nov 5 05:46:03 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 05 Nov 2007 13:46:03 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: References: <472727F1.1000704@tatexpress.fr> Message-ID: <472F108B.2090101@tatexpress.fr> Thanks a lot for your solution ... but I'm not a expert in JAVA ... (sorry) For the moment I've this function : """ public void serialEvent(SerialPortEvent e) { StringBuffer inputBuffer = new StringBuffer(); int newData = 0; switch (e.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } //-- Manag. Data from Scanner this.MngDataScanner(inputBuffer.toString()); break; case SerialPortEvent.BI:; //-- Break Received } } """ How can I do what you write ? ( maybe a simple ex ? ) PS : I don't know the PDF417 size (could be, for example, 338 char, or 500 ... ; what I know is that it can't be more than 800 char) Thanks in advance. Best regards. Trent Jarvi a ?crit : > 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 Martin.Oberhuber at windriver.com Mon Nov 5 08:47:50 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 5 Nov 2007 16:47:50 +0100 Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> Hi Trent, are the interestes of hobbyists really so different from commercial ones? Both should be interested in high quality and innovation the like. I haven't seen too many Open Source projects from the "inside" but those that I have seen did not have separate mailing lists for quality/testing/qa versus innovation/development. What I have seen with the Open Source projects that one would call "successful" is a good deal of process around automated builds, automated unit tests, predictable release dates and milestones, and policies around commiting/contributing/reviewing changes. I think that all of these benefit commercial users and hobbyists the like. If you were just asking about who's interested in discussing changes to foster more quality, count me in. I'm just not sure whether discussing these on a separate mailing list or other channel is the right thing to do. Cheers, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From toupsz at cs.tamu.edu Tue Nov 6 14:27:04 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 15:27:04 -0600 Subject: [Rxtx] reading TTL level signals from serial? Message-ID: Dear RXTX community- I've been using RXTX to handle communicating with several hardware devices in Java (a GPS and some custom audio circuitry for my dissertation work). I have a new, high-accuracy GPS which only communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there any way to communicate with this device using RXTX, perhaps by modding the native code for Windows? If so, does anyone have any tips on how to do it? Has it perhaps already been done? Another option is for me to invert / amplify the signal in hardware, but this is difficult for me to pull off due to the sensitivity of the electronics involved...I'll likely end up using a much less accurate piece of equipment rather than go that far! If anyone could help out, I'd really appreciate it! Thanks! -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/b6c59c2b/attachment-0016.html From netbeans at gatworks.com Tue Nov 6 14:55:22 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 06 Nov 2007 16:55:22 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: Message-ID: <4730E2CA.3090009@gatworks.com> This is really a hardware issue. Is there any device ( ie the serial port ) on your computer that will accept the voltage signals ( and load ) that your device produces? Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it happen safely ( ie u dont cook the GPS device ) I have a new, high-accuracy GPS which only > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there > any way to communicate with this device using RXTX, From toupsz at cs.tamu.edu Tue Nov 6 15:14:01 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 16:14:01 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4730E2CA.3090009@gatworks.com> References: <4730E2CA.3090009@gatworks.com> Message-ID: Actually, the device runs over USB, but shows up as a virtual serial port and is outputting these signals. The software that comes with the device (a u-blox ANTARIS 4 eval kit) is able to communicate. RXTX is able to detect and properly configure the port, but does not get any of the data from it. :-/ It seems like there must be some way to do it (obviously, ublox knows how)... -Zach On Nov 6, 2007 3:55 PM, U. George wrote: > This is really a hardware issue. > Is there any device ( ie the serial port ) on your computer that will > accept the voltage signals ( and load ) that your device produces? > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it > happen safely ( ie u dont cook the GPS device ) > > > I have a new, high-accuracy GPS which only > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there > > any way to communicate with this device using RXTX, > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/15ae7a0b/attachment-0016.html From keithvz at verizon.net Tue Nov 6 16:16:55 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 06 Nov 2007 18:16:55 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> Message-ID: <4730F5E7.1030704@verizon.net> Zach Toups wrote: > On Nov 6, 2007 3:55 PM, U. George > wrote: > > This is really a hardware issue. > Is there any device ( ie the serial port ) on your computer that will > accept the voltage signals ( and load ) that your device produces? > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it > happen safely ( ie u dont cook the GPS device ) > > > I have a new, high-accuracy GPS which only > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is > there > > any way to communicate with this device using RXTX, > _______________________________________________ As UGeorge intimated, it's a hardware issue. If your device outputs TTL level voltages, and your USB to serial converter is RS-232, then you've got a physical hardware differences. Inverted leads and voltage issues are mainly the problem. MAXIM makes a neat little chip called the MAX233 (better than the 232, no extern caps required) You can't solve this in software. Now, there are TTL level compatible USB to serial converters available, I happen to be using one right now. This unit below is from a UK company (there might be sources in the US) http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm Parallax makes one that does 3.3 and 5v http://www.parallax.com/detail.asp?product_id=32201 (but only supports RX, TX, GND, AND DTR towards device) (i've tested a variant of the unit above, and it works with RXTX) In both cases, you'll need some creative wiring depending on the interface on your GPS. Hope this helps Keith From toupsz at cs.tamu.edu Tue Nov 6 16:53:01 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 17:53:01 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4730F5E7.1030704@verizon.net> References: <4730E2CA.3090009@gatworks.com> <4730F5E7.1030704@verizon.net> Message-ID: Yeah...I used an FTDI chip to handle USB/serial conversion on the audio equipment I built. I'm leery of trying to build a board for this ublox GPS due to all the grounding/shielding issues around it. Anyway, I apreciate the help...just sad that I can't handle the problem in software! Ublox did send me the source code for their USB drivers...but as a Java programmer, it's a bit tough for me to sort out. ;) Thanks again! -Zach On Nov 6, 2007 5:16 PM, Keith Monahan wrote: > Zach Toups wrote: > > > On Nov 6, 2007 3:55 PM, U. George > > wrote: > > > > This is really a hardware issue. > > Is there any device ( ie the serial port ) on your computer that > will > > accept the voltage signals ( and load ) that your device produces? > > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make > it > > happen safely ( ie u dont cook the GPS device ) > > > > > > I have a new, high-accuracy GPS which only > > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is > > there > > > any way to communicate with this device using RXTX, > > _______________________________________________ > > As UGeorge intimated, it's a hardware issue. > > If your device outputs TTL level voltages, and your USB to serial > converter is RS-232, then you've got a physical hardware differences. > Inverted leads and voltage issues are mainly the problem. MAXIM makes a > neat little chip called the MAX233 (better than the 232, no extern caps > required) > > You can't solve this in software. > > Now, there are TTL level compatible USB to serial converters available, > I happen to be using one right now. > > This unit below is from a UK company (there might be sources in the US) > > http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm > > Parallax makes one that does 3.3 and 5v > > http://www.parallax.com/detail.asp?product_id=32201 > (but only supports RX, TX, GND, AND DTR towards device) > > (i've tested a variant of the unit above, and it works with RXTX) > > In both cases, you'll need some creative wiring depending on the > interface on your GPS. > > Hope this helps > > Keith > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/06e88ad4/attachment-0016.html From netbeans at gatworks.com Tue Nov 6 17:14:01 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 06 Nov 2007 19:14:01 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> <4730F5E7.1030704@verizon.net> Message-ID: <47310349.5000406@gatworks.com> what gps chipset do u have? > Ublox did send me the source code for their USB drivers...but as a Java > programmer, it's a bit tough for me to sort out. ;) From Steffen.DETTMER at ingenico.com Wed Nov 7 03:10:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 7 Nov 2007 11:10:01 +0100 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> Message-ID: <20071107101000.GN10978@elberon.bln.de.ingenico.com> * Zach Toups wrote on Tue, Nov 06, 2007 at 16:14 -0600: > Actually, the device runs over USB, but shows up as a virtual > serial port and is outputting these signals. Ahh, so what you want is to use rxtx on the serial port that is created by the driver and mapped maybe as some COM8 or whatever? I this case then IMHO it would be no hardware question but maybe a problem in your application, or some driver or indeed a rxtx issue. > The software that > comes with the device (a u-blox ANTARIS 4 eval kit) is able to > communicate. Is it sure that this software is really using the virtual serial port and only this port? oki, Steffen -- About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Wed Nov 7 04:59:10 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 06:59:10 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <20071107101000.GN10978@elberon.bln.de.ingenico.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> Message-ID: <4731A88E.6080705@gatworks.com> >> The software that >> comes with the device (a u-blox ANTARIS 4 eval kit) is able to >> communicate. > > Is it sure that this software is really using the virtual serial > port and only this port? > I have tried to read the docs. I have yet to find any explanation on a (windoz) device driver for this device ( the usb device ). That magic is not explained. For a developer thats important magic. Maybe a call to their support team is in order? From netbeans at gatworks.com Wed Nov 7 05:01:38 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 07:01:38 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <20071107101000.GN10978@elberon.bln.de.ingenico.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> Message-ID: <4731A922.7@gatworks.com> Steffen DETTMER wrote: > * Zach Toups wrote on Tue, Nov 06, 2007 at 16:14 -0600: >> Actually, the device runs over USB, but shows up as a virtual BTW: it seems that I am not getting all the Rxtx mail. Is there still a problem? From toupsz at cs.tamu.edu Wed Nov 7 07:36:20 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Wed, 7 Nov 2007 08:36:20 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4731A88E.6080705@gatworks.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> <4731A88E.6080705@gatworks.com> Message-ID: When I emailed them about this issue, they sent me their WinCE drivers, which are apparently based on this open source driver: http://www.yetanotherhomepage.com/j7xx/j7xx.html?/j7xx/software/util/usbdriver.html These include srcdll, and x86 subfolders, though it's not 100% clear to me that these are useful. The ublox communication suite appears to only communicate with serial ports...I've communicated with the ublox on two different comm ports (one with the serial adapter plugged into the serial port, one with the main USB connection), as well as a Garmin bluetooth GPS (which comes up as a bluetooth serial device). I'm not well versed in code this close to the hardware, but it seems to me that if you're running a virtual serial port, then you're virtually controlling the "voltages" that come in on this "port"...so why would they be "ttl level"? :-/ Shouldn't the USB driver be able to interpret the signals in whatever way it wants and just supply software with the binary interpretation? Thanks for all the help, guys, it's really appreciated! -Zach On Nov 7, 2007 5:59 AM, U. George wrote: > > >> The software that > >> comes with the device (a u-blox ANTARIS 4 eval kit) is able to > >> communicate. > > > > Is it sure that this software is really using the virtual serial > > port and only this port? > > > > I have tried to read the docs. I have yet to find any explanation on a > (windoz) device driver for this device ( the usb device ). That magic > is not explained. For a developer thats important magic. Maybe a call > to their support team is in order? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071107/18a13314/attachment-0015.html From netbeans at gatworks.com Wed Nov 7 08:55:55 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 10:55:55 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> <4731A88E.6080705@gatworks.com> Message-ID: <4731E00B.9030902@gatworks.com> There are 2 components to talking to hardware. There is the electrical specification, and then there is the software specification. there is the rs232 specification, parallel port specification, and the USB electrical specification. Generally these are used to plug in the various devices, and hook up electrically. Then there is the software side. There is the device driver, a software component that sits somewhere in the kernel that handles the USB ( in your case ) controller. The device driver generally does not care about the electrical component. There are various chips that handle USB signals, and these chips have I/O addresses so that signals and data can be properly routed. There is also the side that communicates to the user via the COM port device-name. The device driver that you mentioned is for the "Support PL2303 serial chip". This device driver, which hopefully works, handles the USB chip, and eventually recognzes the gps device, and hopefully creates an COM port so the user can open up and communicate. These are a lot of "HOPES". Since u have the web address of the device driver, and developer, I would think that the developer, and any docs, might be better able to help u to first determine if the GPS device is recognized, and the COM port ( maybe its called by another name ) is created, as per documentation. > > These include srcdll, and x86 subfolders, though it's not 100% clear to > me that these are useful. From tjarvi at qbang.org Sat Nov 10 17:46:13 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Nov 2007 17:46:13 -0700 (MST) Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 5 Nov 2007, Oberhuber, Martin wrote: > Hi Trent, > > are the interestes of hobbyists really so different > from commercial ones? Both should be interested in > high quality and innovation the like. > > I haven't seen too many Open Source projects from the > "inside" but those that I have seen did not have > separate mailing lists for quality/testing/qa > versus innovation/development. > > What I have seen with the Open Source projects that > one would call "successful" is a good deal of > process around automated builds, automated unit > tests, predictable release dates and milestones, > and policies around commiting/contributing/reviewing > changes. > > I think that all of these benefit commercial users > and hobbyists the like. > > If you were just asking about who's interested in > discussing changes to foster more quality, count > me in. I'm just not sure whether discussing these > on a separate mailing list or other channel is the > right thing to do. > Hi Martin, There are two issues I'm thinking about. The first is the generic unit testing and quality initiatives required to move rxtx forward. The second is the inevitable fact that rxtx connects to external hardware. The discussion deals with a different set of problems. Here is a simple example of what I'm getting at. We have the capability of setting custom baud rates in rxtx. We may be interested in seeing regressions in rxtx, the C library or the kernel. Some people may be doing some tests with loopback connections. These will always work even if the baud rate is not set to the expected value. Some people may use null modems between two ports. This may be able to catch the problem but not always. Will the build machines be able to test this? (no - for a few reasons) Will people be trying to catch these type of regressions? (yes) What type of coverage does the community have in the end? (?) We could include the discussions in the same list or another equally open list that may be of interest to some folks that deal with these types of problems on a regular basis. -- Trent Jarvi tjarvi at qbang.org From timlow84 at gmail.com Mon Nov 12 00:31:17 2007 From: timlow84 at gmail.com (Timothy Low) Date: Mon, 12 Nov 2007 15:31:17 +0800 Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> Message-ID: <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> ---------- Forwarded message ---------- From: Timothy Low Date: Nov 12, 2007 3:02 PM Subject: Building RXTX From Source To: taj at www.linux.org.uk Cc: ferdinand.tang at tangs.net, Timothy Low , chweehuat.ng at tangs.net Hi Trent, I tried building RXTX from source, and I got this error. I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm trying to get the necessary ".so" files to use for my serial port communication through java. My linux kernal information is: *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 x86_64 x86_64 x86_64 GNU/Linux* I'll most glad if you can provide me some direction on this. Thanks ! ---------------- [root at smsgateway rxtx-2.0-7pre1]# ./configure checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu configure: WARNING: Trying libtool. If the following fails install libtool checking for gcc... gcc checking for C compiler default output... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking for ld used by GCC... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking for a sed that does not truncate output... /bin/sed checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking command to parse /usr/bin/nm -B output... ok checking how to run the C preprocessor... gcc -E checking for egrep... grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for ranlib... ranlib checking for strip... strip checking for objdir... .libs checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.lo... yes checking if gcc supports -fno-rtti -fno-exceptions... yes checking whether the linker (/usr/bin/ld) supports shared libraries... yes checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking dynamic linker characteristics... GNU/Linux ld.so checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no checking whether -lc should be explicitly linked in... no creating libtool checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking for style of include used by make... GNU checking dependency style of gcc... none checking fcntl.h usability... yes checking fcntl.h presence... yes checking for fcntl.h... yes checking sys/fcntl.h usability... yes checking sys/fcntl.h presence... yes checking for sys/fcntl.h... yes checking sys/file.h usability... yes checking sys/file.h presence... yes checking for sys/file.h... yes checking sys/time.h usability... yes checking sys/time.h presence... yes checking for sys/time.h... yes checking sys/signal.h usability... yes checking sys/signal.h presence... yes checking for sys/signal.h... yes checking signal.h usability... yes checking signal.h presence... yes checking for signal.h.. . yes checking termios.h usability... yes checking termios.h presence... yes checking for termios.h... yes checking asm/termbits.h usability... yes checking asm/termbits.h presence... yes checking for asm/termbits.h... yes checking grp.h usability... yes checking grp.h presence... yes checking for grp.h... yes checking pwd.h usability... yes checking pwd.h presence... yes checking for pwd.h... yes checking whether gcc needs -traditional... no checking whether to enable maintainer-specific portions of Makefiles... no /usr/java/jdk1.5.0_13 configure: WARNING: using JAVA_HOME environmental variable adjusted java.home is /usr/java/jdk1.5.0_13 checking os.name Linux checking os.arch i386 checking java.vendor Sun Microsystems Inc. checking java.version 1.5.0_13 checking os.version 2.6.18-8.el5xen comm.jar appears to be installed already. conftest.c: In function 'main': conftest.c:6: warning: incompatible implicit declaration of built-in function 'printf' conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:6: error: (Each undeclared identifier is reported only once conftest.c:6: error: for each function it appears in.) conftest.c:6: error: expected ')' before string constant conftest.c:7: warning: incompatible implicit declaration of built-in function 'exit' ./configure: line 9649: ./conftest: No such file or directory ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected conftest.c: In function 'main': conftest.c:5: warning: incompatible implicit declaration of built-in function 'printf' conftest.c:10: warning: incompatible implicit declaration of built-in function 'exit' configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status : config.h is unchanged config.status: executing depfiles commands [root at smsgateway rxtx-2.0-7pre1]# make install /usr/java/jdk1.5.0_13/bin/javac -classpath .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d /home/jboss/sources/rxtx- 2.0-7pre1/ -O /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java /home/jboss/sources/rxtx-2.0-7pre1/./src/UnSupportedLoggerException.java /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o /home/jboss/sources/rxtx-2.0-7pre1/x86_64-unknown-linux-gnu/SerialImp.lo /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'init_threads': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: cast from pointer to integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_nativeDrain': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: cast to pointer from integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'read_byte_array': /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: cast to pointer from integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_readArray': /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: comparison is always false due to limited range of data type /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_readTerminatedArray': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: comparison is always false due to limited range of data type mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial- 2.0.7pre1.* gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so -o .libs/librxtxSerial-2.0.7pre1.so (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.0.7pre1.so librxtxSerial.so) creating librxtxSerial.la (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la librxtxSerial.la) gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/ParallelImp.lo /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function 'Java_javax_comm_LPRPort_readArray': /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: comparison is always false due to limited range of data type rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* .libs/librxtxParallel-2.0.7pre1.* gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so -o .libs/librxtxParallel- 2.0.7pre1.so (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.0.7pre1.so librxtxParallel.so) creating librxtxParallel.la (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la librxtxParallel.la) make all-am make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' libtool: install: `x86_64-unknown-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 ------------- Regards, Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071112/27758c3c/attachment-0011.html From tjarvi at qbang.org Mon Nov 12 01:02:09 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Nov 2007 01:02:09 -0700 (MST) Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> Message-ID: On Mon, 12 Nov 2007, Timothy Low wrote: > > Hi Trent, Hi Tim, Comments are inline. As I mentioned off the list, rxtx 2.0 is on the edge of deprecation. We can get it working but this is not the path of least resistance for future work. You will probably need to bounce another round of questions off the list. The following is intended to isolate the problem. > > I tried building RXTX from source, and I got this error. > > > I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm trying > to get the necessary ".so" files to use for my serial port communication > through java. > My linux kernal information is: > > *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 x86_64 > x86_64 x86_64 GNU/Linux* > > I'll most glad if you can provide me some direction on this. Thanks ! > > ---------------- > [root at smsgateway rxtx-2.0-7pre1]# ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > checking for C compiler default output... a.out > checking whether the C compiler works... yes > checking whether we are cross compiling... no > checking for suffix of executables... > checking for suffix of object files... o > checking whether we are using the GNU C compiler... yes > checking whether gcc accepts -g... yes > checking for gcc option to accept ANSI C... none needed > checking for ld used by GCC... /usr/bin/ld > checking if the linker (/usr/bin/ld) is GNU ld... yes > checking for /usr/bin/ld option to reload object files... -r > checking for BSD-compatible nm... /usr/bin/nm -B > checking for a sed that does not truncate output... /bin/sed > checking whether ln -s works... yes > checking how to recognise dependent libraries... pass_all > checking command to parse /usr/bin/nm -B output... ok > checking how to run the C preprocessor... gcc -E > checking for egrep... grep -E > checking for ANSI C header files... yes > checking for sys/types.h... yes > checking for sys/stat.h... yes > checking for stdlib.h... yes > checking for string.h... yes > checking for memory.h... yes > checking for strings.h... yes > checking for inttypes.h... yes > checking for stdint.h... yes > checking for unistd.h... yes > checking dlfcn.h usability... yes > checking dlfcn.h presence... yes > checking for dlfcn.h... yes > checking for ranlib... ranlib > checking for strip... strip > checking for objdir... .libs > checking for gcc option to produce PIC... -fPIC > checking if gcc PIC flag -fPIC works... yes > checking if gcc static flag -static works... yes > checking if gcc supports -c -o file.o... yes > checking if gcc supports -c -o file.lo... yes > checking if gcc supports -fno-rtti -fno-exceptions... yes > checking whether the linker (/usr/bin/ld) supports shared libraries... yes > checking how to hardcode library paths into programs... immediate > checking whether stripping libraries is possible... yes > checking dynamic linker characteristics... GNU/Linux ld.so > checking if libtool supports shared libraries... yes > checking whether to build shared libraries... yes > checking whether to build static libraries... no > checking whether -lc should be explicitly linked in... no > creating libtool > checking for a BSD-compatible install... /usr/bin/install -c > checking whether build environment is sane... yes > checking for gawk... gawk > checking whether make sets $(MAKE)... yes > checking for style of include used by make... GNU > checking dependency style of gcc... none > checking fcntl.h usability... yes > checking fcntl.h presence... yes > checking for fcntl.h... yes > checking sys/fcntl.h usability... yes > checking sys/fcntl.h presence... yes > checking for sys/fcntl.h... yes > checking sys/file.h usability... yes > checking sys/file.h presence... yes > checking for sys/file.h... yes > checking sys/time.h usability... yes > checking sys/time.h presence... yes > checking for sys/time.h... yes > checking sys/signal.h usability... yes > checking sys/signal.h presence... yes > checking for sys/signal.h... yes > checking signal.h usability... yes > checking signal.h presence... yes > checking for signal.h.. . yes > checking termios.h usability... yes > checking termios.h presence... yes > checking for termios.h... yes > checking asm/termbits.h usability... yes > checking asm/termbits.h presence... yes > checking for asm/termbits.h... yes > checking grp.h usability... yes > checking grp.h presence... yes > checking for grp.h... yes > checking pwd.h usability... yes > checking pwd.h presence... yes > checking for pwd.h... yes > checking whether gcc needs -traditional... no > checking whether to enable maintainer-specific portions of Makefiles... no > /usr/java/jdk1.5.0_13 > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /usr/java/jdk1.5.0_13 > checking os.name Linux > checking os.arch i386 > checking java.vendor Sun Microsystems Inc. > checking java.version 1.5.0_13 > checking os.version 2.6.18-8.el5xen > comm.jar appears to be installed already. > conftest.c: In function 'main': > conftest.c:6: warning: incompatible implicit declaration of built-in > function 'printf' > conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:6: error: (Each undeclared identifier is reported only once > conftest.c:6: error: for each function it appears in.) > conftest.c:6: error: expected ')' before string constant This is an outdated kernel version check for when headers and kernels could cause problems for rxtx. If we made it past this, then you are OK. > conftest.c:7: warning: incompatible implicit declaration of built-in > function 'exit' > ./configure: line 9649: ./conftest: No such file or directory > ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected It blew up but continues.. > conftest.c: In function 'main': > conftest.c:5: warning: incompatible implicit declaration of built-in > function 'printf' > conftest.c:10: warning: incompatible implicit declaration of built-in > function 'exit' > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status : config.h is unchanged > config.status: executing depfiles commands > [root at smsgateway rxtx-2.0-7pre1]# make install > /usr/java/jdk1.5.0_13/bin/javac -classpath > .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d > /home/jboss/sources/rxtx- 2.0-7pre1/ -O > /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java > /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/UnSupportedLoggerException.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java > Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or > overrides a deprecated API. > Note: Recompile with -Xlint:deprecation for details. > /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* The java jar should be fine now. You may need to change the source files as mentioned below. > gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. > -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g > -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o > /home/jboss/sources/rxtx-2.0-7pre1/x86_64-unknown-linux-gnu/SerialImp.lo > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'init_threads': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: cast > from pointer to integer of different size > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_nativeDrain': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: cast to > pointer from integer of different size > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'read_byte_array': > /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: cast to > pointer from integer of different size As I recall, this was caused by pointers (now 64 bit rather than 32 bit) being stored in java ints (jints). I would look at the diff between the CVS 2.1 SerialImp.c and RXTXPort.java files against 2.0. We did fix those issues. You have a .so file but the different pointer sizes will cause runtime errors. > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_readArray': > /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: > comparison is always false due to limited range of data type > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_readTerminatedArray': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: > comparison is always false due to limited range of data type > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial- > 2.0.7pre1.* > gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so -o > .libs/librxtxSerial-2.0.7pre1.so > (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.0.7pre1.so > librxtxSerial.so) > creating librxtxSerial.la > (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la > librxtxSerial.la) > gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. > -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g > -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o > /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/ParallelImp.lo > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function > 'Java_javax_comm_LPRPort_readArray': > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: > comparison is always false due to limited range of data type > rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* > .libs/librxtxParallel-2.0.7pre1.* > gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so -o > .libs/librxtxParallel- 2.0.7pre1.so > (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.0.7pre1.so > librxtxParallel.so) > creating librxtxParallel.la > (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la > librxtxParallel.la) > make all-am > make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' > make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' > libtool: install: `x86_64-unknown-linux-gnu' must be an absolute directory > name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 A libtool change? Assuming you ran configure && make install in /home/jboss/sources/rxtx- 2.0-7pre1, libtool is looking for /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/.libs/librxtxSerial-2.0.7pre1.so. I think you have this? The file is just being copied to ~JAVA/jre/lib/$(JAVA_ARCH). -- Trent Jarvi tjarvi at qbang.org From sarah_662005 at yahoo.com Mon Nov 12 16:10:28 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Mon, 12 Nov 2007 15:10:28 -0800 (PST) Subject: [Rxtx] [urgent] device's power off detection Message-ID: <766782.10076.qm@web55803.mail.re3.yahoo.com> Hello all, I have a small application built on top of rxtx api. This application can retrieve the incoming data from a device through a port. The device can be powered off after the port get closed from the application. I have been trying a couple of hours to find a way to detect the power switching from device. If anyone knows how to handle it through rxtx, could you please give me a help? Thank you very much. r, Sara ____________________________________________________________________________________ Get easy, one-click access to your favorites. Make Yahoo! your homepage. http://www.yahoo.com/r/hs -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071112/4599f3ec/attachment-0010.html From netbeans at gatworks.com Mon Nov 12 17:52:22 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 12 Nov 2007 19:52:22 -0500 Subject: [Rxtx] [urgent] device's power off detection In-Reply-To: <766782.10076.qm@web55803.mail.re3.yahoo.com> References: <766782.10076.qm@web55803.mail.re3.yahoo.com> Message-ID: <4738F546.5010101@gatworks.com> Not sure what u are asking for. Are u asking for a way to detect if the device is OFF? Are u asking how to power off the device - via software ? Is it a Serial device? is it a parallel device? is it a usb device? Sara Hugh wrote: > Hello all, > I have a small application built on top of rxtx api. This application > can retrieve the incoming data from a device through a port. The device > can be powered off after the port get closed from the application. I > have been trying a couple of hours to find a way to detect the power > switching from device. If anyone knows how to handle it through rxtx, > could you please give me a help? Thank you very much. From tjarvi at qbang.org Mon Nov 12 22:48:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Nov 2007 22:48:11 -0700 (MST) Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711120225x562db8cbxb750767ade3b0d73@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> <900c6ba90711120031p66edc001ted76f7ba24e34b98@mail.gmail.com> <900c6ba90711120225x562db8cbxb750767ade3b0d73@mail.gmail.com> Message-ID: Hi Tim, The gnu.io namespace looks just like the javax.comm 2.0 namespace. There are additional (discouraged) undocumented methods in gnu.io that you need not use. We just used the different namespace to avoid poluting Sun's by mistake and to make sure we stayed off any potential licensing related radar. Usuaully, you just change your imports and make sure you do not use the javax.comm namespace for anything like exception handling. As I mentioned off the list, there are no issues with rxtx going through the JSR process to be more Sun friendly other than time. rxtx has no hidden intentions there; anything that does not work like CommAPI 2.0 documented is a bug. The reason we do not support CommAPI 2.1 is technical in nature and is in the list archives as well as the front page of www.rxtx.org. On Mon, 12 Nov 2007, Timothy Low wrote: > Hi Trent, > > I'll move to use a JDK1.5 64-bit version... but do I need to make any source > code changes to use the package (gnu.io) in the RTXTcomm.jar instead of the > ones from the javacomm api ? > > > Regards, > Tim > > On Nov 12, 2007 5:22 PM, Trent Jarvi wrote: > >> >> Hi Tim, >> >> I see a couple things here. >> >> First your jdk is for i686 yet the library is compiled on a x86_64 >> machine. You may try passing configure the --target=i686-unknown-linux to >> try using the i686 backend to gcc if it is available. Or move to the 64 >> bit jdk. >> >> The other error I see is again the moved UTF_RELEASE define that we need >> to fix. You can probably get around that with: >> >> make -DUTF_RELEASE=`uname -r` >> >> even more simple would be to just specify the serial library which should >> be in configure --help. >> >> You can remove the UTF_RELEASE check from configure by editing >> configure.in, searching for the simple C program check and deleting it. >> Running autoconf after that will regenerate a new configure without the >> check. >> >> Note that you should remove the previous native libraries >> (librxtxSerial.so) when moving from rxtx 2.0 to 2.1. These are compiled >> for different namespaces (javax.comm/gnu.io). >> >> On Mon, 12 Nov 2007, Timothy Low wrote: >> >>> *Hi Trent, >>> >>> I moved on to rxtx 2.1.7r2, and updated my jre to 1.6.0 (64-bit)... I >> tried >>> the following 2 methods: >>> >>> (1) using the rxtx 2.1.7 binaries from the RXTX website* >>> *Are these binaries suitable for a 64-bit OS ? There mentioning of the >>> gnu.io that you've talked about previously...* >>> ------ >>> [root at smsgateway sources]# java -Djava.library.path=/usr/lib PortLister >>> Experimental: JNI_OnLoad called. >>> >>> java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion >>> ()Ljava/lang/String; >>> at gnu.io.RXTXCommDriver.nativeGetVersion(Native Method) >>> at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:85) >>> at java.lang.Class.forName0(Native Method) >>> at java.lang.Class.forName(Unknown Source) >>> at javax.comm.CommPortIdentifier.loadDriver( >> CommPortIdentifier.java >>> :237) >>> at javax.comm.CommPortIdentifier.(CommPortIdentifier.java >>> :109) >>> at PortLister.(PortLister.java:6) >>> at PortLister.main(PortLister.java:25) >>> Exception in thread "main" java.lang.UnsatisfiedLinkError: >>> com.sun.comm.SunrayInfo.isSessionActive()Z >>> at com.sun.comm.SunrayInfo.isSessionActive(Native Method) >>> at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java >> :155) >>> at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java >>> :100) >>> at javax.comm.CommPortIdentifier.(CommPortIdentifier.java >>> :138) >>> at PortLister.(PortLister.java:6) >>> at PortLister.main(PortLister.java:25) >>> >>> ------ >>> >>> (2) compiling the rxtx 2.1.7 from source >>> *but i got the following error while running ./configure and make all* >>> >>> ------ >>> [root at smsgateway rxtx-2.1-7r2]# ./configure >>> checking build system type... x86_64-unknown-linux-gnu >>> checking host system type... x86_64-unknown-linux-gnu >>> checking target system type... x86_64-unknown-linux-gnu >>> configure: WARNING: Trying libtool. If the following fails install >> libtool >>> checking for gcc... gcc >>> checking for C compiler default output file name... a.out >>> checking whether the C compiler works... yes >>> checking whether we are cross compiling... no >>> checking for suffix of executables... >>> checking for suffix of object files... o >>> checking whether we are using the GNU C compiler... yes >>> checking whether gcc accepts -g... yes >>> checking for gcc option to accept ANSI C... none needed >>> checking for a sed that does not truncate output... /bin/sed >>> checking for egrep... grep -E >>> checking for ld used by gcc... /usr/bin/ld >>> checking if the linker (/usr/bin/ld) is GNU ld... yes >>> checking for /usr/bin/ld option to reload object files... -r >>> checking for BSD-compatible nm... /usr/bin/nm -B >>> checking whether ln -s works... yes >>> checking how to recognise dependent libraries... pass_all >>> checking how to run the C preprocessor... gcc -E >>> checking for ANSI C header files... yes >>> checking for sys/types.h... yes >>> checking for sys/stat.h... yes >>> checking for stdlib.h... yes >>> checking for string.h... yes >>> checking for memory.h... yes >>> checking for strings.h... yes >>> checking for inttypes.h... yes >>> checking for stdint.h... yes >>> checking for unistd.h... yes >>> checking dlfcn.h usability... yes >>> checking dlfcn.h presence... yes >>> checking for dlfcn.h... yes >>> checking for g++... g++ >>> checking whether we are using the GNU C++ compiler... yes >>> checking whether g++ accepts -g... yes >>> checking how to run the C++ preprocessor... g++ -E >>> checking for g77... no >>> checking for f77... no >>> checking for xlf... no >>> checking for frt... no >>> checking for pgf77... no >>> checking for fort77... no >>> checking for fl32... no >>> checking for af77... no >>> checking for f90... no >>> checking for xlf90... no >>> checking for pgf90... no >>> checking for epcf90... no >>> checking for f95... f95 >>> checking whether we are using the GNU Fortran 77 compiler... yes >>> checking whether f95 accepts -g... yes >>> checking the maximum length of command line arguments... 32768 >>> checking command to parse /usr/bin/nm -B output from gcc object... ok >>> checking for objdir... .libs >>> checking for ar... ar >>> checking for ranlib... ranlib >>> checking for strip... strip >>> checking if gcc static flag works... yes >>> checking if gcc supports -fno-rtti -fno-exceptions... no >>> checking for gcc option to produce PIC... -fPIC >>> checking if gcc PIC flag -fPIC works... yes >>> checking if gcc supports -c -o file.o... yes >>> checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking whether -lc should be explicitly linked in... no >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> checking if libtool supports shared libraries... yes >>> checking whether to build shared libraries... yes >>> checking whether to build static libraries... no >>> configure: creating libtool >>> appending configuration tag "CXX" to libtool >>> checking for ld used by g++... /usr/bin/ld -m elf_x86_64 >>> checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes >>> checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking for g++ option to produce PIC... -fPIC >>> checking if g++ PIC flag -fPIC works... yes >>> checking if g++ supports -c -o file.o... yes >>> checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> appending configuration tag "F77" to libtool >>> checking if libtool supports shared libraries... yes >>> checking whether to build shared libraries... yes >>> checking whether to build static libraries... no >>> checking for f95 option to produce PIC... -fPIC >>> checking if f95 PIC flag -fPIC works... yes >>> checking if f95 supports -c -o file.o... yes >>> checking whether the f95 linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> checking for a BSD-compatible install... /usr/bin/install -c >>> checking whether build environment is sane... yes >>> checking for gawk... gawk >>> checking whether make sets $(MAKE)... yes >>> checking for style of include used by make... GNU >>> checking dependency style of gcc... none >>> checking dependency style of g++... none >>> checking fcntl.h usability... yes >>> checking fcntl.h presence... yes >>> checking for fcntl.h... yes >>> checking sys/fcntl.h usability... yes >>> checking sys/fcntl.h presence... yes >>> checking for sys/fcntl.h... yes >>> checking sys/file.h usability... yes >>> checking sys/file.h presence... yes >>> checking for sys/file.h... yes >>> checking sys/time.h usability... yes >>> checking sys/time.h presence... yes >>> checking for sys/time.h... yes >>> checking sys/signal.h usability... yes >>> checking sys/signal.h presence... yes >>> checking for sys/signal.h... yes >>> checking signal.h usability... yes >>> checking signal.h presence... yes >>> checking for signal.h... yes >>> checking termios.h usability... yes >>> checking termios.h presence... yes >>> checking for termios.h... yes >>> checking grp.h usability... yes >>> checking grp.h presence... yes >>> checking for grp.h... yes >>> checking pwd.h usability... yes >>> checking pwd.h presence... yes >>> checking for pwd.h... yes >>> checking whether gcc needs -traditional... no >>> checking whether to enable maintainer-specific portions of Makefiles... >> no >>> /usr/java/jdk1.5.0_13 >>> configure: WARNING: using JAVA_HOME environmental variable >>> adjusted java.home is /usr/java/jdk1.5.0_13 >>> checking os.name Linux >>> checking os.arch i386 >>> checking java.vendor Sun Microsystems Inc. >>> checking java.version 1.5.0_13 >>> checking os.version 2.6.18-8.el5xen >>> conftest.c: In function 'main': >>> conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this >> function) >>> conftest.c:8: error: (Each undeclared identifier is reported only once >>> conftest.c:8: error: for each function it appears in.) >>> conftest.c:8: error: expected ')' before string constant >>> ./configure: line 21462: ./conftest: No such file or directory >>> ./configure: line 21462: test: 2.6.18-8.el5xen: unary operator expected >>> configure: creating ./config.status >>> config.status: creating Makefile >>> config.status: creating config.h >>> config.status: executing depfiles commands >>> [root at smsgateway rxtx-2.1-7r2]# make install >>> /usr/java/jdk1.5.0_13/bin/javac -classpath .:/home/jboss/sources/rxtx- >>> >> 2.1-7r2:/home/jboss/sources/rxtx-2.1-7r2/src:/usr/java/jdk1.5.0_13/jre/lib/ext/RXTXcomm.jar-d >>> /home/jboss/sources/rxtx- >>> 2.1-7r2/ -O -source 1.3 -target 1.3 >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommDriver.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortEnumerator.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortIdentifier.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortOwnershipListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Configure.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2C.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/I2CPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/LPRPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/NoSuchPortException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/PortInUseException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Raw.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/RawPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RawPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RawPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/RS485PortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485PortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485Port.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXCommDriver.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXVersion.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPort.java >>> /home/jboss/sources/rxtx-2.1-7r2 >> /./src/UnsupportedCommOperationException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/UnSupportedLoggerException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Zystem.java >>> /usr/java/jdk1.5.0_13/bin/javah -classpath .:/home/jboss/sources/rxtx- >>> >> 2.1-7r2:/home/jboss/sources/rxtx-2.1-7r2/src:/usr/java/jdk1.5.0_13/jre/lib/ext/RXTXcomm.jar-d >>> x86_64-unknown-linux-gnu -jni `(for i in CommDriver CommPortEnumerator >>> CommPortIdentifier CommPort CommPortOwnershipListener Configure I2C >>> I2CPortEvent I2CPortEventListener I2CPort LPRPort NoSuchPortException >>> ParallelPortEvent ParallelPortEventListener ParallelPort >> PortInUseException >>> Raw RawPortEvent RawPortEventListener RawPort RS485 RS485PortEvent >>> RS485PortEventListener RS485Port RXTXCommDriver RXTXPort RXTXVersion >>> SerialPortEvent SerialPortEventListener SerialPort >>> UnsupportedCommOperationException UnSupportedLoggerException Zystem;do \ >>> if grep > /dev/null native.*\( /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/$i.java; then \ >>> echo gnu.io.$i; \ >>> fi; \ >>> done)` >>> /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialImp.c -o >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo; >>> \ >>> if [ "Serial" = "Serial" ]; >>> then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxSerial.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxSerial.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo; >> \ >>> fi; \ >>> ) >>> mkdir /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/.libs >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/SerialImp.o >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/fuserImp.o >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c: In function >> 'show_user': >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c:238: warning: cast >> from >>> pointer to integer of different size >>> gcc -shared /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/SerialImp.o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/fuserImp.o >>> -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7.so -o >> .libs/librxtxSerial- >>> 2.1-7.so >>> (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.1-7.so >>> librxtxSerial.so) >>> creating librxtxSerial.la >>> (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la >>> librxtxSerial.la) >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelImp.c -o >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/ParallelImp.lo; >>> \ >>> if [ "Parallel" = "Serial" ]; >>> then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxParallel.la -rpath >>> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/ParallelImp.lo >>> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxParallel.la -rpath >>> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/ParallelImp.lo; >>> \ >>> fi; \ >>> ) >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >>> /x86_64-unknown-linux-gnu/.libs/ParallelImp.o >>> gcc -shared /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/ParallelImp.o >>> -lpthread -Wl,-soname -Wl,librxtxParallel-2.1-7.so -o >>> .libs/librxtxParallel-2.1-7.so >>> (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.1-7.so >>> librxtxParallel.so) >>> creating librxtxParallel.la >>> (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la >>> librxtxParallel.la) >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo; >>> \ >>> if [ "I2C" = "Serial" ]; then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxI2C.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo >>> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxI2C.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo; >>> \ >>> fi; \ >>> ) >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/.libs/I2CImp.o >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c: In function >>> 'Java_gnu_io_I2CPort_Initialize': >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: 'UTS_RELEASE' >>> undeclared (first use in this function) >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: (Each >> undeclared >>> identifier is reported only once >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: for each >> function >>> it appears in.) >>> libtool: link: `/home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/I2CImp.lo' >>> is not a valid libtool object >>> make: *** [x86_64-unknown-linux-gnu/librxtxI2C.la] Error 1 >>> >>> ------ >>> >>> >>> >>> On Nov 12, 2007 4:02 PM, Trent Jarvi wrote: >>> >>>> On Mon, 12 Nov 2007, Timothy Low wrote: >>>>> >>>>> Hi Trent, >>>> >>>> Hi Tim, >>>> >>>> Comments are inline. As I mentioned off the list, rxtx 2.0 is on the >> edge >>>> of deprecation. We can get it working but this is not the path of >> least >>>> resistance for future work. >>>> >>>> You will probably need to bounce another round of questions off the >> list. >>>> The following is intended to isolate the problem. >>>> >>>>> >>>>> I tried building RXTX from source, and I got this error. >>>>> >>>>> >>>>> I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm >>>> trying >>>>> to get the necessary ".so" files to use for my serial port >> communication >>>>> through java. >>>>> My linux kernal information is: >>>>> >>>>> *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 >>>> x86_64 >>>>> x86_64 x86_64 GNU/Linux* >>>>> >>>>> I'll most glad if you can provide me some direction on this. Thanks ! >>>>> >>>>> ---------------- >>>>> [root at smsgateway rxtx-2.0-7pre1]# ./configure >>>>> checking build system type... x86_64-unknown-linux-gnu >>>>> checking host system type... x86_64-unknown-linux-gnu >>>>> checking target system type... x86_64-unknown-linux-gnu >>>>> configure: WARNING: Trying libtool. If the following fails install >>>> libtool >>>>> checking for gcc... gcc >>>>> checking for C compiler default output... a.out >>>>> checking whether the C compiler works... yes >>>>> checking whether we are cross compiling... no >>>>> checking for suffix of executables... >>>>> checking for suffix of object files... o >>>>> checking whether we are using the GNU C compiler... yes >>>>> checking whether gcc accepts -g... yes >>>>> checking for gcc option to accept ANSI C... none needed >>>>> checking for ld used by GCC... /usr/bin/ld >>>>> checking if the linker (/usr/bin/ld) is GNU ld... yes >>>>> checking for /usr/bin/ld option to reload object files... -r >>>>> checking for BSD-compatible nm... /usr/bin/nm -B >>>>> checking for a sed that does not truncate output... /bin/sed >>>>> checking whether ln -s works... yes >>>>> checking how to recognise dependent libraries... pass_all >>>>> checking command to parse /usr/bin/nm -B output... ok >>>>> checking how to run the C preprocessor... gcc -E >>>>> checking for egrep... grep -E >>>>> checking for ANSI C header files... yes >>>>> checking for sys/types.h... yes >>>>> checking for sys/stat.h... yes >>>>> checking for stdlib.h... yes >>>>> checking for string.h... yes >>>>> checking for memory.h... yes >>>>> checking for strings.h... yes >>>>> checking for inttypes.h... yes >>>>> checking for stdint.h... yes >>>>> checking for unistd.h... yes >>>>> checking dlfcn.h usability... yes >>>>> checking dlfcn.h presence... yes >>>>> checking for dlfcn.h... yes >>>>> checking for ranlib... ranlib >>>>> checking for strip... strip >>>>> checking for objdir... .libs >>>>> checking for gcc option to produce PIC... -fPIC >>>>> checking if gcc PIC flag -fPIC works... yes >>>>> checking if gcc static flag -static works... yes >>>>> checking if gcc supports -c -o file.o... yes >>>>> checking if gcc supports -c -o file.lo... yes >>>>> checking if gcc supports -fno-rtti -fno-exceptions... yes >>>>> checking whether the linker (/usr/bin/ld) supports shared libraries... >>>> yes >>>>> checking how to hardcode library paths into programs... immediate >>>>> checking whether stripping libraries is possible... yes >>>>> checking dynamic linker characteristics... GNU/Linux ld.so >>>>> checking if libtool supports shared libraries... yes >>>>> checking whether to build shared libraries... yes >>>>> checking whether to build static libraries... no >>>>> checking whether -lc should be explicitly linked in... no >>>>> creating libtool >>>>> checking for a BSD-compatible install... /usr/bin/install -c >>>>> checking whether build environment is sane... yes >>>>> checking for gawk... gawk >>>>> checking whether make sets $(MAKE)... yes >>>>> checking for style of include used by make... GNU >>>>> checking dependency style of gcc... none >>>>> checking fcntl.h usability... yes >>>>> checking fcntl.h presence... yes >>>>> checking for fcntl.h... yes >>>>> checking sys/fcntl.h usability... yes >>>>> checking sys/fcntl.h presence... yes >>>>> checking for sys/fcntl.h... yes >>>>> checking sys/file.h usability... yes >>>>> checking sys/file.h presence... yes >>>>> checking for sys/file.h... yes >>>>> checking sys/time.h usability... yes >>>>> checking sys/time.h presence... yes >>>>> checking for sys/time.h... yes >>>>> checking sys/signal.h usability... yes >>>>> checking sys/signal.h presence... yes >>>>> checking for sys/signal.h... yes >>>>> checking signal.h usability... yes >>>>> checking signal.h presence... yes >>>>> checking for signal.h.. . yes >>>>> checking termios.h usability... yes >>>>> checking termios.h presence... yes >>>>> checking for termios.h... yes >>>>> checking asm/termbits.h usability... yes >>>>> checking asm/termbits.h presence... yes >>>>> checking for asm/termbits.h... yes >>>>> checking grp.h usability... yes >>>>> checking grp.h presence... yes >>>>> checking for grp.h... yes >>>>> checking pwd.h usability... yes >>>>> checking pwd.h presence... yes >>>>> checking for pwd.h... yes >>>>> checking whether gcc needs -traditional... no >>>>> checking whether to enable maintainer-specific portions of >> Makefiles... >>>> no >>>>> /usr/java/jdk1.5.0_13 >>>>> configure: WARNING: using JAVA_HOME environmental variable >>>>> adjusted java.home is /usr/java/jdk1.5.0_13 >>>>> checking os.name Linux >>>>> checking os.arch i386 >>>>> checking java.vendor Sun Microsystems Inc. >>>>> checking java.version 1.5.0_13 >>>>> checking os.version 2.6.18-8.el5xen >>>>> comm.jar appears to be installed already. >>>>> conftest.c: In function 'main': >>>>> conftest.c:6: warning: incompatible implicit declaration of built-in >>>>> function 'printf' >>>>> conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this >>>> function) >>>>> conftest.c:6: error: (Each undeclared identifier is reported only once >>>>> conftest.c:6: error: for each function it appears in.) >>>>> conftest.c:6: error: expected ')' before string constant >>>> >>>> >>>> This is an outdated kernel version check for when headers and kernels >>>> could cause problems for rxtx. If we made it past this, then you are >> OK. >>>> >>>> >>>>> conftest.c:7: warning: incompatible implicit declaration of built-in >>>>> function 'exit' >>>>> ./configure: line 9649: ./conftest: No such file or directory >>>>> ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected >>>> >>>> It blew up but continues.. >>>> >>>>> conftest.c: In function 'main': >>>>> conftest.c:5: warning: incompatible implicit declaration of built-in >>>>> function 'printf' >>>>> conftest.c:10: warning: incompatible implicit declaration of built-in >>>>> function 'exit' >>>>> configure: creating ./config.status >>>>> config.status: creating Makefile >>>>> config.status: creating config.h >>>>> config.status : config.h is unchanged >>>>> config.status: executing depfiles commands >>>>> [root at smsgateway rxtx-2.0-7pre1]# make install >>>>> /usr/java/jdk1.5.0_13/bin/javac -classpath >>>>> .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/ -O >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1 >> /./src/UnSupportedLoggerException.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java >>>>> Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or >>>>> overrides a deprecated API. >>>>> Note: Recompile with -Xlint:deprecation for details. >>>>> /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* >>>> >>>> >>>> The java jar should be fine now. You may need to change the source >> files >>>> as mentioned below. >>>> >>>>> gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu >> -I. >>>>> -I/usr/java/jdk1.5.0_13/include >> -I/usr/java/jdk1.5.0_13/include/./linux/ >>>> -g >>>>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o >>>>> /home/jboss/sources/rxtx-2.0-7pre1 >> /x86_64-unknown-linux-gnu/SerialImp.lo >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'init_threads': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: >>>> cast >>>>> from pointer to integer of different size >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_nativeDrain': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: >>>> cast to >>>>> pointer from integer of different size >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'read_byte_array': >>>>> /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: >>>> cast to >>>>> pointer from integer of different size >>>> >>>> >>>> As I recall, this was caused by pointers (now 64 bit rather than 32 >> bit) >>>> being stored in java ints (jints). I would look at the diff between >> the >>>> CVS 2.1 SerialImp.c and RXTXPort.java files against 2.0. We >>>> did fix those issues. >>>> >>>> You have a .so file but the different pointer sizes will cause runtime >>>> errors. >>>> >>>> >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_readArray': >>>>> /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: >>>>> comparison is always false due to limited range of data type >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_readTerminatedArray': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: >>>>> comparison is always false due to limited range of data type >>>>> mkdir .libs >>>>> rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* >> .libs/librxtxSerial- >>>>> 2.0.7pre1.* >>>>> gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so-o >>>>> .libs/librxtxSerial-2.0.7pre1.so >>>>> (cd .libs && rm -f librxtxSerial.so && ln -s >> librxtxSerial-2.0.7pre1.so >>>>> librxtxSerial.so) >>>>> creating librxtxSerial.la >>>>> (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la >>>>> librxtxSerial.la) >>>>> gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu >> -I. >>>>> -I/usr/java/jdk1.5.0_13/include >> -I/usr/java/jdk1.5.0_13/include/./linux/ >>>> -g >>>>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o >>>>> /home/jboss/sources/rxtx- 2.0-7pre1 >>>> /x86_64-unknown-linux-gnu/ParallelImp.lo >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function >>>>> 'Java_javax_comm_LPRPort_readArray': >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: >>>>> comparison is always false due to limited range of data type >>>>> rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* >>>>> .libs/librxtxParallel-2.0.7pre1.* >>>>> gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so-o >>>>> .libs/librxtxParallel- 2.0.7pre1.so >>>>> (cd .libs && rm -f librxtxParallel.so && ln -s >>>> librxtxParallel-2.0.7pre1.so >>>>> librxtxParallel.so) >>>>> creating librxtxParallel.la >>>>> (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la >>>>> librxtxParallel.la) >>>>> make all-am >>>>> make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' >>>>> make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' >>>>> libtool: install: `x86_64-unknown-linux-gnu' must be an absolute >>>> directory >>>>> name >>>>> Try `libtool --help --mode=install' for more information. >>>>> make: *** [install] Error 1 >>>> >>>> A libtool change? Assuming you ran configure && make install in >>>> /home/jboss/sources/rxtx- 2.0-7pre1, libtool is looking for >>>> /home/jboss/sources/rxtx- >>>> 2.0-7pre1/x86_64-unknown-linux-gnu/.libs/librxtxSerial-2.0.7pre1.so. >>>> >>>> I think you have this? The file is just being copied to >>>> ~JAVA/jre/lib/$(JAVA_ARCH). >>>> >>>> -- >>>> Trent Jarvi >>>> tjarvi at qbang.org >>>> >>> >> > From guido.vogt at celsi.ch Tue Nov 13 00:28:01 2007 From: guido.vogt at celsi.ch (Guido Vogt) Date: Tue, 13 Nov 2007 08:28:01 +0100 Subject: [Rxtx] RTS Line can't be set Message-ID: <47395201.1050400@celsi.ch> I'm working on an Windows XP /SP2 System. Version of RXTX: 2.1.7. The serial line is connected to a modem. As I can see, the RTS-Line of the serial Port is inactive, when the port is opened (flowcontrol=none). Obviously, no data is coming from the modem. If I use the setRTS(true) command after open, the comport does not send out my data any more. This behaviour is regardless of flowcontrol. Anybody has an idea what do do? Thanks for help. From Martin.Oberhuber at windriver.com Tue Nov 13 08:58:23 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 13 Nov 2007 16:58:23 +0100 Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803880918@ism-mail03.corp.ad.wrs.com> Hi Trent, as said before, I like the idea of discussing such quality engineering issues, but why hide these away from the rest of the public? Anyways, if you do want to create a new mailing list for these kinds of things I'll happily subscribe. 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: Sunday, November 11, 2007 1:46 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: RE: [Rxtx] Quality Engineering with rxtx > > On Mon, 5 Nov 2007, Oberhuber, Martin wrote: > > > Hi Trent, > > > > are the interestes of hobbyists really so different > > from commercial ones? Both should be interested in > > high quality and innovation the like. > > > > I haven't seen too many Open Source projects from the > > "inside" but those that I have seen did not have > > separate mailing lists for quality/testing/qa > > versus innovation/development. > > > > What I have seen with the Open Source projects that > > one would call "successful" is a good deal of > > process around automated builds, automated unit > > tests, predictable release dates and milestones, > > and policies around commiting/contributing/reviewing > > changes. > > > > I think that all of these benefit commercial users > > and hobbyists the like. > > > > If you were just asking about who's interested in > > discussing changes to foster more quality, count > > me in. I'm just not sure whether discussing these > > on a separate mailing list or other channel is the > > right thing to do. > > > > Hi Martin, > > There are two issues I'm thinking about. The first is the > generic unit > testing and quality initiatives required to move rxtx > forward. The second > is the inevitable fact that rxtx connects to external hardware. The > discussion deals with a different set of problems. > > Here is a simple example of what I'm getting at. > > We have the capability of setting custom baud rates in rxtx. > We may be > interested in seeing regressions in rxtx, the C library or > the kernel. > Some people may be doing some tests with loopback > connections. These will > always work even if the baud rate is not set to the expected > value. Some > people may use null modems between two ports. This may be > able to catch > the problem but not always. > > Will the build machines be able to test this? (no - for a few reasons) > Will people be trying to catch these type of regressions? (yes) > What type of coverage does the community have in the end? (?) > > We could include the discussions in the same list or another > equally open > list that may be of interest to some folks that deal with > these types of > problems on a regular basis. > > -- > Trent Jarvi > tjarvi at qbang.org > From toupsz at cs.tamu.edu Tue Nov 13 10:33:03 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 13 Nov 2007 11:33:03 -0600 Subject: [Rxtx] [urgent] device's power off detection In-Reply-To: <4738F546.5010101@gatworks.com> References: <766782.10076.qm@web55803.mail.re3.yahoo.com> <4738F546.5010101@gatworks.com> Message-ID: Lacking any other specification on it...but can you set up the device to notify your software when it turns off? Send a message or somesuch? Maybe it can signal using RTS or DTR? -Zach On Nov 12, 2007 6:52 PM, U. George wrote: > Not sure what u are asking for. Are u asking for a way to detect if the > device is OFF? Are u asking how to power off the device - via software ? > Is it a Serial device? > is it a parallel device? > is it a usb device? > > Sara Hugh wrote: > > Hello all, > > I have a small application built on top of rxtx api. This application > > can retrieve the incoming data from a device through a port. The device > > can be powered off after the port get closed from the application. I > > have been trying a couple of hours to find a way to detect the power > > switching from device. If anyone knows how to handle it through rxtx, > > could you please give me a help? Thank you very much. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071113/e5859e4d/attachment-0009.html From tjarvi at qbang.org Tue Nov 13 20:02:03 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 13 Nov 2007 20:02:03 -0700 (MST) Subject: [Rxtx] #ifndef TIOCSERGETLSR In-Reply-To: <472E3AAF.7050709@gatworks.com> References: <472E3AAF.7050709@gatworks.com> Message-ID: On Sun, 4 Nov 2007, U. George wrote: > For Linux, it seems that you need the code for both *having* a > TIOCSERGETLSR, and *not having* a TIOCSERGETLSR. Maybe the ioctl exists > system wide, but not necessarily for the device driver itself ( always > returns -1 ) . > > Are there systems that have a *functioning* TIOCSERGETLSR for all their > devices? Then this would be the case where the "#ifndef TIOCSERGETLSR" > directive could be useful is eliminating the unnecessary code and tests. > > And for those systems that dont have a TIOCSERGETLSR, then the code for > TIOCSERGETLSR can be eliminated. > > It would be a simple case to have, as a foundation, all the code to > simulate the missing TIOCSERGETLSR ioctl. If the system does have the > ioctl, then that code can be ifdef'd in, and co-exist with the > functionality of the code that simulates the missing TIOCSERGETLSR ioctl. > Ah, there is the post. Sorry I was on vacation. Hi George, Yes there are systems that have functioning TIOCSERGETLSR for all of their devices. These are machines that just use traditional UARTs. If you mean operating systems, then probably not. Let me explain a bit about the history of those #ifdefs to help clear up a mess. RXTX aims to follow POSIX. TIOCSERGETLSR turns out to not be POSIX at all as I understand. It isn't in BSD, Solaris, AIX or HP-UX. It certainly provides access to important information. I assumed it was standard when I coded rxtx on a Linux system. Ya, laugh. Then I looked at Win32.. Oh you are still laughing? ..I could not navigate msft's web site at the time [still can't really find anything today]. So google pointed me to someones 'reverse documentation' of the w32 API and an example msft put together back in the win3.0 days. It was enough but maybe not 100% correct. They covered overlapped IO which was important for events in rxtx. Looking at Win32 and Linux, it made sense to implement TIOCSERGETLSR for win32 with the way rxtx works. That was how things matched up. But when I got feedback about other systems, it didn't match up. When people used multiport cards with money saving designs in Linux, it didn't match up. And today, there are drivers for unusual serial ports that don't match up. Now we have some ugly logic that mostly works for most serial ports. It isn't right though. The important aspect of TIOSERGETLSR is knowing when the output is really gone. But POSIX tcdrain tells us the same thing. So there is logic in the ifdefs to match that up as you suggest. Perhaps a more formal solution along those lines would be worth looking into. I would suggest the roles should be switched though. We should use POSIX calls on all systems and hide things that don't work on everything like we have with other undocumented calls. TIOSERGETLSR is nice and would be great if it was standard. It isn't as far as I can tell. In the end, many people write Java code because they want portability. The TIOSERGETLSR does not really fit. In someways, this is limiting to the least common denominator which is Solaris if you have seen it's serial kernel driver code. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 15 09:10:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 15 Nov 2007 17:10:59 +0100 Subject: [Rxtx] RXTX blocking on unconnected virtual port Message-ID: <460801A4097E3D4CA04CC64EE648584803919080@ism-mail03.corp.ad.wrs.com> Hello, we came across the following issue: * Set up a virtual serial port, e.g. with com0com: http://com0com.sourceforge.net/ * Connect RXTX to one end, e.g. cnc1a * Do not connect the other end, e.g. cnc1b * Have RXTX write data to the port --> Since the data is not being read, RXTX blocks - RXTXPort.SerialOutputStream.write increases the RXTXPort.IOLocked variable - it then calls the native writeByte or writeArray method (which blocks) closing the RXTXPort hangs for ever too: - RXTXPort.close() has a while( IOLocked > 0 ) {..Thread.sleep(500);...} which spins for ever ==> once the communication hangs, it cannot recover. Has anybody else seen such a problem before, or even got an idea how to solve it? When I connect Hyperterminal to the same half-open port, and type a character, it hangs for about 3 seconds but then times out and is available again. I guess that's what I'd like to see in RXTX as well, with a (configurable) timeout. Our big problem with the current situation is that once RXTX gets stuck, there is nothing at all we can do to make it go live again - that's why our original workaround of writing to the port in a background thread is not good enough. For more background information, the issue is being tracked in https://bugs.eclipse.org/bugs/show_bug.cgi?id=208185 Thanks for any hints or ideas, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Sun Nov 18 09:43:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 09:43:26 -0700 (MST) Subject: [Rxtx] PortInUseException - Cannot close and reopen serial port In-Reply-To: <460801A4097E3D4CA04CC64EE64858480351C711@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858480351C711@ism-mail03.corp.ad.wrs.com> Message-ID: These have been submitted to CVS and the bugzilla entries have been changed to reflect the changes. ChangeLog: find ports which were added after program startup on Mac OS X. Martin Oberhuber http://bugzilla.qbang.org/show_bug.cgi?id=48 Clean up CommPort Ownership code, avoid possible deadlocks, fix lost commport ownership events. http://bugzilla.qbang.org/show_bug.cgi?id=83 Martin Oberhuber On Wed, 24 Oct 2007, Oberhuber, Martin wrote: > 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) > > > > > > > > > > > > > > > From tjarvi at qbang.org Sun Nov 18 09:45:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 09:45:39 -0700 (MST) Subject: [Rxtx] PortInUseException - Cannot close and reopen serial port In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848020CAF26@ism-mail03.corp.ad.wrs.com> Message-ID: The current CVS code should have all the entries. With version information, I usually do not change the version until we tag and release a zip file. Any feedback would be appreciated. On Wed, 27 Jun 2007, Greg Johnson wrote: > 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) >> >> >> >> >> > From tjarvi at qbang.org Sun Nov 18 13:51:27 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 13:51:27 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs Message-ID: The following bugs have been closed and CVS updated as needed: CommPortIdentifier.getPortIdentifier throws NoSuchPortException http://bugzilla.qbang.org/show_bug.cgi?id=48 CommPortOwnership events not sent http://bugzilla.qbang.org/show_bug.cgi?id=83 JVM 1.6 builds http://bugzilla.qbang.org/show_bug.cgi?id=84 I'd like to give Martin Oberhuber CVS write access. He has been doing a great job of pushing safe patches into rxtx. I'll be preparing seperate patches for the changes I have and submitting them to the list. I'll need to work with George to do a couple things: 1) break the patch into smaller pieces to isolate issues for discussion. 2) work through the Line Status Register changes so it does not cause problems on other systems. George: If you could do the first one, it would be greatly appreciated. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Nov 18 15:33:36 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 15:33:36 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: Message-ID: I'm not running any tests at this point, I'm trying to apply the small safe patches and make sure everything is compiling. As mentioned at the bottom, there are 3 patches + the USB fix posted here that need more review before accepting. The following bugs have been closed and CVS updated as needed. Most of these are already in CVS. The diff will be small. configure script failed at line UTS_RELEASE megov http://bugzilla.qbang.org/show_bug.cgi?id=80 code cleanup patch (extra ';' creates bug for if statements + new String() calls removed) Xavier Le Vourch http://bugzilla.qbang.org/show_bug.cgi?id=77 Wont compile on linux ppc with glibc 2.5 - no sys/io.h Brian Johnson http://bugzilla.qbang.org/show_bug.cgi?id=72 rxtx overwrites System properties Andrew Gillett Nektarios K. Papadopoulos Neboj??a http://bugzilla.qbang.org/show_bug.cgi?id=64 Solaris ACM port support Dave Cleal http://bugzilla.qbang.org/show_bug.cgi?id=59 Setting of non-standard baud rate fails. Andrew Prunicki http://bugzilla.qbang.org/show_bug.cgi?id=58 RXTX uses lockfiles on MacOS X (instead of ioctl TIOCEXCL) Joachim Buechse http://bugzilla.qbang.org/show_bug.cgi?id=50 JavaDoc fixes Joachim Buechse http://bugzilla.qbang.org/show_bug.cgi?id=49 I need to further review the following: http://bugzilla.qbang.org/show_bug.cgi?id=53 http://bugzilla.qbang.org/show_bug.cgi?id=46 http://bugzilla.qbang.org/show_bug.cgi?id=41 On Sun, 18 Nov 2007, Trent Jarvi wrote: > > The following bugs have been closed and CVS updated as needed: > > CommPortIdentifier.getPortIdentifier throws NoSuchPortException > http://bugzilla.qbang.org/show_bug.cgi?id=48 > CommPortOwnership events not sent > http://bugzilla.qbang.org/show_bug.cgi?id=83 > JVM 1.6 builds > http://bugzilla.qbang.org/show_bug.cgi?id=84 > > I'd like to give Martin Oberhuber CVS write access. He has been doing a > great job of pushing safe patches into rxtx. > > I'll be preparing seperate patches for the changes I have and submitting > them to the list. > > I'll need to work with George to do a couple things: > > 1) break the patch into smaller pieces to isolate issues for discussion. > 2) work through the Line Status Register changes so it does not cause > problems on other systems. > > George: If you could do the first one, it would be greatly appreciated. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From netbeans at gatworks.com Sun Nov 18 16:20:02 2007 From: netbeans at gatworks.com (U. George) Date: Sun, 18 Nov 2007 18:20:02 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: Message-ID: <4740C8A2.6030908@gatworks.com> > I'll need to work with George to do a couple things: > > 1) break the patch into smaller pieces to isolate issues for discussion. > 2) work through the Line Status Register changes so it does not cause > problems on other systems. > > George: If you could do the first one, it would be greatly appreciated. there are ( probably ) 3 pieces: 1) the select() failure when the USB-serial device is unceremoniously unplugged ( causes rxtx to spin ) 2) TIOCSERGETLSR, need to have the simulation of it available for all os's . If the system has the capability, don't simulate for devices that have the capability. For devices that dont have the capability, but the OS still defines TIOCSERGETLSR, fall back to simulation. 3) I rearranged DEBUG ifdef's. This is probably the bulk of the patches. From tjarvi at qbang.org Sun Nov 18 18:26:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 18:26:26 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <4740C8A2.6030908@gatworks.com> References: <4740C8A2.6030908@gatworks.com> Message-ID: On Sun, 18 Nov 2007, U. George wrote: > >> I'll need to work with George to do a couple things: >> >> 1) break the patch into smaller pieces to isolate issues for discussion. >> 2) work through the Line Status Register changes so it does not cause >> problems on other systems. >> >> George: If you could do the first one, it would be greatly appreciated. > > there are ( probably ) 3 pieces: > 1) the select() failure when the USB-serial device is unceremoniously > unplugged ( causes rxtx to spin ) > 2) TIOCSERGETLSR, need to have the simulation of it available for all os's . > If the system has the capability, don't simulate for devices that have the > capability. For devices that dont have the capability, but the OS still > defines TIOCSERGETLSR, fall back to simulation. > 3) I rearranged DEBUG ifdef's. This is probably the bulk of the patches. > Hi George, I suspect if you do cvs update, there will be very few conflicts if any. While the list of fixes is fairly long, the changes are small. -- Trent Jarvi tjarvi at qbang.org From EdwardRF at xtremax.com Mon Nov 19 03:32:29 2007 From: EdwardRF at xtremax.com (Edward) Date: Mon, 19 Nov 2007 18:32:29 +0800 Subject: [Rxtx] Cannot Read under Windows XP Message-ID: <4741663D.4070200@xtremax.com> Hi Guys, I have a iTegno 3000 usb GSM modem, it is an usb-serial device. I am trying to use RXTX with it under Windows XP. The problem is it seems RXTX cannot read any data from it, but writing to it seems successful. I blindly issue a series of command to send off a SMS, it is successfully delivered, but neither the echo from the modem nor the "OK" response was received. I tried to connect to the modem directly using hyper terminal, there was no problem reading or writing. So can i assume it is not the driver problem? Then i turned to Serial Port Monitor for help, when I use hyper terminal, monitor shows both way traffic, and nothing abnormal, but when I connect using RXTX, only the data I sent to the modem is being detected, no input was detected. Does anyone else experience similar problem? Best Regards Edward From tjarvi at qbang.org Mon Nov 19 03:38:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Nov 2007 03:38:02 -0700 (MST) Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: <4741663D.4070200@xtremax.com> References: <4741663D.4070200@xtremax.com> Message-ID: On Mon, 19 Nov 2007, Edward wrote: > Hi Guys, > > I have a iTegno 3000 usb GSM modem, it is an usb-serial device. I am > trying to use RXTX with it under Windows XP. > The problem is it seems RXTX cannot read any data from it, but writing > to it seems successful. I blindly issue a series of command to send off > a SMS, it is successfully delivered, but neither the echo from the modem > nor the "OK" response was received. > > I tried to connect to the modem directly using hyper terminal, there was > no problem reading or writing. So can i assume it is not the driver problem? > > Then i turned to Serial Port Monitor for help, when I use hyper > terminal, monitor shows both way traffic, and nothing abnormal, but when > I connect using RXTX, only the data I sent to the modem is being > detected, no input was detected. > > Does anyone else experience similar problem? > Hi Edward, A common mistake is to send Strings to the modem which are i18n. You want to send the bytes. Examples of doing this are in the contrib directory with the sourcecode. ie SimpleSnuV1.java -- Trent Jarvi tjarvi at qbang.org From EdwardRF at xtremax.com Mon Nov 19 04:42:16 2007 From: EdwardRF at xtremax.com (Edward) Date: Mon, 19 Nov 2007 19:42:16 +0800 Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: References: <4741663D.4070200@xtremax.com> Message-ID: <47417698.3060705@xtremax.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071119/b0f08ba9/attachment-0004.html From netbeans at gatworks.com Mon Nov 19 06:31:30 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 19 Nov 2007 08:31:30 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: <4740C8A2.6030908@gatworks.com> Message-ID: <47419032.8080406@gatworks.com> Did the "make install". The install does not want to go to or use Makefiles's prefix = /usr/local/rxtx-devel Not terribly happy that it installed in /home/gat/JAVA/JDK14/j2sdk1.4.2_08/jre/lib/i386 Trent Jarvi wrote: > > I suspect if you do cvs update, there will be very few conflicts if any. > While the list of fixes is fairly long, the changes are small. > > -- > Trent Jarvi > tjarvi at qbang.org > > From Martin.Oberhuber at windriver.com Mon Nov 19 07:00:48 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 19 Nov 2007 15:00:48 +0100 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE6485848039986E6@ism-mail03.corp.ad.wrs.com> It's great to see things progressing - thanks Trent! I checked CVS, and it seems that most of the patch authors are yet missing from the AUTHORS file, is this intentional? The issues areound RXTXPort.close() are interesting for us in the context of Eclipse as well: https://bugs.eclipse.org/bugs/show_bug.cgi?id=208185#c3 I did a quick review and found some issues / comments: http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 http://bugzilla.qbang.org/show_bug.cgi?id=53#c9 Thanks for proposing CVS write access for me. I promise to use these thoughtfully, and discuss potential fixes openly (on bugzilla) before applying them [unless it's really trivial issues only like obvious Javadoc syntax or spelling errors]. Cheers, -- 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 Mon Nov 19 07:24:16 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 19 Nov 2007 15:24:16 +0100 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803998711@ism-mail03.corp.ad.wrs.com> Hi all, I think I've got a better version for RXTXCommDriver.checkSolaris(): http://bugzilla.qbang.org/show_bug.cgi?id=77#c3 Cheers, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From netbeans at gatworks.com Mon Nov 19 09:01:22 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 19 Nov 2007 11:01:22 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <47419032.8080406@gatworks.com> References: <4740C8A2.6030908@gatworks.com> <47419032.8080406@gatworks.com> Message-ID: <4741B352.8070205@gatworks.com> U. George wrote: > Did the "make install". The install does not want to go to or use > Makefiles's prefix = /usr/local/rxtx-devel > > Not terribly happy that it installed in > /home/gat/JAVA/JDK14/j2sdk1.4.2_08/jre/lib/i386 > Put libs and jar in MY preferential places. Ran application. And it loves to spin. Deja gnu all over again. :-/ It did find the avail /dev/ttyUSB0 port connected to LINUX usbserial/pl2303 device driver. Now to find the spin. and apply simpler set of patches From tjarvi at qbang.org Mon Nov 19 10:14:38 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Nov 2007 10:14:38 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <4741B352.8070205@gatworks.com> References: <4740C8A2.6030908@gatworks.com> <47419032.8080406@gatworks.com> <4741B352.8070205@gatworks.com> Message-ID: On Mon, 19 Nov 2007, U. George wrote: > U. George wrote: >> Did the "make install". The install does not want to go to or use >> Makefiles's prefix = /usr/local/rxtx-devel >> >> Not terribly happy that it installed in >> /home/gat/JAVA/JDK14/j2sdk1.4.2_08/jre/lib/i386 >> > Put libs and jar in MY preferential places. Ran application. And it loves to > spin. Deja gnu all over again. :-/ > > It did find the avail /dev/ttyUSB0 port connected to LINUX usbserial/pl2303 > device driver. > > Now to find the spin. and apply simpler set of patches > Hi George, When the prefix code was stomped on and the library was installed in the jre, It wasnt clear how the layout would end up looking. I'm still not sure. My usual attack was to dump a jdk onto the filesystem, set JAVA_HOME and install. When I was done, I would nuke the jdk. Obviously that may not be what people want but I'm not sure a prefix is enough to let us know what they do want. For a shared library prefix /usr/local means the library goes in /usr/local/lib. What would it mean for the jar and shared library in Java? -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Nov 19 10:24:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Nov 2007 10:24:08 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <460801A4097E3D4CA04CC64EE6485848039986E6@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848039986E6@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 19 Nov 2007, Oberhuber, Martin wrote: > > I checked CVS, and it seems that most of the patch > authors are yet missing from the AUTHORS file, > is this intentional? > There isn't a hard rule covering who goes into AUTHORS. If I recognize a person from previous patches, I try to make sure they are in. Everyone contributing (authors) is in the ChangeLog with what they did going all the way back to the first release. AUTHORS is more of a summary of what they did after a few submissions. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Nov 19 11:39:51 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 19 Nov 2007 13:39:51 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: <4740C8A2.6030908@gatworks.com> <47419032.8080406@gatworks.com> <4741B352.8070205@gatworks.com> Message-ID: <4741D877.80203@gatworks.com> For me, the makefile/prefix = /usr/local sorta suggest thats where the libs/bins/jars/... should eventually wind up. If a user does not like /usr/local, then a quick change would put it somewhere else. At this moment I dont care where the jar winds up ( in lib, or a jar directory ). So I like to keep the jre/sdk directory protected from meddling, and changes. But if a user has a penchant to use 'java -jar', then the RXTXcomm.jar file should be stuffed with the other jre/sdk jar files. From ajmas at sympatico.ca Mon Nov 19 11:54:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 19 Nov 2007 13:54:29 -0500 Subject: [Rxtx] CVS updates and closed bugs Message-ID: <20071119185429.SPYK18413.tomts22-srv.bellnexxia.net@smtp1.sympatico.ca> On this day in November "U. George" wrote: > > For me, the makefile/prefix = /usr/local sorta suggest thats where the > libs/bins/jars/... should eventually wind up. > If a user does not like /usr/local, then a quick change would put it > somewhere else. At this moment I dont care where the jar winds up ( in > lib, or a jar directory ). > So I like to keep the jre/sdk directory protected from meddling, and > changes. > But if a user has a penchant to use 'java -jar', then the RXTXcomm.jar > file should be stuffed with the other jre/sdk jar files. It should be noted that some platforms, such as MacOS X might have different conventions. In the case of MacOS X there are two 'correct' places for Java libraries that aren't part of an application: - /Library/Java/Extensions/ - ~/Library/Java/Extensions/ Andre From ajmas at sympatico.ca Mon Nov 19 18:15:37 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 19 Nov 2007 20:15:37 -0500 Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: <47417698.3060705@xtremax.com> References: <4741663D.4070200@xtremax.com> <47417698.3060705@xtremax.com> Message-ID: <3D24B671-06CA-4709-AE3C-BCDB542F427F@sympatico.ca> On 19-Nov-07, at 06:42 , Edward wrote: > Hi Trent, > > First of all, I did sent them as bytes, eg, > > output.write("at\r\n".getBytes()); > > And if writing is every the problem, it wouldn't be able to explain > why i could send out a sms successfully using RXTX. > If you have the section of code that does the communicating, could you share it with us? This should help us tell whether it is a coding issue or something more fundamental with RXTX. Andre From EdwardRF at xtremax.com Mon Nov 19 19:39:36 2007 From: EdwardRF at xtremax.com (EdwardRF) Date: Tue, 20 Nov 2007 10:39:36 +0800 Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: <3D24B671-06CA-4709-AE3C-BCDB542F427F@sympatico.ca> References: <4741663D.4070200@xtremax.com> <47417698.3060705@xtremax.com> <3D24B671-06CA-4709-AE3C-BCDB542F427F@sympatico.ca> Message-ID: <474248E8.7070002@xtremax.com> Hi Guys, Thanks for the help, i've finally found out the problem. It was a flow control issue, i did not set the flow control properly. Btw, what is the default flow control behavior for rxtx2.1.7? was it the same as 2.0? Because i remember i did not need to set the flow control when I use rxtx 2.0 2 years back. Best Regards Edward Andre-John Mas wrote: > > On 19-Nov-07, at 06:42 , Edward wrote: > >> Hi Trent, >> >> First of all, I did sent them as bytes, eg, >> >> output.write("at\r\n".getBytes()); >> >> And if writing is every the problem, it wouldn't be able to explain >> why i could send out a sms successfully using RXTX. >> > > If you have the section of code that does the communicating, could you > share it with us? This should help us tell whether it is a coding > issue or something more fundamental with RXTX. > > Andre > From netbeans at gatworks.com Tue Nov 20 06:23:26 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 20 Nov 2007 08:23:26 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: <4740C8A2.6030908@gatworks.com> Message-ID: <4742DFCE.5070504@gatworks.com> Here is the small subset of diffs just for TIOCSERGETLSR :) Next I'll pull out the usb device, and see if that also causes rxtx to spin. >> 2) TIOCSERGETLSR, need to have the simulation of it available for all >> os's . If the system has the capability, don't simulate for devices >> that have the capability. For devices that dont have the capability, >> but the OS still defines TIOCSERGETLSR, fall back to simulation. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: a Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20071120/2c5c8ee7/attachment.pl From tjarvi at qbang.org Tue Nov 20 08:20:21 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Nov 2007 08:20:21 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <4742DFCE.5070504@gatworks.com> References: <4740C8A2.6030908@gatworks.com> <4742DFCE.5070504@gatworks.com> Message-ID: On Tue, 20 Nov 2007, U. George wrote: > Here is the small subset of diffs just for TIOCSERGETLSR :) > > Next I'll pull out the usb device, and see if that also causes rxtx to spin. > >>> 2) TIOCSERGETLSR, need to have the simulation of it available for all os's >>> . If the system has the capability, don't simulate for devices that have >>> the capability. For devices that dont have the capability, but the OS >>> still defines TIOCSERGETLSR, fall back to simulation. > Hi George, I'll be looking through this patch in detail tonight. I just wanted to make sure you are aware of this line in win32termios.h. The ifdef logic is messy as you noticed. That is combined with the later addition of support for it to windows. #define TIOCSERGETLSR 0x5459 (this is by far the strangest code in rxtx in retrospect) I'll be able to do extensive automated testing once we get to that point. I'm confident we can get something in that has a low probability of causing regressions. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Tue Nov 20 08:42:08 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 20 Nov 2007 10:42:08 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: <4740C8A2.6030908@gatworks.com> <4742DFCE.5070504@gatworks.com> Message-ID: <47430050.1010203@gatworks.com> It is of no difference. 1) If the define does not exist, then it should be as before. 2) If it does exist, then it should also be as before. 3) If it does exist, but the ioctl fails, then it will fallback as if it did not exist in the first place. Trent Jarvi wrote: > On Tue, 20 Nov 2007, U. George wrote: > >> Here is the small subset of diffs just for TIOCSERGETLSR :) >> >> Next I'll pull out the usb device, and see if that also causes rxtx to >> spin. >> >>>> 2) TIOCSERGETLSR, need to have the simulation of it available for >>>> all os's . If the system has the capability, don't simulate for >>>> devices that have the capability. For devices that dont have the >>>> capability, but the OS still defines TIOCSERGETLSR, fall back to >>>> simulation. >> > > Hi George, > > I'll be looking through this patch in detail tonight. I just wanted to > make sure you are aware of this line in win32termios.h. The ifdef logic > is messy as you noticed. That is combined with the later addition of > support for it to windows. > > #define TIOCSERGETLSR 0x5459 > > (this is by far the strangest code in rxtx in retrospect) > > I'll be able to do extensive automated testing once we get to that > point. I'm confident we can get something in that has a low probability > of causing regressions. > > -- > Trent Jarvi > tjarvi at qbang.org > > From netbeans at gatworks.com Tue Nov 20 08:36:56 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 20 Nov 2007 10:36:56 -0500 Subject: [Rxtx] Unplugged Opened USB devices In-Reply-To: <4742DFCE.5070504@gatworks.com> References: <4740C8A2.6030908@gatworks.com> <4742DFCE.5070504@gatworks.com> Message-ID: <4742FF18.3050005@gatworks.com> > Next I'll pull out the usb device, and see if that also causes rxtx to > spin. This is the error on a read. The select() should have failed, as well as the read(). java.io.IOException: Input/output error in nativeavailable at gnu.io.RXTXPort.nativeavailable(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1420) at jGPS.GpsData.DeviceDrivers.SerialPort.SerialPort_NMEA_GNU.serialEvent (SerialPort_NMEA_GNU.java:449) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:771) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1622) But for java program, it sees( when USB device is unplugged ) : 1) event: SerialPortEvent.DATA_AVAILABLE 2) read (non-existant) data. I think that its bad form to say DATA_AVAILABLE, when there is no data to be obtained. There does not seem to be an I/O error event. So basically, I think, and IMHO, that no events should be sent. Rather a thread timeout ( ie no data in X seconds ) AND recovery from user code should be instantiated. From keithvz at verizon.net Thu Nov 1 08:08:58 2007 From: keithvz at verizon.net (Keith) Date: Thu, 01 Nov 2007 10:08:58 -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: <4729DDFA.7080206@verizon.net> Trent Jarvi wrote: > 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? Well, I honestly don't know how all this fits together. I think it's just a matter of enabling the right flow control option within the standard serial framework to tell the device driver, "HEY START USING DTR/DSR FOR FLOW CONTROL." If what UGeorge said,(about that type of nitty-gritty lead control being done within the device driver), is true, then this confirms my suspicion. I tried narrowing down within the Linux drivers what you are looking for, but I can't entirely tell wth I'm looking at. (virtual com port drivers -- they are included compiled by default with Ubuntu, source included) http://www.ftdichip.com/Drivers/VCP/Linux/ftdi_sio.tar.gz Hahahaa, they make a reference to DTR flow control being supported but say (UGH) in parenthesis. You can also use their direct device driver library on Ubuntu -- libftd2xx.so.0.4.13. No source code. http://www.ftdichip.com/Drivers/D2XX/Linux/libftd2xx0.4.13.tar.gz In that case, you make a call to their FT_SetFlowControl() function. FT_STATUS FT_SetFlowControl (FT_HANDLE ftHandle, USHORT usFlowControl, UCHAR uXon,UCHAR uXoff) Parameters ftHandle Handle of the device. usFlowControl Must be one of FT_FLOW_NONE, FT_FLOW_RTS_CTS, ****FT_FLOW_DTR_DSR**** or FT_FLOW_XON_XOFF. uXon Character used to signal Xon. Only used if flow control is FT_FLOW_XON_XOFF. uXoff Character used to signal Xoff. Only used if flow control is FT_FLOW_XON_XOFF. This is from their programming guide http://www.ftdichip.com/Documents/ProgramGuides/D2XXPG34.pdf I actually want to take this a step further and say that I think the flow control is actually handled right on the device itself in hardware/firmware. It's enabled through the device driver, but I think the maintaining of buffers, asserting/deasserting of leads, etc is handled by the device. For the time being, I've switched to jd2xx, https://jd2xx.dev.java.net/ and http://bleyer.org/jd2xx/ These are Java wrappers for the device driver libraries. It allows almost direct access to the well-documented device drivers from Java. I hope this helps Keith From tjarvi at qbang.org Thu Nov 1 11:09:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:09:51 -0600 (MDT) 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: Hi Martin, What I usually have done is allow changes that do not impact working software including changes to methods not documented in CommAPI (which remain undocumented in rxtx) and fixes to known problems in the documented portions. That way if you use the documented API, the releases should only become better with time. If you use the undocumented portions, the behavior is not as predictable but open for improvement. On Wed, 31 Oct 2007, 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 >> > From tjarvi at qbang.org Thu Nov 1 11:15:52 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:15:52 -0600 (MDT) 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: I too use rxtx in commercial products. The problem I've been trying to address while bringing the server back was how to make it possible for hobby folks to build the same software as companies so we can move rxtx along a little faster. Exposing internal tools is not an option at this time, the public rxtx builds have been done on my home machine which has drives hanging out of it all over the place dying one at a time. This isn't maintainable. I'm currently looking at the possibility of making an S3 image available on Amazon's EC. These are machines you can rent for ~10 cents an hour which is more than enough to build rxtx. The S3 image is not changed when people use it so everyone has the same starting point. With this, we could all build rxtx for ~20 platforms for a small price and eliminate tool issues. On Wed, 31 Oct 2007, Greg Johnson wrote: > 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 tjarvi at qbang.org Thu Nov 1 11:19:55 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:19:55 -0600 (MDT) 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: On Wed, 31 Oct 2007, 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. I was helping Dmitry do the Mac OS X port without access to a machine when we put that in. In the archives there is information (easily found with google on Apple's site) that describes how their API (and others) can determine if a port is used and ignore it. I think these changes are in CVS but need to confirm. The bottom line is that rxtx should not have used lock files on Mac. It was just ignorance of the system on my part. -- Trent Jarvi tjarvi at qbang.org From fabioanjos at gmail.com Thu Nov 1 12:35:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Thu, 1 Nov 2007 15:35:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Hi, I was using SerialEventListener in my project. But, as was said here, id doesnt work very well with virtual serial ports. So, I changed the strategy using the code posted here in this thread: try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > 0) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } The thing is that in my tests I could notice that in.read(buffer) never blocks. Even when there's nothing to read. Instead of blocking when there's nothing to read it returns 0. So, my questions are: 1. Am I doing something wrong? 2. If not, wouldnt this decrease performance? (the thread would be locked in a loop that does nothing.) 3. Is there a better way to do the job? Thanks in advance!! F?bio -------- On 10/31/07, Andre-John Mas wrote: > > > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/0aee59d0/attachment-0022.html From ajmas at sympatico.ca Thu Nov 1 16:07:55 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Nov 2007 18:07:55 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Message-ID: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From sarah_662005 at yahoo.com Thu Nov 1 17:10:05 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Thu, 1 Nov 2007 16:10:05 -0700 (PDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Message-ID: <351433.37166.qm@web55814.mail.re3.yahoo.com> Thank you very much for your help. Now the application works fine. the serialEvent gets triggered. Rxtx is cool! ----- Original Message ---- From: Andre-John Mas To: Sara Hugh ; RXTX Developers and Users Sent: Wednesday, October 31, 2007 9:55:45 AM Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered 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 __________________________________________________ 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/20071101/4a86bea6/attachment-0022.html From tjarvi at qbang.org Thu Nov 1 17:58:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 17:58:02 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx Message-ID: The rxtx.org site is primarily interested in the hobby aspects of rxtx. Obviously, there are some companies following the work too. These interests bring larger workflows and concerns about details hobby folks may not care about. They also bring many more users. I know the company I work for has a quality engineering effort going on which includes rxtx. While the server was down, I was contacted by another company that was missing the binaries for their testing. Several people have mentioned concerns about a stable release for like reasons. Would there be interest on the quality side of the coin to get together? It could be just sharing email's with each other or a seperate list for QE/QA. I can not say for sure, but we may be able to share some of our efforts/results that could help keep rxtx releases stable. -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Fri Nov 2 01:42:55 2007 From: scldad at sdc.com.au (Stephen Davies) Date: Fri, 2 Nov 2007 18:12:55 +1030 Subject: [Rxtx] Multiple modems Message-ID: <200711021812.56047.scldad@sdc.com.au> This may or may not be related to the Multiple Ports thread. I have an application which uses rxtx on Linux (via cron jobs) to connect multiple modems to remote sensing devices. The application works fine most of the time but occasionally fails to connect if two (or more) connection attempts happen at about the same time. When it fails, it looks as if it may get confused as to which port it is talking to. The app has a "base" component that looks for an available port, opens it and then creates an input thread and an output thread for the connection and data transfer. The "base" component uses this code: // loop round all known ports until one is available. Give up after three minutes Counter ptimeout = new Counter(); while(!portFound && ptimeout.elapsed() < 180000) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // special case. ttyS0 is not available to us on this server. if (!portId.isCurrentlyOwned() && !portId.getName().equals("/dev/ttyS0")) { gLog.debug(lognm + ": Found port " + portId.getName()); try { serialPort = (RXTXPort) portId.open("AguaModem", 10000); } catch (Exception e) { gLog.error(lognm + ": Port " + portId.getName() + " will not open."); gLog.error(e.getMessage()); continue; } AguaModem aguamodem = new AguaModem(); portFound = true; break; } gLog.debug(lognm + ": Port " + portId.getName() + " is busy"); } } } I am wondering about the isCurrentlyOwned method. Does this actually tell me whether a port is currently being used by another process? TIA, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From fabioanjos at gmail.com Fri Nov 2 04:59:58 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 07:59:58 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Message-ID: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/9009eb1d/attachment-0022.html From netbeans at gatworks.com Fri Nov 2 06:28:13 2007 From: netbeans at gatworks.com (U. George) Date: Fri, 02 Nov 2007 08:28:13 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <472B17DD.1050508@gatworks.com> It should normally block ( unless eof / event ) . so its a :{ whats the device ( to recreate if possible ) and how do u open. > My question is, is there a way to make in.read block the thead until > there's something to read? > From fabioanjos at gmail.com Fri Nov 2 06:34:46 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 09:34:46 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > On 11/1/07, Andre-John Mas wrote: > > > > Fabio, > > > > Turns out there was a small error in my example. The test should be: > > > > (numBytes = in.read(buffer)) > -1 > > > > This is because -1 indicates an end of file (end of data stream) > > > > Andre > > > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > > > Hi, > > > > > > I was using SerialEventListener in my project. But, as was said > > > here, id doesnt work very well with virtual serial ports. > > > So, I changed the strategy using the code posted here in this thread: > > > > > > try{ > > > in = port.getInputStream(); > > > out = port.getOutputStream(); > > > int numBytes = 0; > > > while(active){ > > > > > > byte[] buffer = new byte[10]; > > > > > > while ( (numBytes = in.read(buffer)) > 0) > > > { > > > String dataValue = new String(buffer,0,numBytes); > > > processInput(dataValue); > > > } > > > > > > if(numBytes==-1){ > > > break; > > > } > > > > > > Thread.sleep(50); > > > } > > > > > > }catch(IOException e){ > > > logger.info("falha de comunicacao "+ > > > getReceptor().getPort() ); > > > > > > }catch(InterruptedException e){ > > > logger.info ("Interrompendo leitura da porta "+ > > > getReceptor().getPort() ); > > > } > > > > > > The thing is that in my tests I could notice that in.read(buffer) > > > never blocks. Even when there's nothing to read. Instead of blocking > > > when there's nothing to read it returns 0. > > > > > > So, my questions are: > > > > > > 1. Am I doing something wrong? > > > 2. If not, wouldnt this decrease performance? (the thread would be > > > locked in a loop that does nothing.) > > > 3. Is there a better way to do the job? > > > > > > Thanks in advance!! > > > > > > F?bio > > > -------- > > > > > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > > 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 > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > > > > > -- > > > Atenciosamente, > > > F?bio Cristiano dos Anjos > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/5306c4b1/attachment-0022.html From nick.circelli at infrasafe.com Fri Nov 2 07:01:17 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Fri, 2 Nov 2007 08:01:17 -0500 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com><29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com><90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca><29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Message-ID: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> I'm pretty sure that not blocking has to do with you virtual ports. Cause it should block. Maybe you should try: while ((numBytes = in.available()) > 0) { If (numBytes > buffer.length) { numBytes = buffer.length; // in case you have buffer overflow } numBytes = in.read(buffer, 0 , numBytes)); String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } Also, just for optimization, I'd move that byte[] buffer = new byte[10]; out of the while since you don't need to reallocate it every iteration. ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of F?bio Cristiano dos Anjos Sent: Friday, November 02, 2007 8:35 AM To: RXTX Developers and Users Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream (); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas < ajmas at sympatico.ca > wrote: Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info ("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Atenciosamente, F?bio Cristiano dos Anjos -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/4de7f6a3/attachment-0022.html From fabioanjos at gmail.com Fri Nov 2 07:36:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 10:36:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> Message-ID: <29788b250711020636q1588c88fgaa5e27f5504164fb@mail.gmail.com> Hi Nick, Actually, it doesnt block for physical ports too. And, the method avaiable does not block either, so when there's nothing avaiable the loop ends and the thread stops lintening to the port. But I did some more test with serialEventListener, and now its working. I realy dont know what I've done to get it working. I just start woking as soon as I decided to test it again. It was said here that serialEventListener is not reliable for virtual serial ports. Is there another way to read it, without compromising performance? Tanks again!! F?bio ------- On 11/2/07, Nick Circelli wrote: > > I'm pretty sure that not blocking has to do with you virtual ports. > Cause it should block. > > Maybe you should try: > > > > while ((numBytes = in.available()) > 0) > > { > > If (numBytes > buffer.length) { > > numBytes = buffer.length; // in case you have buffer overflow > > } > > numBytes = in.read(buffer, 0 , numBytes)); > > String dataValue = new String(buffer,0,numBytes,"ASCII"); > > processInput(dataValue); > > } > > > > Also, just for optimization, I'd move that byte[] buffer = new > byte[10]; > > out of the while since you don't need to reallocate it every iteration. > > > ------------------------------ > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On Behalf > Of *F?bio Cristiano dos Anjos > *Sent:* Friday, November 02, 2007 8:35 AM > *To:* RXTX Developers and Users > *Subject:* Re: [Rxtx] serialEvent(SerialPortEvent event) never be > triggered > > > > Hi, > > I think i missunderstand something here. > The code you post here was meant to be used inside serialEvent method, > right? > > The think is, that i cannot user SerialEventListener to read serial ports, > because i need to read virual serial ports and id does not behaves well, as > said here before. serialEvent is never triggered. > > So what I quit using SerialEventListener and created a thread to listen to > the port: > > public void run(){ > try{ > in = port.getInputStream(); > out = port.getOutputStream (); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new > String(buffer,0,numBytes,"ASCII"); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ getReceptor().getPort() > ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > } > > > So, the problem is that in.read(buffer) always returns 0 when there is > nothing to read, instead of blocking the flow, and the thread becames locked > in the loop. > > I hope you can help me solve this. > > Thanks in advance! > > F?bio > -------- > > On 11/2/07, *F?bio Cristiano dos Anjos* wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > > > On 11/1/07, *Andre-John Mas* < ajmas at sympatico.ca> wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info ("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/571df6ea/attachment-0021.html From tjarvi at qbang.org Fri Nov 2 08:32:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Nov 2007 08:32:15 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: References: Message-ID: On Fri, 2 Nov 2007, Greg Johnson wrote: > Hi Trent, folks, > Having a single rxtx that is suitable for commercial uses and hobbyists both > would be a great idea? Perhaps it would be worth submitting rxtx as a > proposal to Codehaus - they not only provide excellent tools (Jira (bug > tracker), Confluence (wiki)) but also support build management ( > maestro, continuum, bamboo). Relying on your personal machine (btw, frii.com > / rxtx.org is down again?) seems like a burden you shouldn't have to shoulder > alone. Hi Greg, There may be a little confusion here. There is no need to have two seperate rxtx releases. What I'm trying to encourage is a discussion between some of the people responsible for making sure rxtx does not break their products each release. Usually these people are interested in testing a set of functionality their product depends upon. They do not work with rxtx code but rather traps to catch when rxtx developers break something. This goes on all the time in isolated labs. There are many services that offer to do various pieces of a project for you if you... Anyone is free to do the 'if you' portion with rxtx and see how it goes. I'm actually interested in doing less of that than more. The rxtx.org work I do just happens to overlap with other things I do for personal/family use. The reason I suggest the amazon solution is that anyone can take full control of the environment for a day and it costs less than a package of gum without causing harm to what anyone else is doing. I assume the down question was with respect to a mod_security setting that has been resolved. If not, please post a url to the problem. -- Trent Jarvi tjarvi at qbang.org From nsayer at kfu.com Sat Nov 3 20:17:49 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 19:17:49 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? Message-ID: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Has anyone got RXTX working with an app under Leopard? My app hangs on port open (it works fine with Tiger). The relevant thread looks like this in the activity monitor: 1536 JVM_InvokeMethod 1536 0x48ccd0 1536 0x46f8a0 1536 0x4c3ff4 1536 0x4c4284 1536 0x357d160 1536 0x357faac 1536 Java_gnu_io_RXTXPort_open 1536 open $NOCANCEL$UNIX2003 1536 open $NOCANCEL$UNIX2003 From ajmas at sympatico.ca Sat Nov 3 22:02:04 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 00:02:04 -0400 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> RXTX works for me with Leopard. I am currently using it communicate with a Bluetooth GPS. What computer and device are you trying to use? Is the driver for your serial device compatible with MacOS X 10.5? Andre On 3-Nov-07, at 22:17 , Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From nsayer at kfu.com Sat Nov 3 22:17:47 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 21:17:47 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> Message-ID: <1720F723-3643-438C-B3AB-E09A67536977@kfu.com> On Nov 3, 2007, at 9:02 PM, Andre-John Mas wrote: > RXTX works for me with Leopard. I am currently using it communicate > with a Bluetooth GPS. > > What computer and device are you trying to use? Is the driver for > your serial device compatible with MacOS X 10.5? An Intel mac mini The FTDI USB serial driver an XMPCR, which is just a fancy serial controlled radio and an FTDI usb-to-serial chip I've successfully used the FTDI driver with another FTDI device in another context. > > > Andre > > On 3-Nov-07, at 22:17 , Nick Sayer wrote: > >> Has anyone got RXTX working with an app under Leopard? >> >> My app hangs on port open (it works fine with Tiger). The relevant >> thread looks like this in the activity monitor: >> >> 1536 JVM_InvokeMethod >> 1536 0x48ccd0 >> 1536 0x46f8a0 >> 1536 0x4c3ff4 >> 1536 0x4c4284 >> 1536 0x357d160 >> 1536 0x357faac >> 1536 >> Java_gnu_io_RXTXPort_open >> 1536 open >> $NOCANCEL$UNIX2003 >> 1536 open >> $NOCANCEL$UNIX2003 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From racecar at gmail.com Sat Nov 3 22:25:53 2007 From: racecar at gmail.com (Kevin Mateo Lim) Date: Sat, 3 Nov 2007 21:25:53 -0700 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: Message-ID: I am alternating between two errors. After i run the macosx_setup.command, "everyone" is set to Read only in /var/lock. I notice in the terminal that the group for these perms is _uucp, not uucp. In that state, I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 check_group_uucp(): error testing lock file creation Error details:Permission deniedcheck_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException : Error inside Serial.() at processing.serial.Serial.errorMessage(Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.( Serial.java:102) at Temporary_829_3245.setup(Temporary_829_3245.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java :690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) Then, I hand edit the "everyone" permissions for /var/lock/ to Read and Write (note /var/spool/uucp is Read/Write in all cases, and doesn't change). I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX uucp_lock() /var/lock/LK.003.009.000 is there gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException: Error inside Serial.() at processing.serial.Serial.errorMessage (Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.(Serial.java:102) at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java:690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) See here: http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071103/f1a2c467/attachment-0020.html From greg.johnson at manchester.ac.uk Sun Nov 4 02:31:13 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sun, 4 Nov 2007 10:31:13 +0100 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <28B5E0A0-0802-4C74-AC21-87ED35F3B9A2@manchester.ac.uk> Hi Nick, I also had problems initially with Leopard, but it was resolved by reinstalling the serial USB driver (FTDI in my case). The symptoms were a non-detection of any ports (but I twigged when I tried ZTerm and it had the same problem). Good luck! Cheers, greg PS I did a "Archive and install" which may be the reason my FTDI driver had disappeared - I don't think the driver has changed for 10.5 ------------------------------------------------------------------------- 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 4 Nov 2007, at 03:17, Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Sun Nov 4 13:01:12 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 15:01:12 -0500 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: Message-ID: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Hi, You will need to get the 2.1-8 code from CVS. See the FAQ for more information: http://rxtx.qbang.org/wiki/index.php/FAQ Andre On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > I am alternating between two errors. > > After i run the macosx_setup.command, "everyone" is set to Read only > in /var/lock. I notice in the terminal that the group for these > perms is _uucp, not uucp. > > In that state, I get this error: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > check_group_uucp(): error testing lock file creation Error > details:Permission deniedcheck_lock_status: No permission to create > lock file. > please see: How can I use Lock Files with rxtx? in INSTALL > gnu.io.PortInUseException: Unknown Application > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > java.lang.RuntimeException : Error inside Serial.() > > at processing.serial.Serial.errorMessage(Serial.java:583) > > at processing.serial.Serial.(Serial.java:148) > > at processing.serial.Serial.( Serial.java:102) > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > at processing.core.PApplet.run(PApplet.java:1556) > > at java.lang.Thread.run(Thread.java:613) > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > and Write (note /var/spool/uucp is Read/Write in all cases, and > doesn't change). I get this error: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > gnu.io.PortInUseException: Unknown Application > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > java.lang.RuntimeException: Error inside Serial.() > > at processing.serial.Serial.errorMessage (Serial.java:583) > > at processing.serial.Serial.(Serial.java:148) > > at processing.serial.Serial.(Serial.java:102) > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > at processing.core.PApplet.run(PApplet.java:1556) > > at java.lang.Thread.run(Thread.java:613) > > See here: > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From netbeans at gatworks.com Sun Nov 4 14:33:35 2007 From: netbeans at gatworks.com (U. George) Date: Sun, 04 Nov 2007 16:33:35 -0500 Subject: [Rxtx] #ifndef TIOCSERGETLSR Message-ID: <472E3AAF.7050709@gatworks.com> For Linux, it seems that you need the code for both *having* a TIOCSERGETLSR, and *not having* a TIOCSERGETLSR. Maybe the ioctl exists system wide, but not necessarily for the device driver itself ( always returns -1 ) . Are there systems that have a *functioning* TIOCSERGETLSR for all their devices? Then this would be the case where the "#ifndef TIOCSERGETLSR" directive could be useful is eliminating the unnecessary code and tests. And for those systems that dont have a TIOCSERGETLSR, then the code for TIOCSERGETLSR can be eliminated. It would be a simple case to have, as a foundation, all the code to simulate the missing TIOCSERGETLSR ioctl. If the system does have the ioctl, then that code can be ifdef'd in, and co-exist with the functionality of the code that simulates the missing TIOCSERGETLSR ioctl. From racecar at gmail.com Sun Nov 4 17:30:19 2007 From: racecar at gmail.com (Kevin Mateo Lim) Date: Sun, 4 Nov 2007 17:30:19 -0700 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: the README.OSX reads: Put libSerial.jnilib in the directory of the application (the JavaVM will find it there). Add RXTXComm.jar to the application classpath or include the classes in the application jar. (Some applications already include the RXTX classes in their application jar, in which case only the file libSerial.jnilib is required). I can't find libSerial.jnilib I put librxtxSerial.jnilib into my Processing /libraries/serial/library/ directory. Yet it still sees the old version: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 On 11/4/07, Andre-John Mas wrote: > > Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > 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/20071104/c0a83f91/attachment-0019.html From ajmas at sympatico.ca Sun Nov 4 17:41:47 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 19:41:47 -0500 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> If you are wanting it to be available for all applications, - for all users: /Library/Java/Extensions - for your user: ~/Library/Java/Extensions Or just for your application, then it should be in the same directory from which yo are launching your application. If you are getting the 2.1-8 source, then the library built is called: librxtxSerial.jnilib despite what the docs say. Andre On 4-Nov-07, at 19:30 , Kevin Mateo Lim wrote: > > the README.OSX reads: > Put > libSerial.jnilib > in the directory of the application (the JavaVM will find it there). > Add > RXTXComm.jar > to the application classpath or include the classes in the > application jar. > (Some applications already include the RXTX classes in their > application jar, > in which case only the file libSerial.jnilib is required). > > > I can't find libSerial.jnilib > I put librxtxSerial.jnilib into my Processing /libraries/serial/ > library/ directory. > > Yet it still sees the old version: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > On 11/4/07, Andre-John Mas wrote: Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial .(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay (PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > From bschlining at gmail.com Sun Nov 4 19:46:23 2007 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 4 Nov 2007 18:46:23 -0800 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> Message-ID: > > Or just for your application, then it should be in the same directory > from which yo are launching your application. Just wanted to add one more way of specifying the native lib location... If you don't want to define it globally by putting it in /Library/Java/Extensions (and you don't, it's a very very bad practice) you can also specify the location of the native library when starting the JVM by specifying the 'java.library.path' property. For example: java -Djava.library.path=/Path/To/Directory/With/RXTX/Library YourMainClass -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071104/c5af6980/attachment-0019.html From greg.johnson at manchester.ac.uk Mon Nov 5 01:39:02 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Mon, 5 Nov 2007 09:39:02 +0100 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: The 2.1-8 code reports 2.1-7, hence your (and my) confusion. But as long as you've removed all traces of the old library, it really _is_ 2.1-8. And if you specify the library path to the VM, don't make my mistake (on OSX at least) - you need to respecify the entire library path it had by default, as the command line argument replaces the path, rather than appending to it. 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 5 Nov 2007, at 01:30, Kevin Mateo Lim wrote: > > the README.OSX reads: > Put > libSerial.jnilib > in the directory of the application (the JavaVM will find it there). > Add > RXTXComm.jar > to the application classpath or include the classes in the > application jar. > (Some applications already include the RXTX classes in their > application jar, > in which case only the file libSerial.jnilib is required). > > > I can't find libSerial.jnilib > I put librxtxSerial.jnilib into my Processing /libraries/serial/ > library/ directory. > > Yet it still sees the old version: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > On 11/4/07, Andre-John Mas wrote: > Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial .(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay (PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > 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 HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071105/7f50506d/attachment-0019.html From cyrille.dumont at tatexpress.fr Mon Nov 5 05:46:03 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 05 Nov 2007 13:46:03 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: References: <472727F1.1000704@tatexpress.fr> Message-ID: <472F108B.2090101@tatexpress.fr> Thanks a lot for your solution ... but I'm not a expert in JAVA ... (sorry) For the moment I've this function : """ public void serialEvent(SerialPortEvent e) { StringBuffer inputBuffer = new StringBuffer(); int newData = 0; switch (e.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } //-- Manag. Data from Scanner this.MngDataScanner(inputBuffer.toString()); break; case SerialPortEvent.BI:; //-- Break Received } } """ How can I do what you write ? ( maybe a simple ex ? ) PS : I don't know the PDF417 size (could be, for example, 338 char, or 500 ... ; what I know is that it can't be more than 800 char) Thanks in advance. Best regards. Trent Jarvi a ?crit : > 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 Martin.Oberhuber at windriver.com Mon Nov 5 08:47:50 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 5 Nov 2007 16:47:50 +0100 Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> Hi Trent, are the interestes of hobbyists really so different from commercial ones? Both should be interested in high quality and innovation the like. I haven't seen too many Open Source projects from the "inside" but those that I have seen did not have separate mailing lists for quality/testing/qa versus innovation/development. What I have seen with the Open Source projects that one would call "successful" is a good deal of process around automated builds, automated unit tests, predictable release dates and milestones, and policies around commiting/contributing/reviewing changes. I think that all of these benefit commercial users and hobbyists the like. If you were just asking about who's interested in discussing changes to foster more quality, count me in. I'm just not sure whether discussing these on a separate mailing list or other channel is the right thing to do. Cheers, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From toupsz at cs.tamu.edu Tue Nov 6 14:27:04 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 15:27:04 -0600 Subject: [Rxtx] reading TTL level signals from serial? Message-ID: Dear RXTX community- I've been using RXTX to handle communicating with several hardware devices in Java (a GPS and some custom audio circuitry for my dissertation work). I have a new, high-accuracy GPS which only communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there any way to communicate with this device using RXTX, perhaps by modding the native code for Windows? If so, does anyone have any tips on how to do it? Has it perhaps already been done? Another option is for me to invert / amplify the signal in hardware, but this is difficult for me to pull off due to the sensitivity of the electronics involved...I'll likely end up using a much less accurate piece of equipment rather than go that far! If anyone could help out, I'd really appreciate it! Thanks! -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/b6c59c2b/attachment-0017.html From netbeans at gatworks.com Tue Nov 6 14:55:22 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 06 Nov 2007 16:55:22 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: Message-ID: <4730E2CA.3090009@gatworks.com> This is really a hardware issue. Is there any device ( ie the serial port ) on your computer that will accept the voltage signals ( and load ) that your device produces? Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it happen safely ( ie u dont cook the GPS device ) I have a new, high-accuracy GPS which only > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there > any way to communicate with this device using RXTX, From toupsz at cs.tamu.edu Tue Nov 6 15:14:01 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 16:14:01 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4730E2CA.3090009@gatworks.com> References: <4730E2CA.3090009@gatworks.com> Message-ID: Actually, the device runs over USB, but shows up as a virtual serial port and is outputting these signals. The software that comes with the device (a u-blox ANTARIS 4 eval kit) is able to communicate. RXTX is able to detect and properly configure the port, but does not get any of the data from it. :-/ It seems like there must be some way to do it (obviously, ublox knows how)... -Zach On Nov 6, 2007 3:55 PM, U. George wrote: > This is really a hardware issue. > Is there any device ( ie the serial port ) on your computer that will > accept the voltage signals ( and load ) that your device produces? > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it > happen safely ( ie u dont cook the GPS device ) > > > I have a new, high-accuracy GPS which only > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there > > any way to communicate with this device using RXTX, > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/15ae7a0b/attachment-0017.html From keithvz at verizon.net Tue Nov 6 16:16:55 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 06 Nov 2007 18:16:55 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> Message-ID: <4730F5E7.1030704@verizon.net> Zach Toups wrote: > On Nov 6, 2007 3:55 PM, U. George > wrote: > > This is really a hardware issue. > Is there any device ( ie the serial port ) on your computer that will > accept the voltage signals ( and load ) that your device produces? > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it > happen safely ( ie u dont cook the GPS device ) > > > I have a new, high-accuracy GPS which only > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is > there > > any way to communicate with this device using RXTX, > _______________________________________________ As UGeorge intimated, it's a hardware issue. If your device outputs TTL level voltages, and your USB to serial converter is RS-232, then you've got a physical hardware differences. Inverted leads and voltage issues are mainly the problem. MAXIM makes a neat little chip called the MAX233 (better than the 232, no extern caps required) You can't solve this in software. Now, there are TTL level compatible USB to serial converters available, I happen to be using one right now. This unit below is from a UK company (there might be sources in the US) http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm Parallax makes one that does 3.3 and 5v http://www.parallax.com/detail.asp?product_id=32201 (but only supports RX, TX, GND, AND DTR towards device) (i've tested a variant of the unit above, and it works with RXTX) In both cases, you'll need some creative wiring depending on the interface on your GPS. Hope this helps Keith From toupsz at cs.tamu.edu Tue Nov 6 16:53:01 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 17:53:01 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4730F5E7.1030704@verizon.net> References: <4730E2CA.3090009@gatworks.com> <4730F5E7.1030704@verizon.net> Message-ID: Yeah...I used an FTDI chip to handle USB/serial conversion on the audio equipment I built. I'm leery of trying to build a board for this ublox GPS due to all the grounding/shielding issues around it. Anyway, I apreciate the help...just sad that I can't handle the problem in software! Ublox did send me the source code for their USB drivers...but as a Java programmer, it's a bit tough for me to sort out. ;) Thanks again! -Zach On Nov 6, 2007 5:16 PM, Keith Monahan wrote: > Zach Toups wrote: > > > On Nov 6, 2007 3:55 PM, U. George > > wrote: > > > > This is really a hardware issue. > > Is there any device ( ie the serial port ) on your computer that > will > > accept the voltage signals ( and load ) that your device produces? > > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make > it > > happen safely ( ie u dont cook the GPS device ) > > > > > > I have a new, high-accuracy GPS which only > > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is > > there > > > any way to communicate with this device using RXTX, > > _______________________________________________ > > As UGeorge intimated, it's a hardware issue. > > If your device outputs TTL level voltages, and your USB to serial > converter is RS-232, then you've got a physical hardware differences. > Inverted leads and voltage issues are mainly the problem. MAXIM makes a > neat little chip called the MAX233 (better than the 232, no extern caps > required) > > You can't solve this in software. > > Now, there are TTL level compatible USB to serial converters available, > I happen to be using one right now. > > This unit below is from a UK company (there might be sources in the US) > > http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm > > Parallax makes one that does 3.3 and 5v > > http://www.parallax.com/detail.asp?product_id=32201 > (but only supports RX, TX, GND, AND DTR towards device) > > (i've tested a variant of the unit above, and it works with RXTX) > > In both cases, you'll need some creative wiring depending on the > interface on your GPS. > > Hope this helps > > Keith > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/06e88ad4/attachment-0017.html From netbeans at gatworks.com Tue Nov 6 17:14:01 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 06 Nov 2007 19:14:01 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> <4730F5E7.1030704@verizon.net> Message-ID: <47310349.5000406@gatworks.com> what gps chipset do u have? > Ublox did send me the source code for their USB drivers...but as a Java > programmer, it's a bit tough for me to sort out. ;) From Steffen.DETTMER at ingenico.com Wed Nov 7 03:10:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 7 Nov 2007 11:10:01 +0100 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> Message-ID: <20071107101000.GN10978@elberon.bln.de.ingenico.com> * Zach Toups wrote on Tue, Nov 06, 2007 at 16:14 -0600: > Actually, the device runs over USB, but shows up as a virtual > serial port and is outputting these signals. Ahh, so what you want is to use rxtx on the serial port that is created by the driver and mapped maybe as some COM8 or whatever? I this case then IMHO it would be no hardware question but maybe a problem in your application, or some driver or indeed a rxtx issue. > The software that > comes with the device (a u-blox ANTARIS 4 eval kit) is able to > communicate. Is it sure that this software is really using the virtual serial port and only this port? oki, Steffen -- About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Wed Nov 7 04:59:10 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 06:59:10 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <20071107101000.GN10978@elberon.bln.de.ingenico.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> Message-ID: <4731A88E.6080705@gatworks.com> >> The software that >> comes with the device (a u-blox ANTARIS 4 eval kit) is able to >> communicate. > > Is it sure that this software is really using the virtual serial > port and only this port? > I have tried to read the docs. I have yet to find any explanation on a (windoz) device driver for this device ( the usb device ). That magic is not explained. For a developer thats important magic. Maybe a call to their support team is in order? From netbeans at gatworks.com Wed Nov 7 05:01:38 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 07:01:38 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <20071107101000.GN10978@elberon.bln.de.ingenico.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> Message-ID: <4731A922.7@gatworks.com> Steffen DETTMER wrote: > * Zach Toups wrote on Tue, Nov 06, 2007 at 16:14 -0600: >> Actually, the device runs over USB, but shows up as a virtual BTW: it seems that I am not getting all the Rxtx mail. Is there still a problem? From toupsz at cs.tamu.edu Wed Nov 7 07:36:20 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Wed, 7 Nov 2007 08:36:20 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4731A88E.6080705@gatworks.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> <4731A88E.6080705@gatworks.com> Message-ID: When I emailed them about this issue, they sent me their WinCE drivers, which are apparently based on this open source driver: http://www.yetanotherhomepage.com/j7xx/j7xx.html?/j7xx/software/util/usbdriver.html These include srcdll, and x86 subfolders, though it's not 100% clear to me that these are useful. The ublox communication suite appears to only communicate with serial ports...I've communicated with the ublox on two different comm ports (one with the serial adapter plugged into the serial port, one with the main USB connection), as well as a Garmin bluetooth GPS (which comes up as a bluetooth serial device). I'm not well versed in code this close to the hardware, but it seems to me that if you're running a virtual serial port, then you're virtually controlling the "voltages" that come in on this "port"...so why would they be "ttl level"? :-/ Shouldn't the USB driver be able to interpret the signals in whatever way it wants and just supply software with the binary interpretation? Thanks for all the help, guys, it's really appreciated! -Zach On Nov 7, 2007 5:59 AM, U. George wrote: > > >> The software that > >> comes with the device (a u-blox ANTARIS 4 eval kit) is able to > >> communicate. > > > > Is it sure that this software is really using the virtual serial > > port and only this port? > > > > I have tried to read the docs. I have yet to find any explanation on a > (windoz) device driver for this device ( the usb device ). That magic > is not explained. For a developer thats important magic. Maybe a call > to their support team is in order? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071107/18a13314/attachment-0016.html From netbeans at gatworks.com Wed Nov 7 08:55:55 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 10:55:55 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> <4731A88E.6080705@gatworks.com> Message-ID: <4731E00B.9030902@gatworks.com> There are 2 components to talking to hardware. There is the electrical specification, and then there is the software specification. there is the rs232 specification, parallel port specification, and the USB electrical specification. Generally these are used to plug in the various devices, and hook up electrically. Then there is the software side. There is the device driver, a software component that sits somewhere in the kernel that handles the USB ( in your case ) controller. The device driver generally does not care about the electrical component. There are various chips that handle USB signals, and these chips have I/O addresses so that signals and data can be properly routed. There is also the side that communicates to the user via the COM port device-name. The device driver that you mentioned is for the "Support PL2303 serial chip". This device driver, which hopefully works, handles the USB chip, and eventually recognzes the gps device, and hopefully creates an COM port so the user can open up and communicate. These are a lot of "HOPES". Since u have the web address of the device driver, and developer, I would think that the developer, and any docs, might be better able to help u to first determine if the GPS device is recognized, and the COM port ( maybe its called by another name ) is created, as per documentation. > > These include srcdll, and x86 subfolders, though it's not 100% clear to > me that these are useful. From tjarvi at qbang.org Sat Nov 10 17:46:13 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Nov 2007 17:46:13 -0700 (MST) Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 5 Nov 2007, Oberhuber, Martin wrote: > Hi Trent, > > are the interestes of hobbyists really so different > from commercial ones? Both should be interested in > high quality and innovation the like. > > I haven't seen too many Open Source projects from the > "inside" but those that I have seen did not have > separate mailing lists for quality/testing/qa > versus innovation/development. > > What I have seen with the Open Source projects that > one would call "successful" is a good deal of > process around automated builds, automated unit > tests, predictable release dates and milestones, > and policies around commiting/contributing/reviewing > changes. > > I think that all of these benefit commercial users > and hobbyists the like. > > If you were just asking about who's interested in > discussing changes to foster more quality, count > me in. I'm just not sure whether discussing these > on a separate mailing list or other channel is the > right thing to do. > Hi Martin, There are two issues I'm thinking about. The first is the generic unit testing and quality initiatives required to move rxtx forward. The second is the inevitable fact that rxtx connects to external hardware. The discussion deals with a different set of problems. Here is a simple example of what I'm getting at. We have the capability of setting custom baud rates in rxtx. We may be interested in seeing regressions in rxtx, the C library or the kernel. Some people may be doing some tests with loopback connections. These will always work even if the baud rate is not set to the expected value. Some people may use null modems between two ports. This may be able to catch the problem but not always. Will the build machines be able to test this? (no - for a few reasons) Will people be trying to catch these type of regressions? (yes) What type of coverage does the community have in the end? (?) We could include the discussions in the same list or another equally open list that may be of interest to some folks that deal with these types of problems on a regular basis. -- Trent Jarvi tjarvi at qbang.org From timlow84 at gmail.com Mon Nov 12 00:31:17 2007 From: timlow84 at gmail.com (Timothy Low) Date: Mon, 12 Nov 2007 15:31:17 +0800 Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> Message-ID: <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> ---------- Forwarded message ---------- From: Timothy Low Date: Nov 12, 2007 3:02 PM Subject: Building RXTX From Source To: taj at www.linux.org.uk Cc: ferdinand.tang at tangs.net, Timothy Low , chweehuat.ng at tangs.net Hi Trent, I tried building RXTX from source, and I got this error. I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm trying to get the necessary ".so" files to use for my serial port communication through java. My linux kernal information is: *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 x86_64 x86_64 x86_64 GNU/Linux* I'll most glad if you can provide me some direction on this. Thanks ! ---------------- [root at smsgateway rxtx-2.0-7pre1]# ./configure checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu configure: WARNING: Trying libtool. If the following fails install libtool checking for gcc... gcc checking for C compiler default output... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking for ld used by GCC... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking for a sed that does not truncate output... /bin/sed checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking command to parse /usr/bin/nm -B output... ok checking how to run the C preprocessor... gcc -E checking for egrep... grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for ranlib... ranlib checking for strip... strip checking for objdir... .libs checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.lo... yes checking if gcc supports -fno-rtti -fno-exceptions... yes checking whether the linker (/usr/bin/ld) supports shared libraries... yes checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking dynamic linker characteristics... GNU/Linux ld.so checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no checking whether -lc should be explicitly linked in... no creating libtool checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking for style of include used by make... GNU checking dependency style of gcc... none checking fcntl.h usability... yes checking fcntl.h presence... yes checking for fcntl.h... yes checking sys/fcntl.h usability... yes checking sys/fcntl.h presence... yes checking for sys/fcntl.h... yes checking sys/file.h usability... yes checking sys/file.h presence... yes checking for sys/file.h... yes checking sys/time.h usability... yes checking sys/time.h presence... yes checking for sys/time.h... yes checking sys/signal.h usability... yes checking sys/signal.h presence... yes checking for sys/signal.h... yes checking signal.h usability... yes checking signal.h presence... yes checking for signal.h.. . yes checking termios.h usability... yes checking termios.h presence... yes checking for termios.h... yes checking asm/termbits.h usability... yes checking asm/termbits.h presence... yes checking for asm/termbits.h... yes checking grp.h usability... yes checking grp.h presence... yes checking for grp.h... yes checking pwd.h usability... yes checking pwd.h presence... yes checking for pwd.h... yes checking whether gcc needs -traditional... no checking whether to enable maintainer-specific portions of Makefiles... no /usr/java/jdk1.5.0_13 configure: WARNING: using JAVA_HOME environmental variable adjusted java.home is /usr/java/jdk1.5.0_13 checking os.name Linux checking os.arch i386 checking java.vendor Sun Microsystems Inc. checking java.version 1.5.0_13 checking os.version 2.6.18-8.el5xen comm.jar appears to be installed already. conftest.c: In function 'main': conftest.c:6: warning: incompatible implicit declaration of built-in function 'printf' conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:6: error: (Each undeclared identifier is reported only once conftest.c:6: error: for each function it appears in.) conftest.c:6: error: expected ')' before string constant conftest.c:7: warning: incompatible implicit declaration of built-in function 'exit' ./configure: line 9649: ./conftest: No such file or directory ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected conftest.c: In function 'main': conftest.c:5: warning: incompatible implicit declaration of built-in function 'printf' conftest.c:10: warning: incompatible implicit declaration of built-in function 'exit' configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status : config.h is unchanged config.status: executing depfiles commands [root at smsgateway rxtx-2.0-7pre1]# make install /usr/java/jdk1.5.0_13/bin/javac -classpath .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d /home/jboss/sources/rxtx- 2.0-7pre1/ -O /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java /home/jboss/sources/rxtx-2.0-7pre1/./src/UnSupportedLoggerException.java /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o /home/jboss/sources/rxtx-2.0-7pre1/x86_64-unknown-linux-gnu/SerialImp.lo /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'init_threads': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: cast from pointer to integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_nativeDrain': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: cast to pointer from integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'read_byte_array': /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: cast to pointer from integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_readArray': /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: comparison is always false due to limited range of data type /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_readTerminatedArray': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: comparison is always false due to limited range of data type mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial- 2.0.7pre1.* gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so -o .libs/librxtxSerial-2.0.7pre1.so (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.0.7pre1.so librxtxSerial.so) creating librxtxSerial.la (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la librxtxSerial.la) gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/ParallelImp.lo /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function 'Java_javax_comm_LPRPort_readArray': /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: comparison is always false due to limited range of data type rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* .libs/librxtxParallel-2.0.7pre1.* gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so -o .libs/librxtxParallel- 2.0.7pre1.so (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.0.7pre1.so librxtxParallel.so) creating librxtxParallel.la (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la librxtxParallel.la) make all-am make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' libtool: install: `x86_64-unknown-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 ------------- Regards, Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071112/27758c3c/attachment-0012.html From tjarvi at qbang.org Mon Nov 12 01:02:09 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Nov 2007 01:02:09 -0700 (MST) Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> Message-ID: On Mon, 12 Nov 2007, Timothy Low wrote: > > Hi Trent, Hi Tim, Comments are inline. As I mentioned off the list, rxtx 2.0 is on the edge of deprecation. We can get it working but this is not the path of least resistance for future work. You will probably need to bounce another round of questions off the list. The following is intended to isolate the problem. > > I tried building RXTX from source, and I got this error. > > > I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm trying > to get the necessary ".so" files to use for my serial port communication > through java. > My linux kernal information is: > > *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 x86_64 > x86_64 x86_64 GNU/Linux* > > I'll most glad if you can provide me some direction on this. Thanks ! > > ---------------- > [root at smsgateway rxtx-2.0-7pre1]# ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > checking for C compiler default output... a.out > checking whether the C compiler works... yes > checking whether we are cross compiling... no > checking for suffix of executables... > checking for suffix of object files... o > checking whether we are using the GNU C compiler... yes > checking whether gcc accepts -g... yes > checking for gcc option to accept ANSI C... none needed > checking for ld used by GCC... /usr/bin/ld > checking if the linker (/usr/bin/ld) is GNU ld... yes > checking for /usr/bin/ld option to reload object files... -r > checking for BSD-compatible nm... /usr/bin/nm -B > checking for a sed that does not truncate output... /bin/sed > checking whether ln -s works... yes > checking how to recognise dependent libraries... pass_all > checking command to parse /usr/bin/nm -B output... ok > checking how to run the C preprocessor... gcc -E > checking for egrep... grep -E > checking for ANSI C header files... yes > checking for sys/types.h... yes > checking for sys/stat.h... yes > checking for stdlib.h... yes > checking for string.h... yes > checking for memory.h... yes > checking for strings.h... yes > checking for inttypes.h... yes > checking for stdint.h... yes > checking for unistd.h... yes > checking dlfcn.h usability... yes > checking dlfcn.h presence... yes > checking for dlfcn.h... yes > checking for ranlib... ranlib > checking for strip... strip > checking for objdir... .libs > checking for gcc option to produce PIC... -fPIC > checking if gcc PIC flag -fPIC works... yes > checking if gcc static flag -static works... yes > checking if gcc supports -c -o file.o... yes > checking if gcc supports -c -o file.lo... yes > checking if gcc supports -fno-rtti -fno-exceptions... yes > checking whether the linker (/usr/bin/ld) supports shared libraries... yes > checking how to hardcode library paths into programs... immediate > checking whether stripping libraries is possible... yes > checking dynamic linker characteristics... GNU/Linux ld.so > checking if libtool supports shared libraries... yes > checking whether to build shared libraries... yes > checking whether to build static libraries... no > checking whether -lc should be explicitly linked in... no > creating libtool > checking for a BSD-compatible install... /usr/bin/install -c > checking whether build environment is sane... yes > checking for gawk... gawk > checking whether make sets $(MAKE)... yes > checking for style of include used by make... GNU > checking dependency style of gcc... none > checking fcntl.h usability... yes > checking fcntl.h presence... yes > checking for fcntl.h... yes > checking sys/fcntl.h usability... yes > checking sys/fcntl.h presence... yes > checking for sys/fcntl.h... yes > checking sys/file.h usability... yes > checking sys/file.h presence... yes > checking for sys/file.h... yes > checking sys/time.h usability... yes > checking sys/time.h presence... yes > checking for sys/time.h... yes > checking sys/signal.h usability... yes > checking sys/signal.h presence... yes > checking for sys/signal.h... yes > checking signal.h usability... yes > checking signal.h presence... yes > checking for signal.h.. . yes > checking termios.h usability... yes > checking termios.h presence... yes > checking for termios.h... yes > checking asm/termbits.h usability... yes > checking asm/termbits.h presence... yes > checking for asm/termbits.h... yes > checking grp.h usability... yes > checking grp.h presence... yes > checking for grp.h... yes > checking pwd.h usability... yes > checking pwd.h presence... yes > checking for pwd.h... yes > checking whether gcc needs -traditional... no > checking whether to enable maintainer-specific portions of Makefiles... no > /usr/java/jdk1.5.0_13 > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /usr/java/jdk1.5.0_13 > checking os.name Linux > checking os.arch i386 > checking java.vendor Sun Microsystems Inc. > checking java.version 1.5.0_13 > checking os.version 2.6.18-8.el5xen > comm.jar appears to be installed already. > conftest.c: In function 'main': > conftest.c:6: warning: incompatible implicit declaration of built-in > function 'printf' > conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:6: error: (Each undeclared identifier is reported only once > conftest.c:6: error: for each function it appears in.) > conftest.c:6: error: expected ')' before string constant This is an outdated kernel version check for when headers and kernels could cause problems for rxtx. If we made it past this, then you are OK. > conftest.c:7: warning: incompatible implicit declaration of built-in > function 'exit' > ./configure: line 9649: ./conftest: No such file or directory > ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected It blew up but continues.. > conftest.c: In function 'main': > conftest.c:5: warning: incompatible implicit declaration of built-in > function 'printf' > conftest.c:10: warning: incompatible implicit declaration of built-in > function 'exit' > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status : config.h is unchanged > config.status: executing depfiles commands > [root at smsgateway rxtx-2.0-7pre1]# make install > /usr/java/jdk1.5.0_13/bin/javac -classpath > .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d > /home/jboss/sources/rxtx- 2.0-7pre1/ -O > /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java > /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/UnSupportedLoggerException.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java > Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or > overrides a deprecated API. > Note: Recompile with -Xlint:deprecation for details. > /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* The java jar should be fine now. You may need to change the source files as mentioned below. > gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. > -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g > -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o > /home/jboss/sources/rxtx-2.0-7pre1/x86_64-unknown-linux-gnu/SerialImp.lo > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'init_threads': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: cast > from pointer to integer of different size > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_nativeDrain': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: cast to > pointer from integer of different size > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'read_byte_array': > /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: cast to > pointer from integer of different size As I recall, this was caused by pointers (now 64 bit rather than 32 bit) being stored in java ints (jints). I would look at the diff between the CVS 2.1 SerialImp.c and RXTXPort.java files against 2.0. We did fix those issues. You have a .so file but the different pointer sizes will cause runtime errors. > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_readArray': > /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: > comparison is always false due to limited range of data type > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_readTerminatedArray': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: > comparison is always false due to limited range of data type > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial- > 2.0.7pre1.* > gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so -o > .libs/librxtxSerial-2.0.7pre1.so > (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.0.7pre1.so > librxtxSerial.so) > creating librxtxSerial.la > (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la > librxtxSerial.la) > gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. > -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g > -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o > /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/ParallelImp.lo > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function > 'Java_javax_comm_LPRPort_readArray': > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: > comparison is always false due to limited range of data type > rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* > .libs/librxtxParallel-2.0.7pre1.* > gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so -o > .libs/librxtxParallel- 2.0.7pre1.so > (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.0.7pre1.so > librxtxParallel.so) > creating librxtxParallel.la > (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la > librxtxParallel.la) > make all-am > make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' > make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' > libtool: install: `x86_64-unknown-linux-gnu' must be an absolute directory > name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 A libtool change? Assuming you ran configure && make install in /home/jboss/sources/rxtx- 2.0-7pre1, libtool is looking for /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/.libs/librxtxSerial-2.0.7pre1.so. I think you have this? The file is just being copied to ~JAVA/jre/lib/$(JAVA_ARCH). -- Trent Jarvi tjarvi at qbang.org From sarah_662005 at yahoo.com Mon Nov 12 16:10:28 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Mon, 12 Nov 2007 15:10:28 -0800 (PST) Subject: [Rxtx] [urgent] device's power off detection Message-ID: <766782.10076.qm@web55803.mail.re3.yahoo.com> Hello all, I have a small application built on top of rxtx api. This application can retrieve the incoming data from a device through a port. The device can be powered off after the port get closed from the application. I have been trying a couple of hours to find a way to detect the power switching from device. If anyone knows how to handle it through rxtx, could you please give me a help? Thank you very much. r, Sara ____________________________________________________________________________________ Get easy, one-click access to your favorites. Make Yahoo! your homepage. http://www.yahoo.com/r/hs -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071112/4599f3ec/attachment-0011.html From netbeans at gatworks.com Mon Nov 12 17:52:22 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 12 Nov 2007 19:52:22 -0500 Subject: [Rxtx] [urgent] device's power off detection In-Reply-To: <766782.10076.qm@web55803.mail.re3.yahoo.com> References: <766782.10076.qm@web55803.mail.re3.yahoo.com> Message-ID: <4738F546.5010101@gatworks.com> Not sure what u are asking for. Are u asking for a way to detect if the device is OFF? Are u asking how to power off the device - via software ? Is it a Serial device? is it a parallel device? is it a usb device? Sara Hugh wrote: > Hello all, > I have a small application built on top of rxtx api. This application > can retrieve the incoming data from a device through a port. The device > can be powered off after the port get closed from the application. I > have been trying a couple of hours to find a way to detect the power > switching from device. If anyone knows how to handle it through rxtx, > could you please give me a help? Thank you very much. From tjarvi at qbang.org Mon Nov 12 22:48:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Nov 2007 22:48:11 -0700 (MST) Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711120225x562db8cbxb750767ade3b0d73@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> <900c6ba90711120031p66edc001ted76f7ba24e34b98@mail.gmail.com> <900c6ba90711120225x562db8cbxb750767ade3b0d73@mail.gmail.com> Message-ID: Hi Tim, The gnu.io namespace looks just like the javax.comm 2.0 namespace. There are additional (discouraged) undocumented methods in gnu.io that you need not use. We just used the different namespace to avoid poluting Sun's by mistake and to make sure we stayed off any potential licensing related radar. Usuaully, you just change your imports and make sure you do not use the javax.comm namespace for anything like exception handling. As I mentioned off the list, there are no issues with rxtx going through the JSR process to be more Sun friendly other than time. rxtx has no hidden intentions there; anything that does not work like CommAPI 2.0 documented is a bug. The reason we do not support CommAPI 2.1 is technical in nature and is in the list archives as well as the front page of www.rxtx.org. On Mon, 12 Nov 2007, Timothy Low wrote: > Hi Trent, > > I'll move to use a JDK1.5 64-bit version... but do I need to make any source > code changes to use the package (gnu.io) in the RTXTcomm.jar instead of the > ones from the javacomm api ? > > > Regards, > Tim > > On Nov 12, 2007 5:22 PM, Trent Jarvi wrote: > >> >> Hi Tim, >> >> I see a couple things here. >> >> First your jdk is for i686 yet the library is compiled on a x86_64 >> machine. You may try passing configure the --target=i686-unknown-linux to >> try using the i686 backend to gcc if it is available. Or move to the 64 >> bit jdk. >> >> The other error I see is again the moved UTF_RELEASE define that we need >> to fix. You can probably get around that with: >> >> make -DUTF_RELEASE=`uname -r` >> >> even more simple would be to just specify the serial library which should >> be in configure --help. >> >> You can remove the UTF_RELEASE check from configure by editing >> configure.in, searching for the simple C program check and deleting it. >> Running autoconf after that will regenerate a new configure without the >> check. >> >> Note that you should remove the previous native libraries >> (librxtxSerial.so) when moving from rxtx 2.0 to 2.1. These are compiled >> for different namespaces (javax.comm/gnu.io). >> >> On Mon, 12 Nov 2007, Timothy Low wrote: >> >>> *Hi Trent, >>> >>> I moved on to rxtx 2.1.7r2, and updated my jre to 1.6.0 (64-bit)... I >> tried >>> the following 2 methods: >>> >>> (1) using the rxtx 2.1.7 binaries from the RXTX website* >>> *Are these binaries suitable for a 64-bit OS ? There mentioning of the >>> gnu.io that you've talked about previously...* >>> ------ >>> [root at smsgateway sources]# java -Djava.library.path=/usr/lib PortLister >>> Experimental: JNI_OnLoad called. >>> >>> java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion >>> ()Ljava/lang/String; >>> at gnu.io.RXTXCommDriver.nativeGetVersion(Native Method) >>> at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:85) >>> at java.lang.Class.forName0(Native Method) >>> at java.lang.Class.forName(Unknown Source) >>> at javax.comm.CommPortIdentifier.loadDriver( >> CommPortIdentifier.java >>> :237) >>> at javax.comm.CommPortIdentifier.(CommPortIdentifier.java >>> :109) >>> at PortLister.(PortLister.java:6) >>> at PortLister.main(PortLister.java:25) >>> Exception in thread "main" java.lang.UnsatisfiedLinkError: >>> com.sun.comm.SunrayInfo.isSessionActive()Z >>> at com.sun.comm.SunrayInfo.isSessionActive(Native Method) >>> at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java >> :155) >>> at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java >>> :100) >>> at javax.comm.CommPortIdentifier.(CommPortIdentifier.java >>> :138) >>> at PortLister.(PortLister.java:6) >>> at PortLister.main(PortLister.java:25) >>> >>> ------ >>> >>> (2) compiling the rxtx 2.1.7 from source >>> *but i got the following error while running ./configure and make all* >>> >>> ------ >>> [root at smsgateway rxtx-2.1-7r2]# ./configure >>> checking build system type... x86_64-unknown-linux-gnu >>> checking host system type... x86_64-unknown-linux-gnu >>> checking target system type... x86_64-unknown-linux-gnu >>> configure: WARNING: Trying libtool. If the following fails install >> libtool >>> checking for gcc... gcc >>> checking for C compiler default output file name... a.out >>> checking whether the C compiler works... yes >>> checking whether we are cross compiling... no >>> checking for suffix of executables... >>> checking for suffix of object files... o >>> checking whether we are using the GNU C compiler... yes >>> checking whether gcc accepts -g... yes >>> checking for gcc option to accept ANSI C... none needed >>> checking for a sed that does not truncate output... /bin/sed >>> checking for egrep... grep -E >>> checking for ld used by gcc... /usr/bin/ld >>> checking if the linker (/usr/bin/ld) is GNU ld... yes >>> checking for /usr/bin/ld option to reload object files... -r >>> checking for BSD-compatible nm... /usr/bin/nm -B >>> checking whether ln -s works... yes >>> checking how to recognise dependent libraries... pass_all >>> checking how to run the C preprocessor... gcc -E >>> checking for ANSI C header files... yes >>> checking for sys/types.h... yes >>> checking for sys/stat.h... yes >>> checking for stdlib.h... yes >>> checking for string.h... yes >>> checking for memory.h... yes >>> checking for strings.h... yes >>> checking for inttypes.h... yes >>> checking for stdint.h... yes >>> checking for unistd.h... yes >>> checking dlfcn.h usability... yes >>> checking dlfcn.h presence... yes >>> checking for dlfcn.h... yes >>> checking for g++... g++ >>> checking whether we are using the GNU C++ compiler... yes >>> checking whether g++ accepts -g... yes >>> checking how to run the C++ preprocessor... g++ -E >>> checking for g77... no >>> checking for f77... no >>> checking for xlf... no >>> checking for frt... no >>> checking for pgf77... no >>> checking for fort77... no >>> checking for fl32... no >>> checking for af77... no >>> checking for f90... no >>> checking for xlf90... no >>> checking for pgf90... no >>> checking for epcf90... no >>> checking for f95... f95 >>> checking whether we are using the GNU Fortran 77 compiler... yes >>> checking whether f95 accepts -g... yes >>> checking the maximum length of command line arguments... 32768 >>> checking command to parse /usr/bin/nm -B output from gcc object... ok >>> checking for objdir... .libs >>> checking for ar... ar >>> checking for ranlib... ranlib >>> checking for strip... strip >>> checking if gcc static flag works... yes >>> checking if gcc supports -fno-rtti -fno-exceptions... no >>> checking for gcc option to produce PIC... -fPIC >>> checking if gcc PIC flag -fPIC works... yes >>> checking if gcc supports -c -o file.o... yes >>> checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking whether -lc should be explicitly linked in... no >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> checking if libtool supports shared libraries... yes >>> checking whether to build shared libraries... yes >>> checking whether to build static libraries... no >>> configure: creating libtool >>> appending configuration tag "CXX" to libtool >>> checking for ld used by g++... /usr/bin/ld -m elf_x86_64 >>> checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes >>> checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking for g++ option to produce PIC... -fPIC >>> checking if g++ PIC flag -fPIC works... yes >>> checking if g++ supports -c -o file.o... yes >>> checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> appending configuration tag "F77" to libtool >>> checking if libtool supports shared libraries... yes >>> checking whether to build shared libraries... yes >>> checking whether to build static libraries... no >>> checking for f95 option to produce PIC... -fPIC >>> checking if f95 PIC flag -fPIC works... yes >>> checking if f95 supports -c -o file.o... yes >>> checking whether the f95 linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> checking for a BSD-compatible install... /usr/bin/install -c >>> checking whether build environment is sane... yes >>> checking for gawk... gawk >>> checking whether make sets $(MAKE)... yes >>> checking for style of include used by make... GNU >>> checking dependency style of gcc... none >>> checking dependency style of g++... none >>> checking fcntl.h usability... yes >>> checking fcntl.h presence... yes >>> checking for fcntl.h... yes >>> checking sys/fcntl.h usability... yes >>> checking sys/fcntl.h presence... yes >>> checking for sys/fcntl.h... yes >>> checking sys/file.h usability... yes >>> checking sys/file.h presence... yes >>> checking for sys/file.h... yes >>> checking sys/time.h usability... yes >>> checking sys/time.h presence... yes >>> checking for sys/time.h... yes >>> checking sys/signal.h usability... yes >>> checking sys/signal.h presence... yes >>> checking for sys/signal.h... yes >>> checking signal.h usability... yes >>> checking signal.h presence... yes >>> checking for signal.h... yes >>> checking termios.h usability... yes >>> checking termios.h presence... yes >>> checking for termios.h... yes >>> checking grp.h usability... yes >>> checking grp.h presence... yes >>> checking for grp.h... yes >>> checking pwd.h usability... yes >>> checking pwd.h presence... yes >>> checking for pwd.h... yes >>> checking whether gcc needs -traditional... no >>> checking whether to enable maintainer-specific portions of Makefiles... >> no >>> /usr/java/jdk1.5.0_13 >>> configure: WARNING: using JAVA_HOME environmental variable >>> adjusted java.home is /usr/java/jdk1.5.0_13 >>> checking os.name Linux >>> checking os.arch i386 >>> checking java.vendor Sun Microsystems Inc. >>> checking java.version 1.5.0_13 >>> checking os.version 2.6.18-8.el5xen >>> conftest.c: In function 'main': >>> conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this >> function) >>> conftest.c:8: error: (Each undeclared identifier is reported only once >>> conftest.c:8: error: for each function it appears in.) >>> conftest.c:8: error: expected ')' before string constant >>> ./configure: line 21462: ./conftest: No such file or directory >>> ./configure: line 21462: test: 2.6.18-8.el5xen: unary operator expected >>> configure: creating ./config.status >>> config.status: creating Makefile >>> config.status: creating config.h >>> config.status: executing depfiles commands >>> [root at smsgateway rxtx-2.1-7r2]# make install >>> /usr/java/jdk1.5.0_13/bin/javac -classpath .:/home/jboss/sources/rxtx- >>> >> 2.1-7r2:/home/jboss/sources/rxtx-2.1-7r2/src:/usr/java/jdk1.5.0_13/jre/lib/ext/RXTXcomm.jar-d >>> /home/jboss/sources/rxtx- >>> 2.1-7r2/ -O -source 1.3 -target 1.3 >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommDriver.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortEnumerator.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortIdentifier.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortOwnershipListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Configure.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2C.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/I2CPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/LPRPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/NoSuchPortException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/PortInUseException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Raw.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/RawPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RawPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RawPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/RS485PortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485PortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485Port.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXCommDriver.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXVersion.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPort.java >>> /home/jboss/sources/rxtx-2.1-7r2 >> /./src/UnsupportedCommOperationException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/UnSupportedLoggerException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Zystem.java >>> /usr/java/jdk1.5.0_13/bin/javah -classpath .:/home/jboss/sources/rxtx- >>> >> 2.1-7r2:/home/jboss/sources/rxtx-2.1-7r2/src:/usr/java/jdk1.5.0_13/jre/lib/ext/RXTXcomm.jar-d >>> x86_64-unknown-linux-gnu -jni `(for i in CommDriver CommPortEnumerator >>> CommPortIdentifier CommPort CommPortOwnershipListener Configure I2C >>> I2CPortEvent I2CPortEventListener I2CPort LPRPort NoSuchPortException >>> ParallelPortEvent ParallelPortEventListener ParallelPort >> PortInUseException >>> Raw RawPortEvent RawPortEventListener RawPort RS485 RS485PortEvent >>> RS485PortEventListener RS485Port RXTXCommDriver RXTXPort RXTXVersion >>> SerialPortEvent SerialPortEventListener SerialPort >>> UnsupportedCommOperationException UnSupportedLoggerException Zystem;do \ >>> if grep > /dev/null native.*\( /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/$i.java; then \ >>> echo gnu.io.$i; \ >>> fi; \ >>> done)` >>> /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialImp.c -o >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo; >>> \ >>> if [ "Serial" = "Serial" ]; >>> then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxSerial.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxSerial.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo; >> \ >>> fi; \ >>> ) >>> mkdir /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/.libs >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/SerialImp.o >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/fuserImp.o >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c: In function >> 'show_user': >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c:238: warning: cast >> from >>> pointer to integer of different size >>> gcc -shared /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/SerialImp.o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/fuserImp.o >>> -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7.so -o >> .libs/librxtxSerial- >>> 2.1-7.so >>> (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.1-7.so >>> librxtxSerial.so) >>> creating librxtxSerial.la >>> (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la >>> librxtxSerial.la) >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelImp.c -o >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/ParallelImp.lo; >>> \ >>> if [ "Parallel" = "Serial" ]; >>> then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxParallel.la -rpath >>> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/ParallelImp.lo >>> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxParallel.la -rpath >>> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/ParallelImp.lo; >>> \ >>> fi; \ >>> ) >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >>> /x86_64-unknown-linux-gnu/.libs/ParallelImp.o >>> gcc -shared /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/ParallelImp.o >>> -lpthread -Wl,-soname -Wl,librxtxParallel-2.1-7.so -o >>> .libs/librxtxParallel-2.1-7.so >>> (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.1-7.so >>> librxtxParallel.so) >>> creating librxtxParallel.la >>> (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la >>> librxtxParallel.la) >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo; >>> \ >>> if [ "I2C" = "Serial" ]; then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxI2C.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo >>> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxI2C.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo; >>> \ >>> fi; \ >>> ) >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/.libs/I2CImp.o >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c: In function >>> 'Java_gnu_io_I2CPort_Initialize': >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: 'UTS_RELEASE' >>> undeclared (first use in this function) >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: (Each >> undeclared >>> identifier is reported only once >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: for each >> function >>> it appears in.) >>> libtool: link: `/home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/I2CImp.lo' >>> is not a valid libtool object >>> make: *** [x86_64-unknown-linux-gnu/librxtxI2C.la] Error 1 >>> >>> ------ >>> >>> >>> >>> On Nov 12, 2007 4:02 PM, Trent Jarvi wrote: >>> >>>> On Mon, 12 Nov 2007, Timothy Low wrote: >>>>> >>>>> Hi Trent, >>>> >>>> Hi Tim, >>>> >>>> Comments are inline. As I mentioned off the list, rxtx 2.0 is on the >> edge >>>> of deprecation. We can get it working but this is not the path of >> least >>>> resistance for future work. >>>> >>>> You will probably need to bounce another round of questions off the >> list. >>>> The following is intended to isolate the problem. >>>> >>>>> >>>>> I tried building RXTX from source, and I got this error. >>>>> >>>>> >>>>> I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm >>>> trying >>>>> to get the necessary ".so" files to use for my serial port >> communication >>>>> through java. >>>>> My linux kernal information is: >>>>> >>>>> *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 >>>> x86_64 >>>>> x86_64 x86_64 GNU/Linux* >>>>> >>>>> I'll most glad if you can provide me some direction on this. Thanks ! >>>>> >>>>> ---------------- >>>>> [root at smsgateway rxtx-2.0-7pre1]# ./configure >>>>> checking build system type... x86_64-unknown-linux-gnu >>>>> checking host system type... x86_64-unknown-linux-gnu >>>>> checking target system type... x86_64-unknown-linux-gnu >>>>> configure: WARNING: Trying libtool. If the following fails install >>>> libtool >>>>> checking for gcc... gcc >>>>> checking for C compiler default output... a.out >>>>> checking whether the C compiler works... yes >>>>> checking whether we are cross compiling... no >>>>> checking for suffix of executables... >>>>> checking for suffix of object files... o >>>>> checking whether we are using the GNU C compiler... yes >>>>> checking whether gcc accepts -g... yes >>>>> checking for gcc option to accept ANSI C... none needed >>>>> checking for ld used by GCC... /usr/bin/ld >>>>> checking if the linker (/usr/bin/ld) is GNU ld... yes >>>>> checking for /usr/bin/ld option to reload object files... -r >>>>> checking for BSD-compatible nm... /usr/bin/nm -B >>>>> checking for a sed that does not truncate output... /bin/sed >>>>> checking whether ln -s works... yes >>>>> checking how to recognise dependent libraries... pass_all >>>>> checking command to parse /usr/bin/nm -B output... ok >>>>> checking how to run the C preprocessor... gcc -E >>>>> checking for egrep... grep -E >>>>> checking for ANSI C header files... yes >>>>> checking for sys/types.h... yes >>>>> checking for sys/stat.h... yes >>>>> checking for stdlib.h... yes >>>>> checking for string.h... yes >>>>> checking for memory.h... yes >>>>> checking for strings.h... yes >>>>> checking for inttypes.h... yes >>>>> checking for stdint.h... yes >>>>> checking for unistd.h... yes >>>>> checking dlfcn.h usability... yes >>>>> checking dlfcn.h presence... yes >>>>> checking for dlfcn.h... yes >>>>> checking for ranlib... ranlib >>>>> checking for strip... strip >>>>> checking for objdir... .libs >>>>> checking for gcc option to produce PIC... -fPIC >>>>> checking if gcc PIC flag -fPIC works... yes >>>>> checking if gcc static flag -static works... yes >>>>> checking if gcc supports -c -o file.o... yes >>>>> checking if gcc supports -c -o file.lo... yes >>>>> checking if gcc supports -fno-rtti -fno-exceptions... yes >>>>> checking whether the linker (/usr/bin/ld) supports shared libraries... >>>> yes >>>>> checking how to hardcode library paths into programs... immediate >>>>> checking whether stripping libraries is possible... yes >>>>> checking dynamic linker characteristics... GNU/Linux ld.so >>>>> checking if libtool supports shared libraries... yes >>>>> checking whether to build shared libraries... yes >>>>> checking whether to build static libraries... no >>>>> checking whether -lc should be explicitly linked in... no >>>>> creating libtool >>>>> checking for a BSD-compatible install... /usr/bin/install -c >>>>> checking whether build environment is sane... yes >>>>> checking for gawk... gawk >>>>> checking whether make sets $(MAKE)... yes >>>>> checking for style of include used by make... GNU >>>>> checking dependency style of gcc... none >>>>> checking fcntl.h usability... yes >>>>> checking fcntl.h presence... yes >>>>> checking for fcntl.h... yes >>>>> checking sys/fcntl.h usability... yes >>>>> checking sys/fcntl.h presence... yes >>>>> checking for sys/fcntl.h... yes >>>>> checking sys/file.h usability... yes >>>>> checking sys/file.h presence... yes >>>>> checking for sys/file.h... yes >>>>> checking sys/time.h usability... yes >>>>> checking sys/time.h presence... yes >>>>> checking for sys/time.h... yes >>>>> checking sys/signal.h usability... yes >>>>> checking sys/signal.h presence... yes >>>>> checking for sys/signal.h... yes >>>>> checking signal.h usability... yes >>>>> checking signal.h presence... yes >>>>> checking for signal.h.. . yes >>>>> checking termios.h usability... yes >>>>> checking termios.h presence... yes >>>>> checking for termios.h... yes >>>>> checking asm/termbits.h usability... yes >>>>> checking asm/termbits.h presence... yes >>>>> checking for asm/termbits.h... yes >>>>> checking grp.h usability... yes >>>>> checking grp.h presence... yes >>>>> checking for grp.h... yes >>>>> checking pwd.h usability... yes >>>>> checking pwd.h presence... yes >>>>> checking for pwd.h... yes >>>>> checking whether gcc needs -traditional... no >>>>> checking whether to enable maintainer-specific portions of >> Makefiles... >>>> no >>>>> /usr/java/jdk1.5.0_13 >>>>> configure: WARNING: using JAVA_HOME environmental variable >>>>> adjusted java.home is /usr/java/jdk1.5.0_13 >>>>> checking os.name Linux >>>>> checking os.arch i386 >>>>> checking java.vendor Sun Microsystems Inc. >>>>> checking java.version 1.5.0_13 >>>>> checking os.version 2.6.18-8.el5xen >>>>> comm.jar appears to be installed already. >>>>> conftest.c: In function 'main': >>>>> conftest.c:6: warning: incompatible implicit declaration of built-in >>>>> function 'printf' >>>>> conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this >>>> function) >>>>> conftest.c:6: error: (Each undeclared identifier is reported only once >>>>> conftest.c:6: error: for each function it appears in.) >>>>> conftest.c:6: error: expected ')' before string constant >>>> >>>> >>>> This is an outdated kernel version check for when headers and kernels >>>> could cause problems for rxtx. If we made it past this, then you are >> OK. >>>> >>>> >>>>> conftest.c:7: warning: incompatible implicit declaration of built-in >>>>> function 'exit' >>>>> ./configure: line 9649: ./conftest: No such file or directory >>>>> ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected >>>> >>>> It blew up but continues.. >>>> >>>>> conftest.c: In function 'main': >>>>> conftest.c:5: warning: incompatible implicit declaration of built-in >>>>> function 'printf' >>>>> conftest.c:10: warning: incompatible implicit declaration of built-in >>>>> function 'exit' >>>>> configure: creating ./config.status >>>>> config.status: creating Makefile >>>>> config.status: creating config.h >>>>> config.status : config.h is unchanged >>>>> config.status: executing depfiles commands >>>>> [root at smsgateway rxtx-2.0-7pre1]# make install >>>>> /usr/java/jdk1.5.0_13/bin/javac -classpath >>>>> .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/ -O >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1 >> /./src/UnSupportedLoggerException.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java >>>>> Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or >>>>> overrides a deprecated API. >>>>> Note: Recompile with -Xlint:deprecation for details. >>>>> /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* >>>> >>>> >>>> The java jar should be fine now. You may need to change the source >> files >>>> as mentioned below. >>>> >>>>> gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu >> -I. >>>>> -I/usr/java/jdk1.5.0_13/include >> -I/usr/java/jdk1.5.0_13/include/./linux/ >>>> -g >>>>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o >>>>> /home/jboss/sources/rxtx-2.0-7pre1 >> /x86_64-unknown-linux-gnu/SerialImp.lo >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'init_threads': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: >>>> cast >>>>> from pointer to integer of different size >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_nativeDrain': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: >>>> cast to >>>>> pointer from integer of different size >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'read_byte_array': >>>>> /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: >>>> cast to >>>>> pointer from integer of different size >>>> >>>> >>>> As I recall, this was caused by pointers (now 64 bit rather than 32 >> bit) >>>> being stored in java ints (jints). I would look at the diff between >> the >>>> CVS 2.1 SerialImp.c and RXTXPort.java files against 2.0. We >>>> did fix those issues. >>>> >>>> You have a .so file but the different pointer sizes will cause runtime >>>> errors. >>>> >>>> >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_readArray': >>>>> /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: >>>>> comparison is always false due to limited range of data type >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_readTerminatedArray': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: >>>>> comparison is always false due to limited range of data type >>>>> mkdir .libs >>>>> rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* >> .libs/librxtxSerial- >>>>> 2.0.7pre1.* >>>>> gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so-o >>>>> .libs/librxtxSerial-2.0.7pre1.so >>>>> (cd .libs && rm -f librxtxSerial.so && ln -s >> librxtxSerial-2.0.7pre1.so >>>>> librxtxSerial.so) >>>>> creating librxtxSerial.la >>>>> (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la >>>>> librxtxSerial.la) >>>>> gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu >> -I. >>>>> -I/usr/java/jdk1.5.0_13/include >> -I/usr/java/jdk1.5.0_13/include/./linux/ >>>> -g >>>>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o >>>>> /home/jboss/sources/rxtx- 2.0-7pre1 >>>> /x86_64-unknown-linux-gnu/ParallelImp.lo >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function >>>>> 'Java_javax_comm_LPRPort_readArray': >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: >>>>> comparison is always false due to limited range of data type >>>>> rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* >>>>> .libs/librxtxParallel-2.0.7pre1.* >>>>> gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so-o >>>>> .libs/librxtxParallel- 2.0.7pre1.so >>>>> (cd .libs && rm -f librxtxParallel.so && ln -s >>>> librxtxParallel-2.0.7pre1.so >>>>> librxtxParallel.so) >>>>> creating librxtxParallel.la >>>>> (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la >>>>> librxtxParallel.la) >>>>> make all-am >>>>> make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' >>>>> make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' >>>>> libtool: install: `x86_64-unknown-linux-gnu' must be an absolute >>>> directory >>>>> name >>>>> Try `libtool --help --mode=install' for more information. >>>>> make: *** [install] Error 1 >>>> >>>> A libtool change? Assuming you ran configure && make install in >>>> /home/jboss/sources/rxtx- 2.0-7pre1, libtool is looking for >>>> /home/jboss/sources/rxtx- >>>> 2.0-7pre1/x86_64-unknown-linux-gnu/.libs/librxtxSerial-2.0.7pre1.so. >>>> >>>> I think you have this? The file is just being copied to >>>> ~JAVA/jre/lib/$(JAVA_ARCH). >>>> >>>> -- >>>> Trent Jarvi >>>> tjarvi at qbang.org >>>> >>> >> > From guido.vogt at celsi.ch Tue Nov 13 00:28:01 2007 From: guido.vogt at celsi.ch (Guido Vogt) Date: Tue, 13 Nov 2007 08:28:01 +0100 Subject: [Rxtx] RTS Line can't be set Message-ID: <47395201.1050400@celsi.ch> I'm working on an Windows XP /SP2 System. Version of RXTX: 2.1.7. The serial line is connected to a modem. As I can see, the RTS-Line of the serial Port is inactive, when the port is opened (flowcontrol=none). Obviously, no data is coming from the modem. If I use the setRTS(true) command after open, the comport does not send out my data any more. This behaviour is regardless of flowcontrol. Anybody has an idea what do do? Thanks for help. From Martin.Oberhuber at windriver.com Tue Nov 13 08:58:23 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 13 Nov 2007 16:58:23 +0100 Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803880918@ism-mail03.corp.ad.wrs.com> Hi Trent, as said before, I like the idea of discussing such quality engineering issues, but why hide these away from the rest of the public? Anyways, if you do want to create a new mailing list for these kinds of things I'll happily subscribe. 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: Sunday, November 11, 2007 1:46 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: RE: [Rxtx] Quality Engineering with rxtx > > On Mon, 5 Nov 2007, Oberhuber, Martin wrote: > > > Hi Trent, > > > > are the interestes of hobbyists really so different > > from commercial ones? Both should be interested in > > high quality and innovation the like. > > > > I haven't seen too many Open Source projects from the > > "inside" but those that I have seen did not have > > separate mailing lists for quality/testing/qa > > versus innovation/development. > > > > What I have seen with the Open Source projects that > > one would call "successful" is a good deal of > > process around automated builds, automated unit > > tests, predictable release dates and milestones, > > and policies around commiting/contributing/reviewing > > changes. > > > > I think that all of these benefit commercial users > > and hobbyists the like. > > > > If you were just asking about who's interested in > > discussing changes to foster more quality, count > > me in. I'm just not sure whether discussing these > > on a separate mailing list or other channel is the > > right thing to do. > > > > Hi Martin, > > There are two issues I'm thinking about. The first is the > generic unit > testing and quality initiatives required to move rxtx > forward. The second > is the inevitable fact that rxtx connects to external hardware. The > discussion deals with a different set of problems. > > Here is a simple example of what I'm getting at. > > We have the capability of setting custom baud rates in rxtx. > We may be > interested in seeing regressions in rxtx, the C library or > the kernel. > Some people may be doing some tests with loopback > connections. These will > always work even if the baud rate is not set to the expected > value. Some > people may use null modems between two ports. This may be > able to catch > the problem but not always. > > Will the build machines be able to test this? (no - for a few reasons) > Will people be trying to catch these type of regressions? (yes) > What type of coverage does the community have in the end? (?) > > We could include the discussions in the same list or another > equally open > list that may be of interest to some folks that deal with > these types of > problems on a regular basis. > > -- > Trent Jarvi > tjarvi at qbang.org > From toupsz at cs.tamu.edu Tue Nov 13 10:33:03 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 13 Nov 2007 11:33:03 -0600 Subject: [Rxtx] [urgent] device's power off detection In-Reply-To: <4738F546.5010101@gatworks.com> References: <766782.10076.qm@web55803.mail.re3.yahoo.com> <4738F546.5010101@gatworks.com> Message-ID: Lacking any other specification on it...but can you set up the device to notify your software when it turns off? Send a message or somesuch? Maybe it can signal using RTS or DTR? -Zach On Nov 12, 2007 6:52 PM, U. George wrote: > Not sure what u are asking for. Are u asking for a way to detect if the > device is OFF? Are u asking how to power off the device - via software ? > Is it a Serial device? > is it a parallel device? > is it a usb device? > > Sara Hugh wrote: > > Hello all, > > I have a small application built on top of rxtx api. This application > > can retrieve the incoming data from a device through a port. The device > > can be powered off after the port get closed from the application. I > > have been trying a couple of hours to find a way to detect the power > > switching from device. If anyone knows how to handle it through rxtx, > > could you please give me a help? Thank you very much. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071113/e5859e4d/attachment-0010.html From tjarvi at qbang.org Tue Nov 13 20:02:03 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 13 Nov 2007 20:02:03 -0700 (MST) Subject: [Rxtx] #ifndef TIOCSERGETLSR In-Reply-To: <472E3AAF.7050709@gatworks.com> References: <472E3AAF.7050709@gatworks.com> Message-ID: On Sun, 4 Nov 2007, U. George wrote: > For Linux, it seems that you need the code for both *having* a > TIOCSERGETLSR, and *not having* a TIOCSERGETLSR. Maybe the ioctl exists > system wide, but not necessarily for the device driver itself ( always > returns -1 ) . > > Are there systems that have a *functioning* TIOCSERGETLSR for all their > devices? Then this would be the case where the "#ifndef TIOCSERGETLSR" > directive could be useful is eliminating the unnecessary code and tests. > > And for those systems that dont have a TIOCSERGETLSR, then the code for > TIOCSERGETLSR can be eliminated. > > It would be a simple case to have, as a foundation, all the code to > simulate the missing TIOCSERGETLSR ioctl. If the system does have the > ioctl, then that code can be ifdef'd in, and co-exist with the > functionality of the code that simulates the missing TIOCSERGETLSR ioctl. > Ah, there is the post. Sorry I was on vacation. Hi George, Yes there are systems that have functioning TIOCSERGETLSR for all of their devices. These are machines that just use traditional UARTs. If you mean operating systems, then probably not. Let me explain a bit about the history of those #ifdefs to help clear up a mess. RXTX aims to follow POSIX. TIOCSERGETLSR turns out to not be POSIX at all as I understand. It isn't in BSD, Solaris, AIX or HP-UX. It certainly provides access to important information. I assumed it was standard when I coded rxtx on a Linux system. Ya, laugh. Then I looked at Win32.. Oh you are still laughing? ..I could not navigate msft's web site at the time [still can't really find anything today]. So google pointed me to someones 'reverse documentation' of the w32 API and an example msft put together back in the win3.0 days. It was enough but maybe not 100% correct. They covered overlapped IO which was important for events in rxtx. Looking at Win32 and Linux, it made sense to implement TIOCSERGETLSR for win32 with the way rxtx works. That was how things matched up. But when I got feedback about other systems, it didn't match up. When people used multiport cards with money saving designs in Linux, it didn't match up. And today, there are drivers for unusual serial ports that don't match up. Now we have some ugly logic that mostly works for most serial ports. It isn't right though. The important aspect of TIOSERGETLSR is knowing when the output is really gone. But POSIX tcdrain tells us the same thing. So there is logic in the ifdefs to match that up as you suggest. Perhaps a more formal solution along those lines would be worth looking into. I would suggest the roles should be switched though. We should use POSIX calls on all systems and hide things that don't work on everything like we have with other undocumented calls. TIOSERGETLSR is nice and would be great if it was standard. It isn't as far as I can tell. In the end, many people write Java code because they want portability. The TIOSERGETLSR does not really fit. In someways, this is limiting to the least common denominator which is Solaris if you have seen it's serial kernel driver code. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 15 09:10:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 15 Nov 2007 17:10:59 +0100 Subject: [Rxtx] RXTX blocking on unconnected virtual port Message-ID: <460801A4097E3D4CA04CC64EE648584803919080@ism-mail03.corp.ad.wrs.com> Hello, we came across the following issue: * Set up a virtual serial port, e.g. with com0com: http://com0com.sourceforge.net/ * Connect RXTX to one end, e.g. cnc1a * Do not connect the other end, e.g. cnc1b * Have RXTX write data to the port --> Since the data is not being read, RXTX blocks - RXTXPort.SerialOutputStream.write increases the RXTXPort.IOLocked variable - it then calls the native writeByte or writeArray method (which blocks) closing the RXTXPort hangs for ever too: - RXTXPort.close() has a while( IOLocked > 0 ) {..Thread.sleep(500);...} which spins for ever ==> once the communication hangs, it cannot recover. Has anybody else seen such a problem before, or even got an idea how to solve it? When I connect Hyperterminal to the same half-open port, and type a character, it hangs for about 3 seconds but then times out and is available again. I guess that's what I'd like to see in RXTX as well, with a (configurable) timeout. Our big problem with the current situation is that once RXTX gets stuck, there is nothing at all we can do to make it go live again - that's why our original workaround of writing to the port in a background thread is not good enough. For more background information, the issue is being tracked in https://bugs.eclipse.org/bugs/show_bug.cgi?id=208185 Thanks for any hints or ideas, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Sun Nov 18 09:43:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 09:43:26 -0700 (MST) Subject: [Rxtx] PortInUseException - Cannot close and reopen serial port In-Reply-To: <460801A4097E3D4CA04CC64EE64858480351C711@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858480351C711@ism-mail03.corp.ad.wrs.com> Message-ID: These have been submitted to CVS and the bugzilla entries have been changed to reflect the changes. ChangeLog: find ports which were added after program startup on Mac OS X. Martin Oberhuber http://bugzilla.qbang.org/show_bug.cgi?id=48 Clean up CommPort Ownership code, avoid possible deadlocks, fix lost commport ownership events. http://bugzilla.qbang.org/show_bug.cgi?id=83 Martin Oberhuber On Wed, 24 Oct 2007, Oberhuber, Martin wrote: > 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) > > > > > > > > > > > > > > > From tjarvi at qbang.org Sun Nov 18 09:45:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 09:45:39 -0700 (MST) Subject: [Rxtx] PortInUseException - Cannot close and reopen serial port In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848020CAF26@ism-mail03.corp.ad.wrs.com> Message-ID: The current CVS code should have all the entries. With version information, I usually do not change the version until we tag and release a zip file. Any feedback would be appreciated. On Wed, 27 Jun 2007, Greg Johnson wrote: > 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) >> >> >> >> >> > From tjarvi at qbang.org Sun Nov 18 13:51:27 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 13:51:27 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs Message-ID: The following bugs have been closed and CVS updated as needed: CommPortIdentifier.getPortIdentifier throws NoSuchPortException http://bugzilla.qbang.org/show_bug.cgi?id=48 CommPortOwnership events not sent http://bugzilla.qbang.org/show_bug.cgi?id=83 JVM 1.6 builds http://bugzilla.qbang.org/show_bug.cgi?id=84 I'd like to give Martin Oberhuber CVS write access. He has been doing a great job of pushing safe patches into rxtx. I'll be preparing seperate patches for the changes I have and submitting them to the list. I'll need to work with George to do a couple things: 1) break the patch into smaller pieces to isolate issues for discussion. 2) work through the Line Status Register changes so it does not cause problems on other systems. George: If you could do the first one, it would be greatly appreciated. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Nov 18 15:33:36 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 15:33:36 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: Message-ID: I'm not running any tests at this point, I'm trying to apply the small safe patches and make sure everything is compiling. As mentioned at the bottom, there are 3 patches + the USB fix posted here that need more review before accepting. The following bugs have been closed and CVS updated as needed. Most of these are already in CVS. The diff will be small. configure script failed at line UTS_RELEASE megov http://bugzilla.qbang.org/show_bug.cgi?id=80 code cleanup patch (extra ';' creates bug for if statements + new String() calls removed) Xavier Le Vourch http://bugzilla.qbang.org/show_bug.cgi?id=77 Wont compile on linux ppc with glibc 2.5 - no sys/io.h Brian Johnson http://bugzilla.qbang.org/show_bug.cgi?id=72 rxtx overwrites System properties Andrew Gillett Nektarios K. Papadopoulos Neboj??a http://bugzilla.qbang.org/show_bug.cgi?id=64 Solaris ACM port support Dave Cleal http://bugzilla.qbang.org/show_bug.cgi?id=59 Setting of non-standard baud rate fails. Andrew Prunicki http://bugzilla.qbang.org/show_bug.cgi?id=58 RXTX uses lockfiles on MacOS X (instead of ioctl TIOCEXCL) Joachim Buechse http://bugzilla.qbang.org/show_bug.cgi?id=50 JavaDoc fixes Joachim Buechse http://bugzilla.qbang.org/show_bug.cgi?id=49 I need to further review the following: http://bugzilla.qbang.org/show_bug.cgi?id=53 http://bugzilla.qbang.org/show_bug.cgi?id=46 http://bugzilla.qbang.org/show_bug.cgi?id=41 On Sun, 18 Nov 2007, Trent Jarvi wrote: > > The following bugs have been closed and CVS updated as needed: > > CommPortIdentifier.getPortIdentifier throws NoSuchPortException > http://bugzilla.qbang.org/show_bug.cgi?id=48 > CommPortOwnership events not sent > http://bugzilla.qbang.org/show_bug.cgi?id=83 > JVM 1.6 builds > http://bugzilla.qbang.org/show_bug.cgi?id=84 > > I'd like to give Martin Oberhuber CVS write access. He has been doing a > great job of pushing safe patches into rxtx. > > I'll be preparing seperate patches for the changes I have and submitting > them to the list. > > I'll need to work with George to do a couple things: > > 1) break the patch into smaller pieces to isolate issues for discussion. > 2) work through the Line Status Register changes so it does not cause > problems on other systems. > > George: If you could do the first one, it would be greatly appreciated. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From netbeans at gatworks.com Sun Nov 18 16:20:02 2007 From: netbeans at gatworks.com (U. George) Date: Sun, 18 Nov 2007 18:20:02 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: Message-ID: <4740C8A2.6030908@gatworks.com> > I'll need to work with George to do a couple things: > > 1) break the patch into smaller pieces to isolate issues for discussion. > 2) work through the Line Status Register changes so it does not cause > problems on other systems. > > George: If you could do the first one, it would be greatly appreciated. there are ( probably ) 3 pieces: 1) the select() failure when the USB-serial device is unceremoniously unplugged ( causes rxtx to spin ) 2) TIOCSERGETLSR, need to have the simulation of it available for all os's . If the system has the capability, don't simulate for devices that have the capability. For devices that dont have the capability, but the OS still defines TIOCSERGETLSR, fall back to simulation. 3) I rearranged DEBUG ifdef's. This is probably the bulk of the patches. From tjarvi at qbang.org Sun Nov 18 18:26:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 18:26:26 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <4740C8A2.6030908@gatworks.com> References: <4740C8A2.6030908@gatworks.com> Message-ID: On Sun, 18 Nov 2007, U. George wrote: > >> I'll need to work with George to do a couple things: >> >> 1) break the patch into smaller pieces to isolate issues for discussion. >> 2) work through the Line Status Register changes so it does not cause >> problems on other systems. >> >> George: If you could do the first one, it would be greatly appreciated. > > there are ( probably ) 3 pieces: > 1) the select() failure when the USB-serial device is unceremoniously > unplugged ( causes rxtx to spin ) > 2) TIOCSERGETLSR, need to have the simulation of it available for all os's . > If the system has the capability, don't simulate for devices that have the > capability. For devices that dont have the capability, but the OS still > defines TIOCSERGETLSR, fall back to simulation. > 3) I rearranged DEBUG ifdef's. This is probably the bulk of the patches. > Hi George, I suspect if you do cvs update, there will be very few conflicts if any. While the list of fixes is fairly long, the changes are small. -- Trent Jarvi tjarvi at qbang.org From EdwardRF at xtremax.com Mon Nov 19 03:32:29 2007 From: EdwardRF at xtremax.com (Edward) Date: Mon, 19 Nov 2007 18:32:29 +0800 Subject: [Rxtx] Cannot Read under Windows XP Message-ID: <4741663D.4070200@xtremax.com> Hi Guys, I have a iTegno 3000 usb GSM modem, it is an usb-serial device. I am trying to use RXTX with it under Windows XP. The problem is it seems RXTX cannot read any data from it, but writing to it seems successful. I blindly issue a series of command to send off a SMS, it is successfully delivered, but neither the echo from the modem nor the "OK" response was received. I tried to connect to the modem directly using hyper terminal, there was no problem reading or writing. So can i assume it is not the driver problem? Then i turned to Serial Port Monitor for help, when I use hyper terminal, monitor shows both way traffic, and nothing abnormal, but when I connect using RXTX, only the data I sent to the modem is being detected, no input was detected. Does anyone else experience similar problem? Best Regards Edward From tjarvi at qbang.org Mon Nov 19 03:38:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Nov 2007 03:38:02 -0700 (MST) Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: <4741663D.4070200@xtremax.com> References: <4741663D.4070200@xtremax.com> Message-ID: On Mon, 19 Nov 2007, Edward wrote: > Hi Guys, > > I have a iTegno 3000 usb GSM modem, it is an usb-serial device. I am > trying to use RXTX with it under Windows XP. > The problem is it seems RXTX cannot read any data from it, but writing > to it seems successful. I blindly issue a series of command to send off > a SMS, it is successfully delivered, but neither the echo from the modem > nor the "OK" response was received. > > I tried to connect to the modem directly using hyper terminal, there was > no problem reading or writing. So can i assume it is not the driver problem? > > Then i turned to Serial Port Monitor for help, when I use hyper > terminal, monitor shows both way traffic, and nothing abnormal, but when > I connect using RXTX, only the data I sent to the modem is being > detected, no input was detected. > > Does anyone else experience similar problem? > Hi Edward, A common mistake is to send Strings to the modem which are i18n. You want to send the bytes. Examples of doing this are in the contrib directory with the sourcecode. ie SimpleSnuV1.java -- Trent Jarvi tjarvi at qbang.org From EdwardRF at xtremax.com Mon Nov 19 04:42:16 2007 From: EdwardRF at xtremax.com (Edward) Date: Mon, 19 Nov 2007 19:42:16 +0800 Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: References: <4741663D.4070200@xtremax.com> Message-ID: <47417698.3060705@xtremax.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071119/b0f08ba9/attachment-0005.html From netbeans at gatworks.com Mon Nov 19 06:31:30 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 19 Nov 2007 08:31:30 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: <4740C8A2.6030908@gatworks.com> Message-ID: <47419032.8080406@gatworks.com> Did the "make install". The install does not want to go to or use Makefiles's prefix = /usr/local/rxtx-devel Not terribly happy that it installed in /home/gat/JAVA/JDK14/j2sdk1.4.2_08/jre/lib/i386 Trent Jarvi wrote: > > I suspect if you do cvs update, there will be very few conflicts if any. > While the list of fixes is fairly long, the changes are small. > > -- > Trent Jarvi > tjarvi at qbang.org > > From Martin.Oberhuber at windriver.com Mon Nov 19 07:00:48 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 19 Nov 2007 15:00:48 +0100 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE6485848039986E6@ism-mail03.corp.ad.wrs.com> It's great to see things progressing - thanks Trent! I checked CVS, and it seems that most of the patch authors are yet missing from the AUTHORS file, is this intentional? The issues areound RXTXPort.close() are interesting for us in the context of Eclipse as well: https://bugs.eclipse.org/bugs/show_bug.cgi?id=208185#c3 I did a quick review and found some issues / comments: http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 http://bugzilla.qbang.org/show_bug.cgi?id=53#c9 Thanks for proposing CVS write access for me. I promise to use these thoughtfully, and discuss potential fixes openly (on bugzilla) before applying them [unless it's really trivial issues only like obvious Javadoc syntax or spelling errors]. Cheers, -- 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 Mon Nov 19 07:24:16 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 19 Nov 2007 15:24:16 +0100 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803998711@ism-mail03.corp.ad.wrs.com> Hi all, I think I've got a better version for RXTXCommDriver.checkSolaris(): http://bugzilla.qbang.org/show_bug.cgi?id=77#c3 Cheers, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From netbeans at gatworks.com Mon Nov 19 09:01:22 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 19 Nov 2007 11:01:22 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <47419032.8080406@gatworks.com> References: <4740C8A2.6030908@gatworks.com> <47419032.8080406@gatworks.com> Message-ID: <4741B352.8070205@gatworks.com> U. George wrote: > Did the "make install". The install does not want to go to or use > Makefiles's prefix = /usr/local/rxtx-devel > > Not terribly happy that it installed in > /home/gat/JAVA/JDK14/j2sdk1.4.2_08/jre/lib/i386 > Put libs and jar in MY preferential places. Ran application. And it loves to spin. Deja gnu all over again. :-/ It did find the avail /dev/ttyUSB0 port connected to LINUX usbserial/pl2303 device driver. Now to find the spin. and apply simpler set of patches From tjarvi at qbang.org Mon Nov 19 10:14:38 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Nov 2007 10:14:38 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <4741B352.8070205@gatworks.com> References: <4740C8A2.6030908@gatworks.com> <47419032.8080406@gatworks.com> <4741B352.8070205@gatworks.com> Message-ID: On Mon, 19 Nov 2007, U. George wrote: > U. George wrote: >> Did the "make install". The install does not want to go to or use >> Makefiles's prefix = /usr/local/rxtx-devel >> >> Not terribly happy that it installed in >> /home/gat/JAVA/JDK14/j2sdk1.4.2_08/jre/lib/i386 >> > Put libs and jar in MY preferential places. Ran application. And it loves to > spin. Deja gnu all over again. :-/ > > It did find the avail /dev/ttyUSB0 port connected to LINUX usbserial/pl2303 > device driver. > > Now to find the spin. and apply simpler set of patches > Hi George, When the prefix code was stomped on and the library was installed in the jre, It wasnt clear how the layout would end up looking. I'm still not sure. My usual attack was to dump a jdk onto the filesystem, set JAVA_HOME and install. When I was done, I would nuke the jdk. Obviously that may not be what people want but I'm not sure a prefix is enough to let us know what they do want. For a shared library prefix /usr/local means the library goes in /usr/local/lib. What would it mean for the jar and shared library in Java? -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Nov 19 10:24:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Nov 2007 10:24:08 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <460801A4097E3D4CA04CC64EE6485848039986E6@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848039986E6@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 19 Nov 2007, Oberhuber, Martin wrote: > > I checked CVS, and it seems that most of the patch > authors are yet missing from the AUTHORS file, > is this intentional? > There isn't a hard rule covering who goes into AUTHORS. If I recognize a person from previous patches, I try to make sure they are in. Everyone contributing (authors) is in the ChangeLog with what they did going all the way back to the first release. AUTHORS is more of a summary of what they did after a few submissions. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Nov 19 11:39:51 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 19 Nov 2007 13:39:51 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: <4740C8A2.6030908@gatworks.com> <47419032.8080406@gatworks.com> <4741B352.8070205@gatworks.com> Message-ID: <4741D877.80203@gatworks.com> For me, the makefile/prefix = /usr/local sorta suggest thats where the libs/bins/jars/... should eventually wind up. If a user does not like /usr/local, then a quick change would put it somewhere else. At this moment I dont care where the jar winds up ( in lib, or a jar directory ). So I like to keep the jre/sdk directory protected from meddling, and changes. But if a user has a penchant to use 'java -jar', then the RXTXcomm.jar file should be stuffed with the other jre/sdk jar files. From ajmas at sympatico.ca Mon Nov 19 11:54:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 19 Nov 2007 13:54:29 -0500 Subject: [Rxtx] CVS updates and closed bugs Message-ID: <20071119185429.SPYK18413.tomts22-srv.bellnexxia.net@smtp1.sympatico.ca> On this day in November "U. George" wrote: > > For me, the makefile/prefix = /usr/local sorta suggest thats where the > libs/bins/jars/... should eventually wind up. > If a user does not like /usr/local, then a quick change would put it > somewhere else. At this moment I dont care where the jar winds up ( in > lib, or a jar directory ). > So I like to keep the jre/sdk directory protected from meddling, and > changes. > But if a user has a penchant to use 'java -jar', then the RXTXcomm.jar > file should be stuffed with the other jre/sdk jar files. It should be noted that some platforms, such as MacOS X might have different conventions. In the case of MacOS X there are two 'correct' places for Java libraries that aren't part of an application: - /Library/Java/Extensions/ - ~/Library/Java/Extensions/ Andre From ajmas at sympatico.ca Mon Nov 19 18:15:37 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 19 Nov 2007 20:15:37 -0500 Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: <47417698.3060705@xtremax.com> References: <4741663D.4070200@xtremax.com> <47417698.3060705@xtremax.com> Message-ID: <3D24B671-06CA-4709-AE3C-BCDB542F427F@sympatico.ca> On 19-Nov-07, at 06:42 , Edward wrote: > Hi Trent, > > First of all, I did sent them as bytes, eg, > > output.write("at\r\n".getBytes()); > > And if writing is every the problem, it wouldn't be able to explain > why i could send out a sms successfully using RXTX. > If you have the section of code that does the communicating, could you share it with us? This should help us tell whether it is a coding issue or something more fundamental with RXTX. Andre From EdwardRF at xtremax.com Mon Nov 19 19:39:36 2007 From: EdwardRF at xtremax.com (EdwardRF) Date: Tue, 20 Nov 2007 10:39:36 +0800 Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: <3D24B671-06CA-4709-AE3C-BCDB542F427F@sympatico.ca> References: <4741663D.4070200@xtremax.com> <47417698.3060705@xtremax.com> <3D24B671-06CA-4709-AE3C-BCDB542F427F@sympatico.ca> Message-ID: <474248E8.7070002@xtremax.com> Hi Guys, Thanks for the help, i've finally found out the problem. It was a flow control issue, i did not set the flow control properly. Btw, what is the default flow control behavior for rxtx2.1.7? was it the same as 2.0? Because i remember i did not need to set the flow control when I use rxtx 2.0 2 years back. Best Regards Edward Andre-John Mas wrote: > > On 19-Nov-07, at 06:42 , Edward wrote: > >> Hi Trent, >> >> First of all, I did sent them as bytes, eg, >> >> output.write("at\r\n".getBytes()); >> >> And if writing is every the problem, it wouldn't be able to explain >> why i could send out a sms successfully using RXTX. >> > > If you have the section of code that does the communicating, could you > share it with us? This should help us tell whether it is a coding > issue or something more fundamental with RXTX. > > Andre > From netbeans at gatworks.com Tue Nov 20 06:23:26 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 20 Nov 2007 08:23:26 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: <4740C8A2.6030908@gatworks.com> Message-ID: <4742DFCE.5070504@gatworks.com> Here is the small subset of diffs just for TIOCSERGETLSR :) Next I'll pull out the usb device, and see if that also causes rxtx to spin. >> 2) TIOCSERGETLSR, need to have the simulation of it available for all >> os's . If the system has the capability, don't simulate for devices >> that have the capability. For devices that dont have the capability, >> but the OS still defines TIOCSERGETLSR, fall back to simulation. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: a Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20071120/2c5c8ee7/attachment-0001.pl From tjarvi at qbang.org Tue Nov 20 08:20:21 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Nov 2007 08:20:21 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <4742DFCE.5070504@gatworks.com> References: <4740C8A2.6030908@gatworks.com> <4742DFCE.5070504@gatworks.com> Message-ID: On Tue, 20 Nov 2007, U. George wrote: > Here is the small subset of diffs just for TIOCSERGETLSR :) > > Next I'll pull out the usb device, and see if that also causes rxtx to spin. > >>> 2) TIOCSERGETLSR, need to have the simulation of it available for all os's >>> . If the system has the capability, don't simulate for devices that have >>> the capability. For devices that dont have the capability, but the OS >>> still defines TIOCSERGETLSR, fall back to simulation. > Hi George, I'll be looking through this patch in detail tonight. I just wanted to make sure you are aware of this line in win32termios.h. The ifdef logic is messy as you noticed. That is combined with the later addition of support for it to windows. #define TIOCSERGETLSR 0x5459 (this is by far the strangest code in rxtx in retrospect) I'll be able to do extensive automated testing once we get to that point. I'm confident we can get something in that has a low probability of causing regressions. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Tue Nov 20 08:42:08 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 20 Nov 2007 10:42:08 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: <4740C8A2.6030908@gatworks.com> <4742DFCE.5070504@gatworks.com> Message-ID: <47430050.1010203@gatworks.com> It is of no difference. 1) If the define does not exist, then it should be as before. 2) If it does exist, then it should also be as before. 3) If it does exist, but the ioctl fails, then it will fallback as if it did not exist in the first place. Trent Jarvi wrote: > On Tue, 20 Nov 2007, U. George wrote: > >> Here is the small subset of diffs just for TIOCSERGETLSR :) >> >> Next I'll pull out the usb device, and see if that also causes rxtx to >> spin. >> >>>> 2) TIOCSERGETLSR, need to have the simulation of it available for >>>> all os's . If the system has the capability, don't simulate for >>>> devices that have the capability. For devices that dont have the >>>> capability, but the OS still defines TIOCSERGETLSR, fall back to >>>> simulation. >> > > Hi George, > > I'll be looking through this patch in detail tonight. I just wanted to > make sure you are aware of this line in win32termios.h. The ifdef logic > is messy as you noticed. That is combined with the later addition of > support for it to windows. > > #define TIOCSERGETLSR 0x5459 > > (this is by far the strangest code in rxtx in retrospect) > > I'll be able to do extensive automated testing once we get to that > point. I'm confident we can get something in that has a low probability > of causing regressions. > > -- > Trent Jarvi > tjarvi at qbang.org > > From netbeans at gatworks.com Tue Nov 20 08:36:56 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 20 Nov 2007 10:36:56 -0500 Subject: [Rxtx] Unplugged Opened USB devices In-Reply-To: <4742DFCE.5070504@gatworks.com> References: <4740C8A2.6030908@gatworks.com> <4742DFCE.5070504@gatworks.com> Message-ID: <4742FF18.3050005@gatworks.com> > Next I'll pull out the usb device, and see if that also causes rxtx to > spin. This is the error on a read. The select() should have failed, as well as the read(). java.io.IOException: Input/output error in nativeavailable at gnu.io.RXTXPort.nativeavailable(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1420) at jGPS.GpsData.DeviceDrivers.SerialPort.SerialPort_NMEA_GNU.serialEvent (SerialPort_NMEA_GNU.java:449) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:771) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1622) But for java program, it sees( when USB device is unplugged ) : 1) event: SerialPortEvent.DATA_AVAILABLE 2) read (non-existant) data. I think that its bad form to say DATA_AVAILABLE, when there is no data to be obtained. There does not seem to be an I/O error event. So basically, I think, and IMHO, that no events should be sent. Rather a thread timeout ( ie no data in X seconds ) AND recovery from user code should be instantiated. From manujnaman at yahoo.com Wed Nov 21 12:35:46 2007 From: manujnaman at yahoo.com (manuj naman) Date: Wed, 21 Nov 2007 11:35:46 -0800 (PST) Subject: [Rxtx] Problem reading 1-wire device using RXTX on Linux Message-ID: <371969.66249.qm@web37911.mail.mud.yahoo.com> Hello, I am trying to use the RXTX library on Ubuntu (Debian) linux to read iButtons. It works perfectly on Windows. However on my linux machines it gives the following errors. I am using DS9490 (USB port adapter) to read the iButtons. I have followed your instructions on the Wiki. I recompiled the rxtx library to produce the .so and .jar files. But still it gives me this: manujnaman at sensor:~/iButton/onewireviewer$ java -cp $CLASSPATH:./OneWireAPI.jar:./OneWireViewer.jar OneWireViewer Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Warning: serial communications API not setup properly, no ports in enumeration Pure-Java DS9097U adapter will not work, not added to adapter enum Standard drivers for 1-Wire are not found. Please download the latest drivers from http://www.ibutton.com Or install RXTX Serial Communications API from http://www.rxtx.org Do you know how to solve the "Serial communications API not setup properly, no ports in enumeration" problem? Also, how to detect which what /dev/* is the port to be used? On Windows this is simply USB1, on linux this is a bit unclear. Many thanks for your advice, Manuj Naman Dallas, TX, US manujnaman at yahoo.com --------------------------------- Be a better pen pal. Text or chat with friends inside Yahoo! Mail. See how. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071121/2760f691/attachment-0001.html From Martin.Oberhuber at windriver.com Wed Nov 21 13:55:25 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 21 Nov 2007 21:55:25 +0100 Subject: [Rxtx] Should RXTX Lixense link to LGPL-2.1 be changed? In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803A21160@ism-mail03.corp.ad.wrs.com> Hi Trent and all, In all the RXTX source files as well as http://users.frii.com/jarvi/rxtx/license.html there is the following lines: | A copy of the LGPL v 2.1 may be found at | http://www.gnu.org/licenses/lgpl.txt on March 4th 2007. A copy is | here for your convenience. But, as of today, at the link provided there is only a copy of the LGPL v3.0. I think there should be a link to the LGPL v2.1, e.g. http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html What do you think? Cheers, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Nov 21 20:46:18 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Nov 2007 20:46:18 -0700 (MST) Subject: [Rxtx] Problem reading 1-wire device using RXTX on Linux In-Reply-To: <371969.66249.qm@web37911.mail.mud.yahoo.com> References: <371969.66249.qm@web37911.mail.mud.yahoo.com> Message-ID: On Wed, 21 Nov 2007, manuj naman wrote: > Hello, > > I am trying to use the RXTX library on Ubuntu (Debian) linux to read iButtons. It works perfectly on Windows. However on my linux machines it gives the following errors. I am using DS9490 (USB port adapter) to read the iButtons. > > I have followed your instructions on the Wiki. I recompiled the rxtx library to produce the .so and .jar files. But still it gives me this: > > manujnaman at sensor:~/iButton/onewireviewer$ java -cp $CLASSPATH:./OneWireAPI.jar:./OneWireViewer.jar OneWireViewer > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > Warning: serial communications API not setup properly, no ports in enumeration > Pure-Java DS9097U adapter will not work, not added to adapter enum > > Standard drivers for 1-Wire are not found. > Please download the latest drivers from http://www.ibutton.com > Or install RXTX Serial Communications API from http://www.rxtx.org > > Do you know how to solve the "Serial communications API not setup properly, no ports in enumeration" problem? > > Also, how to detect which what /dev/* is the port to be used? On Windows this is simply USB1, on linux this is a bit unclear. Hi Manuj What is the output of the following? dmesg |grep tty touch /var/lock/test.lock && rm -f /var/lock/test.lock If you see something like /dev/ttyUSB0 in the dmesg output, what happens if you do something like tail -f /dev/ttyUSB0? These test each of the usual suspects. We are looking for missing USB drivers, no permission to create a lockfile and no read permission for the device. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Nov 21 21:05:23 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Nov 2007 21:05:23 -0700 (MST) Subject: [Rxtx] Should RXTX Lixense link to LGPL-2.1 be changed? In-Reply-To: <460801A4097E3D4CA04CC64EE648584803A21160@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803A21160@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 21 Nov 2007, Oberhuber, Martin wrote: > Hi Trent and all, > > In all the RXTX source files as well as > http://users.frii.com/jarvi/rxtx/license.html > there is the following lines: > > | A copy of the LGPL v 2.1 may be found at > | http://www.gnu.org/licenses/lgpl.txt on March 4th 2007. A copy is > | here for your convenience. > > But, as of today, at the link provided there is only > a copy of the LGPL v3.0. I think there should be a link > to the LGPL v2.1, e.g. > http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html > > What do you think? > Hi Martin, Thanks. I updated the link. Changing licences is a heavy process for me as a free software developer and an employee so I'd rather stay with 2.1 unless the current license becomes a show stopper. I figured that would happen someday so I put the date in to be clear. -- Trent Jarvi tjarvi at qbang.org From keithvz at verizon.net Thu Nov 1 08:08:58 2007 From: keithvz at verizon.net (Keith) Date: Thu, 01 Nov 2007 10:08:58 -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: <4729DDFA.7080206@verizon.net> Trent Jarvi wrote: > 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? Well, I honestly don't know how all this fits together. I think it's just a matter of enabling the right flow control option within the standard serial framework to tell the device driver, "HEY START USING DTR/DSR FOR FLOW CONTROL." If what UGeorge said,(about that type of nitty-gritty lead control being done within the device driver), is true, then this confirms my suspicion. I tried narrowing down within the Linux drivers what you are looking for, but I can't entirely tell wth I'm looking at. (virtual com port drivers -- they are included compiled by default with Ubuntu, source included) http://www.ftdichip.com/Drivers/VCP/Linux/ftdi_sio.tar.gz Hahahaa, they make a reference to DTR flow control being supported but say (UGH) in parenthesis. You can also use their direct device driver library on Ubuntu -- libftd2xx.so.0.4.13. No source code. http://www.ftdichip.com/Drivers/D2XX/Linux/libftd2xx0.4.13.tar.gz In that case, you make a call to their FT_SetFlowControl() function. FT_STATUS FT_SetFlowControl (FT_HANDLE ftHandle, USHORT usFlowControl, UCHAR uXon,UCHAR uXoff) Parameters ftHandle Handle of the device. usFlowControl Must be one of FT_FLOW_NONE, FT_FLOW_RTS_CTS, ****FT_FLOW_DTR_DSR**** or FT_FLOW_XON_XOFF. uXon Character used to signal Xon. Only used if flow control is FT_FLOW_XON_XOFF. uXoff Character used to signal Xoff. Only used if flow control is FT_FLOW_XON_XOFF. This is from their programming guide http://www.ftdichip.com/Documents/ProgramGuides/D2XXPG34.pdf I actually want to take this a step further and say that I think the flow control is actually handled right on the device itself in hardware/firmware. It's enabled through the device driver, but I think the maintaining of buffers, asserting/deasserting of leads, etc is handled by the device. For the time being, I've switched to jd2xx, https://jd2xx.dev.java.net/ and http://bleyer.org/jd2xx/ These are Java wrappers for the device driver libraries. It allows almost direct access to the well-documented device drivers from Java. I hope this helps Keith From tjarvi at qbang.org Thu Nov 1 11:09:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:09:51 -0600 (MDT) 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: Hi Martin, What I usually have done is allow changes that do not impact working software including changes to methods not documented in CommAPI (which remain undocumented in rxtx) and fixes to known problems in the documented portions. That way if you use the documented API, the releases should only become better with time. If you use the undocumented portions, the behavior is not as predictable but open for improvement. On Wed, 31 Oct 2007, 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 >> > From tjarvi at qbang.org Thu Nov 1 11:15:52 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:15:52 -0600 (MDT) 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: I too use rxtx in commercial products. The problem I've been trying to address while bringing the server back was how to make it possible for hobby folks to build the same software as companies so we can move rxtx along a little faster. Exposing internal tools is not an option at this time, the public rxtx builds have been done on my home machine which has drives hanging out of it all over the place dying one at a time. This isn't maintainable. I'm currently looking at the possibility of making an S3 image available on Amazon's EC. These are machines you can rent for ~10 cents an hour which is more than enough to build rxtx. The S3 image is not changed when people use it so everyone has the same starting point. With this, we could all build rxtx for ~20 platforms for a small price and eliminate tool issues. On Wed, 31 Oct 2007, Greg Johnson wrote: > 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 tjarvi at qbang.org Thu Nov 1 11:19:55 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:19:55 -0600 (MDT) 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: On Wed, 31 Oct 2007, 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. I was helping Dmitry do the Mac OS X port without access to a machine when we put that in. In the archives there is information (easily found with google on Apple's site) that describes how their API (and others) can determine if a port is used and ignore it. I think these changes are in CVS but need to confirm. The bottom line is that rxtx should not have used lock files on Mac. It was just ignorance of the system on my part. -- Trent Jarvi tjarvi at qbang.org From fabioanjos at gmail.com Thu Nov 1 12:35:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Thu, 1 Nov 2007 15:35:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Hi, I was using SerialEventListener in my project. But, as was said here, id doesnt work very well with virtual serial ports. So, I changed the strategy using the code posted here in this thread: try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > 0) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } The thing is that in my tests I could notice that in.read(buffer) never blocks. Even when there's nothing to read. Instead of blocking when there's nothing to read it returns 0. So, my questions are: 1. Am I doing something wrong? 2. If not, wouldnt this decrease performance? (the thread would be locked in a loop that does nothing.) 3. Is there a better way to do the job? Thanks in advance!! F?bio -------- On 10/31/07, Andre-John Mas wrote: > > > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/0aee59d0/attachment-0023.html From ajmas at sympatico.ca Thu Nov 1 16:07:55 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Nov 2007 18:07:55 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Message-ID: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From sarah_662005 at yahoo.com Thu Nov 1 17:10:05 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Thu, 1 Nov 2007 16:10:05 -0700 (PDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Message-ID: <351433.37166.qm@web55814.mail.re3.yahoo.com> Thank you very much for your help. Now the application works fine. the serialEvent gets triggered. Rxtx is cool! ----- Original Message ---- From: Andre-John Mas To: Sara Hugh ; RXTX Developers and Users Sent: Wednesday, October 31, 2007 9:55:45 AM Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered 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 __________________________________________________ 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/20071101/4a86bea6/attachment-0023.html From tjarvi at qbang.org Thu Nov 1 17:58:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 17:58:02 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx Message-ID: The rxtx.org site is primarily interested in the hobby aspects of rxtx. Obviously, there are some companies following the work too. These interests bring larger workflows and concerns about details hobby folks may not care about. They also bring many more users. I know the company I work for has a quality engineering effort going on which includes rxtx. While the server was down, I was contacted by another company that was missing the binaries for their testing. Several people have mentioned concerns about a stable release for like reasons. Would there be interest on the quality side of the coin to get together? It could be just sharing email's with each other or a seperate list for QE/QA. I can not say for sure, but we may be able to share some of our efforts/results that could help keep rxtx releases stable. -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Fri Nov 2 01:42:55 2007 From: scldad at sdc.com.au (Stephen Davies) Date: Fri, 2 Nov 2007 18:12:55 +1030 Subject: [Rxtx] Multiple modems Message-ID: <200711021812.56047.scldad@sdc.com.au> This may or may not be related to the Multiple Ports thread. I have an application which uses rxtx on Linux (via cron jobs) to connect multiple modems to remote sensing devices. The application works fine most of the time but occasionally fails to connect if two (or more) connection attempts happen at about the same time. When it fails, it looks as if it may get confused as to which port it is talking to. The app has a "base" component that looks for an available port, opens it and then creates an input thread and an output thread for the connection and data transfer. The "base" component uses this code: // loop round all known ports until one is available. Give up after three minutes Counter ptimeout = new Counter(); while(!portFound && ptimeout.elapsed() < 180000) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // special case. ttyS0 is not available to us on this server. if (!portId.isCurrentlyOwned() && !portId.getName().equals("/dev/ttyS0")) { gLog.debug(lognm + ": Found port " + portId.getName()); try { serialPort = (RXTXPort) portId.open("AguaModem", 10000); } catch (Exception e) { gLog.error(lognm + ": Port " + portId.getName() + " will not open."); gLog.error(e.getMessage()); continue; } AguaModem aguamodem = new AguaModem(); portFound = true; break; } gLog.debug(lognm + ": Port " + portId.getName() + " is busy"); } } } I am wondering about the isCurrentlyOwned method. Does this actually tell me whether a port is currently being used by another process? TIA, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From fabioanjos at gmail.com Fri Nov 2 04:59:58 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 07:59:58 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Message-ID: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/9009eb1d/attachment-0023.html From netbeans at gatworks.com Fri Nov 2 06:28:13 2007 From: netbeans at gatworks.com (U. George) Date: Fri, 02 Nov 2007 08:28:13 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <472B17DD.1050508@gatworks.com> It should normally block ( unless eof / event ) . so its a :{ whats the device ( to recreate if possible ) and how do u open. > My question is, is there a way to make in.read block the thead until > there's something to read? > From fabioanjos at gmail.com Fri Nov 2 06:34:46 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 09:34:46 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > On 11/1/07, Andre-John Mas wrote: > > > > Fabio, > > > > Turns out there was a small error in my example. The test should be: > > > > (numBytes = in.read(buffer)) > -1 > > > > This is because -1 indicates an end of file (end of data stream) > > > > Andre > > > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > > > Hi, > > > > > > I was using SerialEventListener in my project. But, as was said > > > here, id doesnt work very well with virtual serial ports. > > > So, I changed the strategy using the code posted here in this thread: > > > > > > try{ > > > in = port.getInputStream(); > > > out = port.getOutputStream(); > > > int numBytes = 0; > > > while(active){ > > > > > > byte[] buffer = new byte[10]; > > > > > > while ( (numBytes = in.read(buffer)) > 0) > > > { > > > String dataValue = new String(buffer,0,numBytes); > > > processInput(dataValue); > > > } > > > > > > if(numBytes==-1){ > > > break; > > > } > > > > > > Thread.sleep(50); > > > } > > > > > > }catch(IOException e){ > > > logger.info("falha de comunicacao "+ > > > getReceptor().getPort() ); > > > > > > }catch(InterruptedException e){ > > > logger.info ("Interrompendo leitura da porta "+ > > > getReceptor().getPort() ); > > > } > > > > > > The thing is that in my tests I could notice that in.read(buffer) > > > never blocks. Even when there's nothing to read. Instead of blocking > > > when there's nothing to read it returns 0. > > > > > > So, my questions are: > > > > > > 1. Am I doing something wrong? > > > 2. If not, wouldnt this decrease performance? (the thread would be > > > locked in a loop that does nothing.) > > > 3. Is there a better way to do the job? > > > > > > Thanks in advance!! > > > > > > F?bio > > > -------- > > > > > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > > 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 > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > > > > > -- > > > Atenciosamente, > > > F?bio Cristiano dos Anjos > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/5306c4b1/attachment-0023.html From nick.circelli at infrasafe.com Fri Nov 2 07:01:17 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Fri, 2 Nov 2007 08:01:17 -0500 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com><29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com><90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca><29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Message-ID: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> I'm pretty sure that not blocking has to do with you virtual ports. Cause it should block. Maybe you should try: while ((numBytes = in.available()) > 0) { If (numBytes > buffer.length) { numBytes = buffer.length; // in case you have buffer overflow } numBytes = in.read(buffer, 0 , numBytes)); String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } Also, just for optimization, I'd move that byte[] buffer = new byte[10]; out of the while since you don't need to reallocate it every iteration. ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of F?bio Cristiano dos Anjos Sent: Friday, November 02, 2007 8:35 AM To: RXTX Developers and Users Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream (); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas < ajmas at sympatico.ca > wrote: Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info ("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Atenciosamente, F?bio Cristiano dos Anjos -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/4de7f6a3/attachment-0023.html From fabioanjos at gmail.com Fri Nov 2 07:36:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 10:36:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> Message-ID: <29788b250711020636q1588c88fgaa5e27f5504164fb@mail.gmail.com> Hi Nick, Actually, it doesnt block for physical ports too. And, the method avaiable does not block either, so when there's nothing avaiable the loop ends and the thread stops lintening to the port. But I did some more test with serialEventListener, and now its working. I realy dont know what I've done to get it working. I just start woking as soon as I decided to test it again. It was said here that serialEventListener is not reliable for virtual serial ports. Is there another way to read it, without compromising performance? Tanks again!! F?bio ------- On 11/2/07, Nick Circelli wrote: > > I'm pretty sure that not blocking has to do with you virtual ports. > Cause it should block. > > Maybe you should try: > > > > while ((numBytes = in.available()) > 0) > > { > > If (numBytes > buffer.length) { > > numBytes = buffer.length; // in case you have buffer overflow > > } > > numBytes = in.read(buffer, 0 , numBytes)); > > String dataValue = new String(buffer,0,numBytes,"ASCII"); > > processInput(dataValue); > > } > > > > Also, just for optimization, I'd move that byte[] buffer = new > byte[10]; > > out of the while since you don't need to reallocate it every iteration. > > > ------------------------------ > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On Behalf > Of *F?bio Cristiano dos Anjos > *Sent:* Friday, November 02, 2007 8:35 AM > *To:* RXTX Developers and Users > *Subject:* Re: [Rxtx] serialEvent(SerialPortEvent event) never be > triggered > > > > Hi, > > I think i missunderstand something here. > The code you post here was meant to be used inside serialEvent method, > right? > > The think is, that i cannot user SerialEventListener to read serial ports, > because i need to read virual serial ports and id does not behaves well, as > said here before. serialEvent is never triggered. > > So what I quit using SerialEventListener and created a thread to listen to > the port: > > public void run(){ > try{ > in = port.getInputStream(); > out = port.getOutputStream (); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new > String(buffer,0,numBytes,"ASCII"); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ getReceptor().getPort() > ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > } > > > So, the problem is that in.read(buffer) always returns 0 when there is > nothing to read, instead of blocking the flow, and the thread becames locked > in the loop. > > I hope you can help me solve this. > > Thanks in advance! > > F?bio > -------- > > On 11/2/07, *F?bio Cristiano dos Anjos* wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > > > On 11/1/07, *Andre-John Mas* < ajmas at sympatico.ca> wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info ("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/571df6ea/attachment-0022.html From tjarvi at qbang.org Fri Nov 2 08:32:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Nov 2007 08:32:15 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: References: Message-ID: On Fri, 2 Nov 2007, Greg Johnson wrote: > Hi Trent, folks, > Having a single rxtx that is suitable for commercial uses and hobbyists both > would be a great idea? Perhaps it would be worth submitting rxtx as a > proposal to Codehaus - they not only provide excellent tools (Jira (bug > tracker), Confluence (wiki)) but also support build management ( > maestro, continuum, bamboo). Relying on your personal machine (btw, frii.com > / rxtx.org is down again?) seems like a burden you shouldn't have to shoulder > alone. Hi Greg, There may be a little confusion here. There is no need to have two seperate rxtx releases. What I'm trying to encourage is a discussion between some of the people responsible for making sure rxtx does not break their products each release. Usually these people are interested in testing a set of functionality their product depends upon. They do not work with rxtx code but rather traps to catch when rxtx developers break something. This goes on all the time in isolated labs. There are many services that offer to do various pieces of a project for you if you... Anyone is free to do the 'if you' portion with rxtx and see how it goes. I'm actually interested in doing less of that than more. The rxtx.org work I do just happens to overlap with other things I do for personal/family use. The reason I suggest the amazon solution is that anyone can take full control of the environment for a day and it costs less than a package of gum without causing harm to what anyone else is doing. I assume the down question was with respect to a mod_security setting that has been resolved. If not, please post a url to the problem. -- Trent Jarvi tjarvi at qbang.org From nsayer at kfu.com Sat Nov 3 20:17:49 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 19:17:49 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? Message-ID: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Has anyone got RXTX working with an app under Leopard? My app hangs on port open (it works fine with Tiger). The relevant thread looks like this in the activity monitor: 1536 JVM_InvokeMethod 1536 0x48ccd0 1536 0x46f8a0 1536 0x4c3ff4 1536 0x4c4284 1536 0x357d160 1536 0x357faac 1536 Java_gnu_io_RXTXPort_open 1536 open $NOCANCEL$UNIX2003 1536 open $NOCANCEL$UNIX2003 From ajmas at sympatico.ca Sat Nov 3 22:02:04 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 00:02:04 -0400 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> RXTX works for me with Leopard. I am currently using it communicate with a Bluetooth GPS. What computer and device are you trying to use? Is the driver for your serial device compatible with MacOS X 10.5? Andre On 3-Nov-07, at 22:17 , Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From nsayer at kfu.com Sat Nov 3 22:17:47 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 21:17:47 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> Message-ID: <1720F723-3643-438C-B3AB-E09A67536977@kfu.com> On Nov 3, 2007, at 9:02 PM, Andre-John Mas wrote: > RXTX works for me with Leopard. I am currently using it communicate > with a Bluetooth GPS. > > What computer and device are you trying to use? Is the driver for > your serial device compatible with MacOS X 10.5? An Intel mac mini The FTDI USB serial driver an XMPCR, which is just a fancy serial controlled radio and an FTDI usb-to-serial chip I've successfully used the FTDI driver with another FTDI device in another context. > > > Andre > > On 3-Nov-07, at 22:17 , Nick Sayer wrote: > >> Has anyone got RXTX working with an app under Leopard? >> >> My app hangs on port open (it works fine with Tiger). The relevant >> thread looks like this in the activity monitor: >> >> 1536 JVM_InvokeMethod >> 1536 0x48ccd0 >> 1536 0x46f8a0 >> 1536 0x4c3ff4 >> 1536 0x4c4284 >> 1536 0x357d160 >> 1536 0x357faac >> 1536 >> Java_gnu_io_RXTXPort_open >> 1536 open >> $NOCANCEL$UNIX2003 >> 1536 open >> $NOCANCEL$UNIX2003 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From racecar at gmail.com Sat Nov 3 22:25:53 2007 From: racecar at gmail.com (Kevin Mateo Lim) Date: Sat, 3 Nov 2007 21:25:53 -0700 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: Message-ID: I am alternating between two errors. After i run the macosx_setup.command, "everyone" is set to Read only in /var/lock. I notice in the terminal that the group for these perms is _uucp, not uucp. In that state, I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 check_group_uucp(): error testing lock file creation Error details:Permission deniedcheck_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException : Error inside Serial.() at processing.serial.Serial.errorMessage(Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.( Serial.java:102) at Temporary_829_3245.setup(Temporary_829_3245.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java :690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) Then, I hand edit the "everyone" permissions for /var/lock/ to Read and Write (note /var/spool/uucp is Read/Write in all cases, and doesn't change). I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX uucp_lock() /var/lock/LK.003.009.000 is there gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException: Error inside Serial.() at processing.serial.Serial.errorMessage (Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.(Serial.java:102) at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java:690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) See here: http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071103/f1a2c467/attachment-0021.html From greg.johnson at manchester.ac.uk Sun Nov 4 02:31:13 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sun, 4 Nov 2007 10:31:13 +0100 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <28B5E0A0-0802-4C74-AC21-87ED35F3B9A2@manchester.ac.uk> Hi Nick, I also had problems initially with Leopard, but it was resolved by reinstalling the serial USB driver (FTDI in my case). The symptoms were a non-detection of any ports (but I twigged when I tried ZTerm and it had the same problem). Good luck! Cheers, greg PS I did a "Archive and install" which may be the reason my FTDI driver had disappeared - I don't think the driver has changed for 10.5 ------------------------------------------------------------------------- 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 4 Nov 2007, at 03:17, Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Sun Nov 4 13:01:12 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 15:01:12 -0500 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: Message-ID: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Hi, You will need to get the 2.1-8 code from CVS. See the FAQ for more information: http://rxtx.qbang.org/wiki/index.php/FAQ Andre On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > I am alternating between two errors. > > After i run the macosx_setup.command, "everyone" is set to Read only > in /var/lock. I notice in the terminal that the group for these > perms is _uucp, not uucp. > > In that state, I get this error: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > check_group_uucp(): error testing lock file creation Error > details:Permission deniedcheck_lock_status: No permission to create > lock file. > please see: How can I use Lock Files with rxtx? in INSTALL > gnu.io.PortInUseException: Unknown Application > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > java.lang.RuntimeException : Error inside Serial.() > > at processing.serial.Serial.errorMessage(Serial.java:583) > > at processing.serial.Serial.(Serial.java:148) > > at processing.serial.Serial.( Serial.java:102) > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > at processing.core.PApplet.run(PApplet.java:1556) > > at java.lang.Thread.run(Thread.java:613) > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > and Write (note /var/spool/uucp is Read/Write in all cases, and > doesn't change). I get this error: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > gnu.io.PortInUseException: Unknown Application > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > java.lang.RuntimeException: Error inside Serial.() > > at processing.serial.Serial.errorMessage (Serial.java:583) > > at processing.serial.Serial.(Serial.java:148) > > at processing.serial.Serial.(Serial.java:102) > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > at processing.core.PApplet.run(PApplet.java:1556) > > at java.lang.Thread.run(Thread.java:613) > > See here: > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From netbeans at gatworks.com Sun Nov 4 14:33:35 2007 From: netbeans at gatworks.com (U. George) Date: Sun, 04 Nov 2007 16:33:35 -0500 Subject: [Rxtx] #ifndef TIOCSERGETLSR Message-ID: <472E3AAF.7050709@gatworks.com> For Linux, it seems that you need the code for both *having* a TIOCSERGETLSR, and *not having* a TIOCSERGETLSR. Maybe the ioctl exists system wide, but not necessarily for the device driver itself ( always returns -1 ) . Are there systems that have a *functioning* TIOCSERGETLSR for all their devices? Then this would be the case where the "#ifndef TIOCSERGETLSR" directive could be useful is eliminating the unnecessary code and tests. And for those systems that dont have a TIOCSERGETLSR, then the code for TIOCSERGETLSR can be eliminated. It would be a simple case to have, as a foundation, all the code to simulate the missing TIOCSERGETLSR ioctl. If the system does have the ioctl, then that code can be ifdef'd in, and co-exist with the functionality of the code that simulates the missing TIOCSERGETLSR ioctl. From racecar at gmail.com Sun Nov 4 17:30:19 2007 From: racecar at gmail.com (Kevin Mateo Lim) Date: Sun, 4 Nov 2007 17:30:19 -0700 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: the README.OSX reads: Put libSerial.jnilib in the directory of the application (the JavaVM will find it there). Add RXTXComm.jar to the application classpath or include the classes in the application jar. (Some applications already include the RXTX classes in their application jar, in which case only the file libSerial.jnilib is required). I can't find libSerial.jnilib I put librxtxSerial.jnilib into my Processing /libraries/serial/library/ directory. Yet it still sees the old version: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 On 11/4/07, Andre-John Mas wrote: > > Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > 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/20071104/c0a83f91/attachment-0020.html From ajmas at sympatico.ca Sun Nov 4 17:41:47 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 19:41:47 -0500 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> If you are wanting it to be available for all applications, - for all users: /Library/Java/Extensions - for your user: ~/Library/Java/Extensions Or just for your application, then it should be in the same directory from which yo are launching your application. If you are getting the 2.1-8 source, then the library built is called: librxtxSerial.jnilib despite what the docs say. Andre On 4-Nov-07, at 19:30 , Kevin Mateo Lim wrote: > > the README.OSX reads: > Put > libSerial.jnilib > in the directory of the application (the JavaVM will find it there). > Add > RXTXComm.jar > to the application classpath or include the classes in the > application jar. > (Some applications already include the RXTX classes in their > application jar, > in which case only the file libSerial.jnilib is required). > > > I can't find libSerial.jnilib > I put librxtxSerial.jnilib into my Processing /libraries/serial/ > library/ directory. > > Yet it still sees the old version: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > On 11/4/07, Andre-John Mas wrote: Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial .(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay (PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > From bschlining at gmail.com Sun Nov 4 19:46:23 2007 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 4 Nov 2007 18:46:23 -0800 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> Message-ID: > > Or just for your application, then it should be in the same directory > from which yo are launching your application. Just wanted to add one more way of specifying the native lib location... If you don't want to define it globally by putting it in /Library/Java/Extensions (and you don't, it's a very very bad practice) you can also specify the location of the native library when starting the JVM by specifying the 'java.library.path' property. For example: java -Djava.library.path=/Path/To/Directory/With/RXTX/Library YourMainClass -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071104/c5af6980/attachment-0020.html From greg.johnson at manchester.ac.uk Mon Nov 5 01:39:02 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Mon, 5 Nov 2007 09:39:02 +0100 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: The 2.1-8 code reports 2.1-7, hence your (and my) confusion. But as long as you've removed all traces of the old library, it really _is_ 2.1-8. And if you specify the library path to the VM, don't make my mistake (on OSX at least) - you need to respecify the entire library path it had by default, as the command line argument replaces the path, rather than appending to it. 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 5 Nov 2007, at 01:30, Kevin Mateo Lim wrote: > > the README.OSX reads: > Put > libSerial.jnilib > in the directory of the application (the JavaVM will find it there). > Add > RXTXComm.jar > to the application classpath or include the classes in the > application jar. > (Some applications already include the RXTX classes in their > application jar, > in which case only the file libSerial.jnilib is required). > > > I can't find libSerial.jnilib > I put librxtxSerial.jnilib into my Processing /libraries/serial/ > library/ directory. > > Yet it still sees the old version: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > On 11/4/07, Andre-John Mas wrote: > Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial .(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay (PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > 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 HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071105/7f50506d/attachment-0020.html From cyrille.dumont at tatexpress.fr Mon Nov 5 05:46:03 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 05 Nov 2007 13:46:03 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: References: <472727F1.1000704@tatexpress.fr> Message-ID: <472F108B.2090101@tatexpress.fr> Thanks a lot for your solution ... but I'm not a expert in JAVA ... (sorry) For the moment I've this function : """ public void serialEvent(SerialPortEvent e) { StringBuffer inputBuffer = new StringBuffer(); int newData = 0; switch (e.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } //-- Manag. Data from Scanner this.MngDataScanner(inputBuffer.toString()); break; case SerialPortEvent.BI:; //-- Break Received } } """ How can I do what you write ? ( maybe a simple ex ? ) PS : I don't know the PDF417 size (could be, for example, 338 char, or 500 ... ; what I know is that it can't be more than 800 char) Thanks in advance. Best regards. Trent Jarvi a ?crit : > 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 Martin.Oberhuber at windriver.com Mon Nov 5 08:47:50 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 5 Nov 2007 16:47:50 +0100 Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> Hi Trent, are the interestes of hobbyists really so different from commercial ones? Both should be interested in high quality and innovation the like. I haven't seen too many Open Source projects from the "inside" but those that I have seen did not have separate mailing lists for quality/testing/qa versus innovation/development. What I have seen with the Open Source projects that one would call "successful" is a good deal of process around automated builds, automated unit tests, predictable release dates and milestones, and policies around commiting/contributing/reviewing changes. I think that all of these benefit commercial users and hobbyists the like. If you were just asking about who's interested in discussing changes to foster more quality, count me in. I'm just not sure whether discussing these on a separate mailing list or other channel is the right thing to do. Cheers, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From toupsz at cs.tamu.edu Tue Nov 6 14:27:04 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 15:27:04 -0600 Subject: [Rxtx] reading TTL level signals from serial? Message-ID: Dear RXTX community- I've been using RXTX to handle communicating with several hardware devices in Java (a GPS and some custom audio circuitry for my dissertation work). I have a new, high-accuracy GPS which only communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there any way to communicate with this device using RXTX, perhaps by modding the native code for Windows? If so, does anyone have any tips on how to do it? Has it perhaps already been done? Another option is for me to invert / amplify the signal in hardware, but this is difficult for me to pull off due to the sensitivity of the electronics involved...I'll likely end up using a much less accurate piece of equipment rather than go that far! If anyone could help out, I'd really appreciate it! Thanks! -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/b6c59c2b/attachment-0018.html From netbeans at gatworks.com Tue Nov 6 14:55:22 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 06 Nov 2007 16:55:22 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: Message-ID: <4730E2CA.3090009@gatworks.com> This is really a hardware issue. Is there any device ( ie the serial port ) on your computer that will accept the voltage signals ( and load ) that your device produces? Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it happen safely ( ie u dont cook the GPS device ) I have a new, high-accuracy GPS which only > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there > any way to communicate with this device using RXTX, From toupsz at cs.tamu.edu Tue Nov 6 15:14:01 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 16:14:01 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4730E2CA.3090009@gatworks.com> References: <4730E2CA.3090009@gatworks.com> Message-ID: Actually, the device runs over USB, but shows up as a virtual serial port and is outputting these signals. The software that comes with the device (a u-blox ANTARIS 4 eval kit) is able to communicate. RXTX is able to detect and properly configure the port, but does not get any of the data from it. :-/ It seems like there must be some way to do it (obviously, ublox knows how)... -Zach On Nov 6, 2007 3:55 PM, U. George wrote: > This is really a hardware issue. > Is there any device ( ie the serial port ) on your computer that will > accept the voltage signals ( and load ) that your device produces? > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it > happen safely ( ie u dont cook the GPS device ) > > > I have a new, high-accuracy GPS which only > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there > > any way to communicate with this device using RXTX, > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/15ae7a0b/attachment-0018.html From keithvz at verizon.net Tue Nov 6 16:16:55 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 06 Nov 2007 18:16:55 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> Message-ID: <4730F5E7.1030704@verizon.net> Zach Toups wrote: > On Nov 6, 2007 3:55 PM, U. George > wrote: > > This is really a hardware issue. > Is there any device ( ie the serial port ) on your computer that will > accept the voltage signals ( and load ) that your device produces? > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it > happen safely ( ie u dont cook the GPS device ) > > > I have a new, high-accuracy GPS which only > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is > there > > any way to communicate with this device using RXTX, > _______________________________________________ As UGeorge intimated, it's a hardware issue. If your device outputs TTL level voltages, and your USB to serial converter is RS-232, then you've got a physical hardware differences. Inverted leads and voltage issues are mainly the problem. MAXIM makes a neat little chip called the MAX233 (better than the 232, no extern caps required) You can't solve this in software. Now, there are TTL level compatible USB to serial converters available, I happen to be using one right now. This unit below is from a UK company (there might be sources in the US) http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm Parallax makes one that does 3.3 and 5v http://www.parallax.com/detail.asp?product_id=32201 (but only supports RX, TX, GND, AND DTR towards device) (i've tested a variant of the unit above, and it works with RXTX) In both cases, you'll need some creative wiring depending on the interface on your GPS. Hope this helps Keith From toupsz at cs.tamu.edu Tue Nov 6 16:53:01 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 17:53:01 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4730F5E7.1030704@verizon.net> References: <4730E2CA.3090009@gatworks.com> <4730F5E7.1030704@verizon.net> Message-ID: Yeah...I used an FTDI chip to handle USB/serial conversion on the audio equipment I built. I'm leery of trying to build a board for this ublox GPS due to all the grounding/shielding issues around it. Anyway, I apreciate the help...just sad that I can't handle the problem in software! Ublox did send me the source code for their USB drivers...but as a Java programmer, it's a bit tough for me to sort out. ;) Thanks again! -Zach On Nov 6, 2007 5:16 PM, Keith Monahan wrote: > Zach Toups wrote: > > > On Nov 6, 2007 3:55 PM, U. George > > wrote: > > > > This is really a hardware issue. > > Is there any device ( ie the serial port ) on your computer that > will > > accept the voltage signals ( and load ) that your device produces? > > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make > it > > happen safely ( ie u dont cook the GPS device ) > > > > > > I have a new, high-accuracy GPS which only > > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is > > there > > > any way to communicate with this device using RXTX, > > _______________________________________________ > > As UGeorge intimated, it's a hardware issue. > > If your device outputs TTL level voltages, and your USB to serial > converter is RS-232, then you've got a physical hardware differences. > Inverted leads and voltage issues are mainly the problem. MAXIM makes a > neat little chip called the MAX233 (better than the 232, no extern caps > required) > > You can't solve this in software. > > Now, there are TTL level compatible USB to serial converters available, > I happen to be using one right now. > > This unit below is from a UK company (there might be sources in the US) > > http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm > > Parallax makes one that does 3.3 and 5v > > http://www.parallax.com/detail.asp?product_id=32201 > (but only supports RX, TX, GND, AND DTR towards device) > > (i've tested a variant of the unit above, and it works with RXTX) > > In both cases, you'll need some creative wiring depending on the > interface on your GPS. > > Hope this helps > > Keith > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/06e88ad4/attachment-0018.html From netbeans at gatworks.com Tue Nov 6 17:14:01 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 06 Nov 2007 19:14:01 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> <4730F5E7.1030704@verizon.net> Message-ID: <47310349.5000406@gatworks.com> what gps chipset do u have? > Ublox did send me the source code for their USB drivers...but as a Java > programmer, it's a bit tough for me to sort out. ;) From Steffen.DETTMER at ingenico.com Wed Nov 7 03:10:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 7 Nov 2007 11:10:01 +0100 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> Message-ID: <20071107101000.GN10978@elberon.bln.de.ingenico.com> * Zach Toups wrote on Tue, Nov 06, 2007 at 16:14 -0600: > Actually, the device runs over USB, but shows up as a virtual > serial port and is outputting these signals. Ahh, so what you want is to use rxtx on the serial port that is created by the driver and mapped maybe as some COM8 or whatever? I this case then IMHO it would be no hardware question but maybe a problem in your application, or some driver or indeed a rxtx issue. > The software that > comes with the device (a u-blox ANTARIS 4 eval kit) is able to > communicate. Is it sure that this software is really using the virtual serial port and only this port? oki, Steffen -- About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Wed Nov 7 04:59:10 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 06:59:10 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <20071107101000.GN10978@elberon.bln.de.ingenico.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> Message-ID: <4731A88E.6080705@gatworks.com> >> The software that >> comes with the device (a u-blox ANTARIS 4 eval kit) is able to >> communicate. > > Is it sure that this software is really using the virtual serial > port and only this port? > I have tried to read the docs. I have yet to find any explanation on a (windoz) device driver for this device ( the usb device ). That magic is not explained. For a developer thats important magic. Maybe a call to their support team is in order? From netbeans at gatworks.com Wed Nov 7 05:01:38 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 07:01:38 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <20071107101000.GN10978@elberon.bln.de.ingenico.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> Message-ID: <4731A922.7@gatworks.com> Steffen DETTMER wrote: > * Zach Toups wrote on Tue, Nov 06, 2007 at 16:14 -0600: >> Actually, the device runs over USB, but shows up as a virtual BTW: it seems that I am not getting all the Rxtx mail. Is there still a problem? From toupsz at cs.tamu.edu Wed Nov 7 07:36:20 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Wed, 7 Nov 2007 08:36:20 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4731A88E.6080705@gatworks.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> <4731A88E.6080705@gatworks.com> Message-ID: When I emailed them about this issue, they sent me their WinCE drivers, which are apparently based on this open source driver: http://www.yetanotherhomepage.com/j7xx/j7xx.html?/j7xx/software/util/usbdriver.html These include srcdll, and x86 subfolders, though it's not 100% clear to me that these are useful. The ublox communication suite appears to only communicate with serial ports...I've communicated with the ublox on two different comm ports (one with the serial adapter plugged into the serial port, one with the main USB connection), as well as a Garmin bluetooth GPS (which comes up as a bluetooth serial device). I'm not well versed in code this close to the hardware, but it seems to me that if you're running a virtual serial port, then you're virtually controlling the "voltages" that come in on this "port"...so why would they be "ttl level"? :-/ Shouldn't the USB driver be able to interpret the signals in whatever way it wants and just supply software with the binary interpretation? Thanks for all the help, guys, it's really appreciated! -Zach On Nov 7, 2007 5:59 AM, U. George wrote: > > >> The software that > >> comes with the device (a u-blox ANTARIS 4 eval kit) is able to > >> communicate. > > > > Is it sure that this software is really using the virtual serial > > port and only this port? > > > > I have tried to read the docs. I have yet to find any explanation on a > (windoz) device driver for this device ( the usb device ). That magic > is not explained. For a developer thats important magic. Maybe a call > to their support team is in order? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071107/18a13314/attachment-0017.html From netbeans at gatworks.com Wed Nov 7 08:55:55 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 10:55:55 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> <4731A88E.6080705@gatworks.com> Message-ID: <4731E00B.9030902@gatworks.com> There are 2 components to talking to hardware. There is the electrical specification, and then there is the software specification. there is the rs232 specification, parallel port specification, and the USB electrical specification. Generally these are used to plug in the various devices, and hook up electrically. Then there is the software side. There is the device driver, a software component that sits somewhere in the kernel that handles the USB ( in your case ) controller. The device driver generally does not care about the electrical component. There are various chips that handle USB signals, and these chips have I/O addresses so that signals and data can be properly routed. There is also the side that communicates to the user via the COM port device-name. The device driver that you mentioned is for the "Support PL2303 serial chip". This device driver, which hopefully works, handles the USB chip, and eventually recognzes the gps device, and hopefully creates an COM port so the user can open up and communicate. These are a lot of "HOPES". Since u have the web address of the device driver, and developer, I would think that the developer, and any docs, might be better able to help u to first determine if the GPS device is recognized, and the COM port ( maybe its called by another name ) is created, as per documentation. > > These include srcdll, and x86 subfolders, though it's not 100% clear to > me that these are useful. From tjarvi at qbang.org Sat Nov 10 17:46:13 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Nov 2007 17:46:13 -0700 (MST) Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 5 Nov 2007, Oberhuber, Martin wrote: > Hi Trent, > > are the interestes of hobbyists really so different > from commercial ones? Both should be interested in > high quality and innovation the like. > > I haven't seen too many Open Source projects from the > "inside" but those that I have seen did not have > separate mailing lists for quality/testing/qa > versus innovation/development. > > What I have seen with the Open Source projects that > one would call "successful" is a good deal of > process around automated builds, automated unit > tests, predictable release dates and milestones, > and policies around commiting/contributing/reviewing > changes. > > I think that all of these benefit commercial users > and hobbyists the like. > > If you were just asking about who's interested in > discussing changes to foster more quality, count > me in. I'm just not sure whether discussing these > on a separate mailing list or other channel is the > right thing to do. > Hi Martin, There are two issues I'm thinking about. The first is the generic unit testing and quality initiatives required to move rxtx forward. The second is the inevitable fact that rxtx connects to external hardware. The discussion deals with a different set of problems. Here is a simple example of what I'm getting at. We have the capability of setting custom baud rates in rxtx. We may be interested in seeing regressions in rxtx, the C library or the kernel. Some people may be doing some tests with loopback connections. These will always work even if the baud rate is not set to the expected value. Some people may use null modems between two ports. This may be able to catch the problem but not always. Will the build machines be able to test this? (no - for a few reasons) Will people be trying to catch these type of regressions? (yes) What type of coverage does the community have in the end? (?) We could include the discussions in the same list or another equally open list that may be of interest to some folks that deal with these types of problems on a regular basis. -- Trent Jarvi tjarvi at qbang.org From timlow84 at gmail.com Mon Nov 12 00:31:17 2007 From: timlow84 at gmail.com (Timothy Low) Date: Mon, 12 Nov 2007 15:31:17 +0800 Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> Message-ID: <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> ---------- Forwarded message ---------- From: Timothy Low Date: Nov 12, 2007 3:02 PM Subject: Building RXTX From Source To: taj at www.linux.org.uk Cc: ferdinand.tang at tangs.net, Timothy Low , chweehuat.ng at tangs.net Hi Trent, I tried building RXTX from source, and I got this error. I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm trying to get the necessary ".so" files to use for my serial port communication through java. My linux kernal information is: *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 x86_64 x86_64 x86_64 GNU/Linux* I'll most glad if you can provide me some direction on this. Thanks ! ---------------- [root at smsgateway rxtx-2.0-7pre1]# ./configure checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu configure: WARNING: Trying libtool. If the following fails install libtool checking for gcc... gcc checking for C compiler default output... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking for ld used by GCC... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking for a sed that does not truncate output... /bin/sed checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking command to parse /usr/bin/nm -B output... ok checking how to run the C preprocessor... gcc -E checking for egrep... grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for ranlib... ranlib checking for strip... strip checking for objdir... .libs checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.lo... yes checking if gcc supports -fno-rtti -fno-exceptions... yes checking whether the linker (/usr/bin/ld) supports shared libraries... yes checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking dynamic linker characteristics... GNU/Linux ld.so checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no checking whether -lc should be explicitly linked in... no creating libtool checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking for style of include used by make... GNU checking dependency style of gcc... none checking fcntl.h usability... yes checking fcntl.h presence... yes checking for fcntl.h... yes checking sys/fcntl.h usability... yes checking sys/fcntl.h presence... yes checking for sys/fcntl.h... yes checking sys/file.h usability... yes checking sys/file.h presence... yes checking for sys/file.h... yes checking sys/time.h usability... yes checking sys/time.h presence... yes checking for sys/time.h... yes checking sys/signal.h usability... yes checking sys/signal.h presence... yes checking for sys/signal.h... yes checking signal.h usability... yes checking signal.h presence... yes checking for signal.h.. . yes checking termios.h usability... yes checking termios.h presence... yes checking for termios.h... yes checking asm/termbits.h usability... yes checking asm/termbits.h presence... yes checking for asm/termbits.h... yes checking grp.h usability... yes checking grp.h presence... yes checking for grp.h... yes checking pwd.h usability... yes checking pwd.h presence... yes checking for pwd.h... yes checking whether gcc needs -traditional... no checking whether to enable maintainer-specific portions of Makefiles... no /usr/java/jdk1.5.0_13 configure: WARNING: using JAVA_HOME environmental variable adjusted java.home is /usr/java/jdk1.5.0_13 checking os.name Linux checking os.arch i386 checking java.vendor Sun Microsystems Inc. checking java.version 1.5.0_13 checking os.version 2.6.18-8.el5xen comm.jar appears to be installed already. conftest.c: In function 'main': conftest.c:6: warning: incompatible implicit declaration of built-in function 'printf' conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:6: error: (Each undeclared identifier is reported only once conftest.c:6: error: for each function it appears in.) conftest.c:6: error: expected ')' before string constant conftest.c:7: warning: incompatible implicit declaration of built-in function 'exit' ./configure: line 9649: ./conftest: No such file or directory ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected conftest.c: In function 'main': conftest.c:5: warning: incompatible implicit declaration of built-in function 'printf' conftest.c:10: warning: incompatible implicit declaration of built-in function 'exit' configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status : config.h is unchanged config.status: executing depfiles commands [root at smsgateway rxtx-2.0-7pre1]# make install /usr/java/jdk1.5.0_13/bin/javac -classpath .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d /home/jboss/sources/rxtx- 2.0-7pre1/ -O /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java /home/jboss/sources/rxtx-2.0-7pre1/./src/UnSupportedLoggerException.java /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o /home/jboss/sources/rxtx-2.0-7pre1/x86_64-unknown-linux-gnu/SerialImp.lo /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'init_threads': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: cast from pointer to integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_nativeDrain': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: cast to pointer from integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'read_byte_array': /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: cast to pointer from integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_readArray': /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: comparison is always false due to limited range of data type /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_readTerminatedArray': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: comparison is always false due to limited range of data type mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial- 2.0.7pre1.* gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so -o .libs/librxtxSerial-2.0.7pre1.so (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.0.7pre1.so librxtxSerial.so) creating librxtxSerial.la (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la librxtxSerial.la) gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/ParallelImp.lo /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function 'Java_javax_comm_LPRPort_readArray': /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: comparison is always false due to limited range of data type rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* .libs/librxtxParallel-2.0.7pre1.* gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so -o .libs/librxtxParallel- 2.0.7pre1.so (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.0.7pre1.so librxtxParallel.so) creating librxtxParallel.la (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la librxtxParallel.la) make all-am make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' libtool: install: `x86_64-unknown-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 ------------- Regards, Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071112/27758c3c/attachment-0013.html From tjarvi at qbang.org Mon Nov 12 01:02:09 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Nov 2007 01:02:09 -0700 (MST) Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> Message-ID: On Mon, 12 Nov 2007, Timothy Low wrote: > > Hi Trent, Hi Tim, Comments are inline. As I mentioned off the list, rxtx 2.0 is on the edge of deprecation. We can get it working but this is not the path of least resistance for future work. You will probably need to bounce another round of questions off the list. The following is intended to isolate the problem. > > I tried building RXTX from source, and I got this error. > > > I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm trying > to get the necessary ".so" files to use for my serial port communication > through java. > My linux kernal information is: > > *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 x86_64 > x86_64 x86_64 GNU/Linux* > > I'll most glad if you can provide me some direction on this. Thanks ! > > ---------------- > [root at smsgateway rxtx-2.0-7pre1]# ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > checking for C compiler default output... a.out > checking whether the C compiler works... yes > checking whether we are cross compiling... no > checking for suffix of executables... > checking for suffix of object files... o > checking whether we are using the GNU C compiler... yes > checking whether gcc accepts -g... yes > checking for gcc option to accept ANSI C... none needed > checking for ld used by GCC... /usr/bin/ld > checking if the linker (/usr/bin/ld) is GNU ld... yes > checking for /usr/bin/ld option to reload object files... -r > checking for BSD-compatible nm... /usr/bin/nm -B > checking for a sed that does not truncate output... /bin/sed > checking whether ln -s works... yes > checking how to recognise dependent libraries... pass_all > checking command to parse /usr/bin/nm -B output... ok > checking how to run the C preprocessor... gcc -E > checking for egrep... grep -E > checking for ANSI C header files... yes > checking for sys/types.h... yes > checking for sys/stat.h... yes > checking for stdlib.h... yes > checking for string.h... yes > checking for memory.h... yes > checking for strings.h... yes > checking for inttypes.h... yes > checking for stdint.h... yes > checking for unistd.h... yes > checking dlfcn.h usability... yes > checking dlfcn.h presence... yes > checking for dlfcn.h... yes > checking for ranlib... ranlib > checking for strip... strip > checking for objdir... .libs > checking for gcc option to produce PIC... -fPIC > checking if gcc PIC flag -fPIC works... yes > checking if gcc static flag -static works... yes > checking if gcc supports -c -o file.o... yes > checking if gcc supports -c -o file.lo... yes > checking if gcc supports -fno-rtti -fno-exceptions... yes > checking whether the linker (/usr/bin/ld) supports shared libraries... yes > checking how to hardcode library paths into programs... immediate > checking whether stripping libraries is possible... yes > checking dynamic linker characteristics... GNU/Linux ld.so > checking if libtool supports shared libraries... yes > checking whether to build shared libraries... yes > checking whether to build static libraries... no > checking whether -lc should be explicitly linked in... no > creating libtool > checking for a BSD-compatible install... /usr/bin/install -c > checking whether build environment is sane... yes > checking for gawk... gawk > checking whether make sets $(MAKE)... yes > checking for style of include used by make... GNU > checking dependency style of gcc... none > checking fcntl.h usability... yes > checking fcntl.h presence... yes > checking for fcntl.h... yes > checking sys/fcntl.h usability... yes > checking sys/fcntl.h presence... yes > checking for sys/fcntl.h... yes > checking sys/file.h usability... yes > checking sys/file.h presence... yes > checking for sys/file.h... yes > checking sys/time.h usability... yes > checking sys/time.h presence... yes > checking for sys/time.h... yes > checking sys/signal.h usability... yes > checking sys/signal.h presence... yes > checking for sys/signal.h... yes > checking signal.h usability... yes > checking signal.h presence... yes > checking for signal.h.. . yes > checking termios.h usability... yes > checking termios.h presence... yes > checking for termios.h... yes > checking asm/termbits.h usability... yes > checking asm/termbits.h presence... yes > checking for asm/termbits.h... yes > checking grp.h usability... yes > checking grp.h presence... yes > checking for grp.h... yes > checking pwd.h usability... yes > checking pwd.h presence... yes > checking for pwd.h... yes > checking whether gcc needs -traditional... no > checking whether to enable maintainer-specific portions of Makefiles... no > /usr/java/jdk1.5.0_13 > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /usr/java/jdk1.5.0_13 > checking os.name Linux > checking os.arch i386 > checking java.vendor Sun Microsystems Inc. > checking java.version 1.5.0_13 > checking os.version 2.6.18-8.el5xen > comm.jar appears to be installed already. > conftest.c: In function 'main': > conftest.c:6: warning: incompatible implicit declaration of built-in > function 'printf' > conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:6: error: (Each undeclared identifier is reported only once > conftest.c:6: error: for each function it appears in.) > conftest.c:6: error: expected ')' before string constant This is an outdated kernel version check for when headers and kernels could cause problems for rxtx. If we made it past this, then you are OK. > conftest.c:7: warning: incompatible implicit declaration of built-in > function 'exit' > ./configure: line 9649: ./conftest: No such file or directory > ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected It blew up but continues.. > conftest.c: In function 'main': > conftest.c:5: warning: incompatible implicit declaration of built-in > function 'printf' > conftest.c:10: warning: incompatible implicit declaration of built-in > function 'exit' > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status : config.h is unchanged > config.status: executing depfiles commands > [root at smsgateway rxtx-2.0-7pre1]# make install > /usr/java/jdk1.5.0_13/bin/javac -classpath > .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d > /home/jboss/sources/rxtx- 2.0-7pre1/ -O > /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java > /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/UnSupportedLoggerException.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java > Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or > overrides a deprecated API. > Note: Recompile with -Xlint:deprecation for details. > /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* The java jar should be fine now. You may need to change the source files as mentioned below. > gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. > -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g > -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o > /home/jboss/sources/rxtx-2.0-7pre1/x86_64-unknown-linux-gnu/SerialImp.lo > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'init_threads': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: cast > from pointer to integer of different size > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_nativeDrain': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: cast to > pointer from integer of different size > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'read_byte_array': > /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: cast to > pointer from integer of different size As I recall, this was caused by pointers (now 64 bit rather than 32 bit) being stored in java ints (jints). I would look at the diff between the CVS 2.1 SerialImp.c and RXTXPort.java files against 2.0. We did fix those issues. You have a .so file but the different pointer sizes will cause runtime errors. > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_readArray': > /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: > comparison is always false due to limited range of data type > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_readTerminatedArray': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: > comparison is always false due to limited range of data type > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial- > 2.0.7pre1.* > gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so -o > .libs/librxtxSerial-2.0.7pre1.so > (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.0.7pre1.so > librxtxSerial.so) > creating librxtxSerial.la > (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la > librxtxSerial.la) > gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. > -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g > -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o > /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/ParallelImp.lo > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function > 'Java_javax_comm_LPRPort_readArray': > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: > comparison is always false due to limited range of data type > rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* > .libs/librxtxParallel-2.0.7pre1.* > gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so -o > .libs/librxtxParallel- 2.0.7pre1.so > (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.0.7pre1.so > librxtxParallel.so) > creating librxtxParallel.la > (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la > librxtxParallel.la) > make all-am > make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' > make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' > libtool: install: `x86_64-unknown-linux-gnu' must be an absolute directory > name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 A libtool change? Assuming you ran configure && make install in /home/jboss/sources/rxtx- 2.0-7pre1, libtool is looking for /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/.libs/librxtxSerial-2.0.7pre1.so. I think you have this? The file is just being copied to ~JAVA/jre/lib/$(JAVA_ARCH). -- Trent Jarvi tjarvi at qbang.org From sarah_662005 at yahoo.com Mon Nov 12 16:10:28 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Mon, 12 Nov 2007 15:10:28 -0800 (PST) Subject: [Rxtx] [urgent] device's power off detection Message-ID: <766782.10076.qm@web55803.mail.re3.yahoo.com> Hello all, I have a small application built on top of rxtx api. This application can retrieve the incoming data from a device through a port. The device can be powered off after the port get closed from the application. I have been trying a couple of hours to find a way to detect the power switching from device. If anyone knows how to handle it through rxtx, could you please give me a help? Thank you very much. r, Sara ____________________________________________________________________________________ Get easy, one-click access to your favorites. Make Yahoo! your homepage. http://www.yahoo.com/r/hs -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071112/4599f3ec/attachment-0012.html From netbeans at gatworks.com Mon Nov 12 17:52:22 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 12 Nov 2007 19:52:22 -0500 Subject: [Rxtx] [urgent] device's power off detection In-Reply-To: <766782.10076.qm@web55803.mail.re3.yahoo.com> References: <766782.10076.qm@web55803.mail.re3.yahoo.com> Message-ID: <4738F546.5010101@gatworks.com> Not sure what u are asking for. Are u asking for a way to detect if the device is OFF? Are u asking how to power off the device - via software ? Is it a Serial device? is it a parallel device? is it a usb device? Sara Hugh wrote: > Hello all, > I have a small application built on top of rxtx api. This application > can retrieve the incoming data from a device through a port. The device > can be powered off after the port get closed from the application. I > have been trying a couple of hours to find a way to detect the power > switching from device. If anyone knows how to handle it through rxtx, > could you please give me a help? Thank you very much. From tjarvi at qbang.org Mon Nov 12 22:48:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Nov 2007 22:48:11 -0700 (MST) Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711120225x562db8cbxb750767ade3b0d73@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> <900c6ba90711120031p66edc001ted76f7ba24e34b98@mail.gmail.com> <900c6ba90711120225x562db8cbxb750767ade3b0d73@mail.gmail.com> Message-ID: Hi Tim, The gnu.io namespace looks just like the javax.comm 2.0 namespace. There are additional (discouraged) undocumented methods in gnu.io that you need not use. We just used the different namespace to avoid poluting Sun's by mistake and to make sure we stayed off any potential licensing related radar. Usuaully, you just change your imports and make sure you do not use the javax.comm namespace for anything like exception handling. As I mentioned off the list, there are no issues with rxtx going through the JSR process to be more Sun friendly other than time. rxtx has no hidden intentions there; anything that does not work like CommAPI 2.0 documented is a bug. The reason we do not support CommAPI 2.1 is technical in nature and is in the list archives as well as the front page of www.rxtx.org. On Mon, 12 Nov 2007, Timothy Low wrote: > Hi Trent, > > I'll move to use a JDK1.5 64-bit version... but do I need to make any source > code changes to use the package (gnu.io) in the RTXTcomm.jar instead of the > ones from the javacomm api ? > > > Regards, > Tim > > On Nov 12, 2007 5:22 PM, Trent Jarvi wrote: > >> >> Hi Tim, >> >> I see a couple things here. >> >> First your jdk is for i686 yet the library is compiled on a x86_64 >> machine. You may try passing configure the --target=i686-unknown-linux to >> try using the i686 backend to gcc if it is available. Or move to the 64 >> bit jdk. >> >> The other error I see is again the moved UTF_RELEASE define that we need >> to fix. You can probably get around that with: >> >> make -DUTF_RELEASE=`uname -r` >> >> even more simple would be to just specify the serial library which should >> be in configure --help. >> >> You can remove the UTF_RELEASE check from configure by editing >> configure.in, searching for the simple C program check and deleting it. >> Running autoconf after that will regenerate a new configure without the >> check. >> >> Note that you should remove the previous native libraries >> (librxtxSerial.so) when moving from rxtx 2.0 to 2.1. These are compiled >> for different namespaces (javax.comm/gnu.io). >> >> On Mon, 12 Nov 2007, Timothy Low wrote: >> >>> *Hi Trent, >>> >>> I moved on to rxtx 2.1.7r2, and updated my jre to 1.6.0 (64-bit)... I >> tried >>> the following 2 methods: >>> >>> (1) using the rxtx 2.1.7 binaries from the RXTX website* >>> *Are these binaries suitable for a 64-bit OS ? There mentioning of the >>> gnu.io that you've talked about previously...* >>> ------ >>> [root at smsgateway sources]# java -Djava.library.path=/usr/lib PortLister >>> Experimental: JNI_OnLoad called. >>> >>> java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion >>> ()Ljava/lang/String; >>> at gnu.io.RXTXCommDriver.nativeGetVersion(Native Method) >>> at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:85) >>> at java.lang.Class.forName0(Native Method) >>> at java.lang.Class.forName(Unknown Source) >>> at javax.comm.CommPortIdentifier.loadDriver( >> CommPortIdentifier.java >>> :237) >>> at javax.comm.CommPortIdentifier.(CommPortIdentifier.java >>> :109) >>> at PortLister.(PortLister.java:6) >>> at PortLister.main(PortLister.java:25) >>> Exception in thread "main" java.lang.UnsatisfiedLinkError: >>> com.sun.comm.SunrayInfo.isSessionActive()Z >>> at com.sun.comm.SunrayInfo.isSessionActive(Native Method) >>> at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java >> :155) >>> at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java >>> :100) >>> at javax.comm.CommPortIdentifier.(CommPortIdentifier.java >>> :138) >>> at PortLister.(PortLister.java:6) >>> at PortLister.main(PortLister.java:25) >>> >>> ------ >>> >>> (2) compiling the rxtx 2.1.7 from source >>> *but i got the following error while running ./configure and make all* >>> >>> ------ >>> [root at smsgateway rxtx-2.1-7r2]# ./configure >>> checking build system type... x86_64-unknown-linux-gnu >>> checking host system type... x86_64-unknown-linux-gnu >>> checking target system type... x86_64-unknown-linux-gnu >>> configure: WARNING: Trying libtool. If the following fails install >> libtool >>> checking for gcc... gcc >>> checking for C compiler default output file name... a.out >>> checking whether the C compiler works... yes >>> checking whether we are cross compiling... no >>> checking for suffix of executables... >>> checking for suffix of object files... o >>> checking whether we are using the GNU C compiler... yes >>> checking whether gcc accepts -g... yes >>> checking for gcc option to accept ANSI C... none needed >>> checking for a sed that does not truncate output... /bin/sed >>> checking for egrep... grep -E >>> checking for ld used by gcc... /usr/bin/ld >>> checking if the linker (/usr/bin/ld) is GNU ld... yes >>> checking for /usr/bin/ld option to reload object files... -r >>> checking for BSD-compatible nm... /usr/bin/nm -B >>> checking whether ln -s works... yes >>> checking how to recognise dependent libraries... pass_all >>> checking how to run the C preprocessor... gcc -E >>> checking for ANSI C header files... yes >>> checking for sys/types.h... yes >>> checking for sys/stat.h... yes >>> checking for stdlib.h... yes >>> checking for string.h... yes >>> checking for memory.h... yes >>> checking for strings.h... yes >>> checking for inttypes.h... yes >>> checking for stdint.h... yes >>> checking for unistd.h... yes >>> checking dlfcn.h usability... yes >>> checking dlfcn.h presence... yes >>> checking for dlfcn.h... yes >>> checking for g++... g++ >>> checking whether we are using the GNU C++ compiler... yes >>> checking whether g++ accepts -g... yes >>> checking how to run the C++ preprocessor... g++ -E >>> checking for g77... no >>> checking for f77... no >>> checking for xlf... no >>> checking for frt... no >>> checking for pgf77... no >>> checking for fort77... no >>> checking for fl32... no >>> checking for af77... no >>> checking for f90... no >>> checking for xlf90... no >>> checking for pgf90... no >>> checking for epcf90... no >>> checking for f95... f95 >>> checking whether we are using the GNU Fortran 77 compiler... yes >>> checking whether f95 accepts -g... yes >>> checking the maximum length of command line arguments... 32768 >>> checking command to parse /usr/bin/nm -B output from gcc object... ok >>> checking for objdir... .libs >>> checking for ar... ar >>> checking for ranlib... ranlib >>> checking for strip... strip >>> checking if gcc static flag works... yes >>> checking if gcc supports -fno-rtti -fno-exceptions... no >>> checking for gcc option to produce PIC... -fPIC >>> checking if gcc PIC flag -fPIC works... yes >>> checking if gcc supports -c -o file.o... yes >>> checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking whether -lc should be explicitly linked in... no >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> checking if libtool supports shared libraries... yes >>> checking whether to build shared libraries... yes >>> checking whether to build static libraries... no >>> configure: creating libtool >>> appending configuration tag "CXX" to libtool >>> checking for ld used by g++... /usr/bin/ld -m elf_x86_64 >>> checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes >>> checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking for g++ option to produce PIC... -fPIC >>> checking if g++ PIC flag -fPIC works... yes >>> checking if g++ supports -c -o file.o... yes >>> checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> appending configuration tag "F77" to libtool >>> checking if libtool supports shared libraries... yes >>> checking whether to build shared libraries... yes >>> checking whether to build static libraries... no >>> checking for f95 option to produce PIC... -fPIC >>> checking if f95 PIC flag -fPIC works... yes >>> checking if f95 supports -c -o file.o... yes >>> checking whether the f95 linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> checking for a BSD-compatible install... /usr/bin/install -c >>> checking whether build environment is sane... yes >>> checking for gawk... gawk >>> checking whether make sets $(MAKE)... yes >>> checking for style of include used by make... GNU >>> checking dependency style of gcc... none >>> checking dependency style of g++... none >>> checking fcntl.h usability... yes >>> checking fcntl.h presence... yes >>> checking for fcntl.h... yes >>> checking sys/fcntl.h usability... yes >>> checking sys/fcntl.h presence... yes >>> checking for sys/fcntl.h... yes >>> checking sys/file.h usability... yes >>> checking sys/file.h presence... yes >>> checking for sys/file.h... yes >>> checking sys/time.h usability... yes >>> checking sys/time.h presence... yes >>> checking for sys/time.h... yes >>> checking sys/signal.h usability... yes >>> checking sys/signal.h presence... yes >>> checking for sys/signal.h... yes >>> checking signal.h usability... yes >>> checking signal.h presence... yes >>> checking for signal.h... yes >>> checking termios.h usability... yes >>> checking termios.h presence... yes >>> checking for termios.h... yes >>> checking grp.h usability... yes >>> checking grp.h presence... yes >>> checking for grp.h... yes >>> checking pwd.h usability... yes >>> checking pwd.h presence... yes >>> checking for pwd.h... yes >>> checking whether gcc needs -traditional... no >>> checking whether to enable maintainer-specific portions of Makefiles... >> no >>> /usr/java/jdk1.5.0_13 >>> configure: WARNING: using JAVA_HOME environmental variable >>> adjusted java.home is /usr/java/jdk1.5.0_13 >>> checking os.name Linux >>> checking os.arch i386 >>> checking java.vendor Sun Microsystems Inc. >>> checking java.version 1.5.0_13 >>> checking os.version 2.6.18-8.el5xen >>> conftest.c: In function 'main': >>> conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this >> function) >>> conftest.c:8: error: (Each undeclared identifier is reported only once >>> conftest.c:8: error: for each function it appears in.) >>> conftest.c:8: error: expected ')' before string constant >>> ./configure: line 21462: ./conftest: No such file or directory >>> ./configure: line 21462: test: 2.6.18-8.el5xen: unary operator expected >>> configure: creating ./config.status >>> config.status: creating Makefile >>> config.status: creating config.h >>> config.status: executing depfiles commands >>> [root at smsgateway rxtx-2.1-7r2]# make install >>> /usr/java/jdk1.5.0_13/bin/javac -classpath .:/home/jboss/sources/rxtx- >>> >> 2.1-7r2:/home/jboss/sources/rxtx-2.1-7r2/src:/usr/java/jdk1.5.0_13/jre/lib/ext/RXTXcomm.jar-d >>> /home/jboss/sources/rxtx- >>> 2.1-7r2/ -O -source 1.3 -target 1.3 >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommDriver.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortEnumerator.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortIdentifier.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortOwnershipListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Configure.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2C.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/I2CPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/LPRPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/NoSuchPortException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/PortInUseException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Raw.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/RawPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RawPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RawPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/RS485PortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485PortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485Port.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXCommDriver.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXVersion.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPort.java >>> /home/jboss/sources/rxtx-2.1-7r2 >> /./src/UnsupportedCommOperationException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/UnSupportedLoggerException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Zystem.java >>> /usr/java/jdk1.5.0_13/bin/javah -classpath .:/home/jboss/sources/rxtx- >>> >> 2.1-7r2:/home/jboss/sources/rxtx-2.1-7r2/src:/usr/java/jdk1.5.0_13/jre/lib/ext/RXTXcomm.jar-d >>> x86_64-unknown-linux-gnu -jni `(for i in CommDriver CommPortEnumerator >>> CommPortIdentifier CommPort CommPortOwnershipListener Configure I2C >>> I2CPortEvent I2CPortEventListener I2CPort LPRPort NoSuchPortException >>> ParallelPortEvent ParallelPortEventListener ParallelPort >> PortInUseException >>> Raw RawPortEvent RawPortEventListener RawPort RS485 RS485PortEvent >>> RS485PortEventListener RS485Port RXTXCommDriver RXTXPort RXTXVersion >>> SerialPortEvent SerialPortEventListener SerialPort >>> UnsupportedCommOperationException UnSupportedLoggerException Zystem;do \ >>> if grep > /dev/null native.*\( /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/$i.java; then \ >>> echo gnu.io.$i; \ >>> fi; \ >>> done)` >>> /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialImp.c -o >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo; >>> \ >>> if [ "Serial" = "Serial" ]; >>> then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxSerial.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxSerial.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo; >> \ >>> fi; \ >>> ) >>> mkdir /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/.libs >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/SerialImp.o >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/fuserImp.o >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c: In function >> 'show_user': >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c:238: warning: cast >> from >>> pointer to integer of different size >>> gcc -shared /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/SerialImp.o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/fuserImp.o >>> -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7.so -o >> .libs/librxtxSerial- >>> 2.1-7.so >>> (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.1-7.so >>> librxtxSerial.so) >>> creating librxtxSerial.la >>> (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la >>> librxtxSerial.la) >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelImp.c -o >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/ParallelImp.lo; >>> \ >>> if [ "Parallel" = "Serial" ]; >>> then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxParallel.la -rpath >>> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/ParallelImp.lo >>> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxParallel.la -rpath >>> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/ParallelImp.lo; >>> \ >>> fi; \ >>> ) >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >>> /x86_64-unknown-linux-gnu/.libs/ParallelImp.o >>> gcc -shared /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/ParallelImp.o >>> -lpthread -Wl,-soname -Wl,librxtxParallel-2.1-7.so -o >>> .libs/librxtxParallel-2.1-7.so >>> (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.1-7.so >>> librxtxParallel.so) >>> creating librxtxParallel.la >>> (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la >>> librxtxParallel.la) >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo; >>> \ >>> if [ "I2C" = "Serial" ]; then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxI2C.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo >>> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxI2C.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo; >>> \ >>> fi; \ >>> ) >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/.libs/I2CImp.o >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c: In function >>> 'Java_gnu_io_I2CPort_Initialize': >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: 'UTS_RELEASE' >>> undeclared (first use in this function) >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: (Each >> undeclared >>> identifier is reported only once >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: for each >> function >>> it appears in.) >>> libtool: link: `/home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/I2CImp.lo' >>> is not a valid libtool object >>> make: *** [x86_64-unknown-linux-gnu/librxtxI2C.la] Error 1 >>> >>> ------ >>> >>> >>> >>> On Nov 12, 2007 4:02 PM, Trent Jarvi wrote: >>> >>>> On Mon, 12 Nov 2007, Timothy Low wrote: >>>>> >>>>> Hi Trent, >>>> >>>> Hi Tim, >>>> >>>> Comments are inline. As I mentioned off the list, rxtx 2.0 is on the >> edge >>>> of deprecation. We can get it working but this is not the path of >> least >>>> resistance for future work. >>>> >>>> You will probably need to bounce another round of questions off the >> list. >>>> The following is intended to isolate the problem. >>>> >>>>> >>>>> I tried building RXTX from source, and I got this error. >>>>> >>>>> >>>>> I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm >>>> trying >>>>> to get the necessary ".so" files to use for my serial port >> communication >>>>> through java. >>>>> My linux kernal information is: >>>>> >>>>> *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 >>>> x86_64 >>>>> x86_64 x86_64 GNU/Linux* >>>>> >>>>> I'll most glad if you can provide me some direction on this. Thanks ! >>>>> >>>>> ---------------- >>>>> [root at smsgateway rxtx-2.0-7pre1]# ./configure >>>>> checking build system type... x86_64-unknown-linux-gnu >>>>> checking host system type... x86_64-unknown-linux-gnu >>>>> checking target system type... x86_64-unknown-linux-gnu >>>>> configure: WARNING: Trying libtool. If the following fails install >>>> libtool >>>>> checking for gcc... gcc >>>>> checking for C compiler default output... a.out >>>>> checking whether the C compiler works... yes >>>>> checking whether we are cross compiling... no >>>>> checking for suffix of executables... >>>>> checking for suffix of object files... o >>>>> checking whether we are using the GNU C compiler... yes >>>>> checking whether gcc accepts -g... yes >>>>> checking for gcc option to accept ANSI C... none needed >>>>> checking for ld used by GCC... /usr/bin/ld >>>>> checking if the linker (/usr/bin/ld) is GNU ld... yes >>>>> checking for /usr/bin/ld option to reload object files... -r >>>>> checking for BSD-compatible nm... /usr/bin/nm -B >>>>> checking for a sed that does not truncate output... /bin/sed >>>>> checking whether ln -s works... yes >>>>> checking how to recognise dependent libraries... pass_all >>>>> checking command to parse /usr/bin/nm -B output... ok >>>>> checking how to run the C preprocessor... gcc -E >>>>> checking for egrep... grep -E >>>>> checking for ANSI C header files... yes >>>>> checking for sys/types.h... yes >>>>> checking for sys/stat.h... yes >>>>> checking for stdlib.h... yes >>>>> checking for string.h... yes >>>>> checking for memory.h... yes >>>>> checking for strings.h... yes >>>>> checking for inttypes.h... yes >>>>> checking for stdint.h... yes >>>>> checking for unistd.h... yes >>>>> checking dlfcn.h usability... yes >>>>> checking dlfcn.h presence... yes >>>>> checking for dlfcn.h... yes >>>>> checking for ranlib... ranlib >>>>> checking for strip... strip >>>>> checking for objdir... .libs >>>>> checking for gcc option to produce PIC... -fPIC >>>>> checking if gcc PIC flag -fPIC works... yes >>>>> checking if gcc static flag -static works... yes >>>>> checking if gcc supports -c -o file.o... yes >>>>> checking if gcc supports -c -o file.lo... yes >>>>> checking if gcc supports -fno-rtti -fno-exceptions... yes >>>>> checking whether the linker (/usr/bin/ld) supports shared libraries... >>>> yes >>>>> checking how to hardcode library paths into programs... immediate >>>>> checking whether stripping libraries is possible... yes >>>>> checking dynamic linker characteristics... GNU/Linux ld.so >>>>> checking if libtool supports shared libraries... yes >>>>> checking whether to build shared libraries... yes >>>>> checking whether to build static libraries... no >>>>> checking whether -lc should be explicitly linked in... no >>>>> creating libtool >>>>> checking for a BSD-compatible install... /usr/bin/install -c >>>>> checking whether build environment is sane... yes >>>>> checking for gawk... gawk >>>>> checking whether make sets $(MAKE)... yes >>>>> checking for style of include used by make... GNU >>>>> checking dependency style of gcc... none >>>>> checking fcntl.h usability... yes >>>>> checking fcntl.h presence... yes >>>>> checking for fcntl.h... yes >>>>> checking sys/fcntl.h usability... yes >>>>> checking sys/fcntl.h presence... yes >>>>> checking for sys/fcntl.h... yes >>>>> checking sys/file.h usability... yes >>>>> checking sys/file.h presence... yes >>>>> checking for sys/file.h... yes >>>>> checking sys/time.h usability... yes >>>>> checking sys/time.h presence... yes >>>>> checking for sys/time.h... yes >>>>> checking sys/signal.h usability... yes >>>>> checking sys/signal.h presence... yes >>>>> checking for sys/signal.h... yes >>>>> checking signal.h usability... yes >>>>> checking signal.h presence... yes >>>>> checking for signal.h.. . yes >>>>> checking termios.h usability... yes >>>>> checking termios.h presence... yes >>>>> checking for termios.h... yes >>>>> checking asm/termbits.h usability... yes >>>>> checking asm/termbits.h presence... yes >>>>> checking for asm/termbits.h... yes >>>>> checking grp.h usability... yes >>>>> checking grp.h presence... yes >>>>> checking for grp.h... yes >>>>> checking pwd.h usability... yes >>>>> checking pwd.h presence... yes >>>>> checking for pwd.h... yes >>>>> checking whether gcc needs -traditional... no >>>>> checking whether to enable maintainer-specific portions of >> Makefiles... >>>> no >>>>> /usr/java/jdk1.5.0_13 >>>>> configure: WARNING: using JAVA_HOME environmental variable >>>>> adjusted java.home is /usr/java/jdk1.5.0_13 >>>>> checking os.name Linux >>>>> checking os.arch i386 >>>>> checking java.vendor Sun Microsystems Inc. >>>>> checking java.version 1.5.0_13 >>>>> checking os.version 2.6.18-8.el5xen >>>>> comm.jar appears to be installed already. >>>>> conftest.c: In function 'main': >>>>> conftest.c:6: warning: incompatible implicit declaration of built-in >>>>> function 'printf' >>>>> conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this >>>> function) >>>>> conftest.c:6: error: (Each undeclared identifier is reported only once >>>>> conftest.c:6: error: for each function it appears in.) >>>>> conftest.c:6: error: expected ')' before string constant >>>> >>>> >>>> This is an outdated kernel version check for when headers and kernels >>>> could cause problems for rxtx. If we made it past this, then you are >> OK. >>>> >>>> >>>>> conftest.c:7: warning: incompatible implicit declaration of built-in >>>>> function 'exit' >>>>> ./configure: line 9649: ./conftest: No such file or directory >>>>> ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected >>>> >>>> It blew up but continues.. >>>> >>>>> conftest.c: In function 'main': >>>>> conftest.c:5: warning: incompatible implicit declaration of built-in >>>>> function 'printf' >>>>> conftest.c:10: warning: incompatible implicit declaration of built-in >>>>> function 'exit' >>>>> configure: creating ./config.status >>>>> config.status: creating Makefile >>>>> config.status: creating config.h >>>>> config.status : config.h is unchanged >>>>> config.status: executing depfiles commands >>>>> [root at smsgateway rxtx-2.0-7pre1]# make install >>>>> /usr/java/jdk1.5.0_13/bin/javac -classpath >>>>> .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/ -O >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1 >> /./src/UnSupportedLoggerException.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java >>>>> Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or >>>>> overrides a deprecated API. >>>>> Note: Recompile with -Xlint:deprecation for details. >>>>> /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* >>>> >>>> >>>> The java jar should be fine now. You may need to change the source >> files >>>> as mentioned below. >>>> >>>>> gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu >> -I. >>>>> -I/usr/java/jdk1.5.0_13/include >> -I/usr/java/jdk1.5.0_13/include/./linux/ >>>> -g >>>>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o >>>>> /home/jboss/sources/rxtx-2.0-7pre1 >> /x86_64-unknown-linux-gnu/SerialImp.lo >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'init_threads': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: >>>> cast >>>>> from pointer to integer of different size >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_nativeDrain': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: >>>> cast to >>>>> pointer from integer of different size >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'read_byte_array': >>>>> /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: >>>> cast to >>>>> pointer from integer of different size >>>> >>>> >>>> As I recall, this was caused by pointers (now 64 bit rather than 32 >> bit) >>>> being stored in java ints (jints). I would look at the diff between >> the >>>> CVS 2.1 SerialImp.c and RXTXPort.java files against 2.0. We >>>> did fix those issues. >>>> >>>> You have a .so file but the different pointer sizes will cause runtime >>>> errors. >>>> >>>> >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_readArray': >>>>> /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: >>>>> comparison is always false due to limited range of data type >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_readTerminatedArray': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: >>>>> comparison is always false due to limited range of data type >>>>> mkdir .libs >>>>> rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* >> .libs/librxtxSerial- >>>>> 2.0.7pre1.* >>>>> gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so-o >>>>> .libs/librxtxSerial-2.0.7pre1.so >>>>> (cd .libs && rm -f librxtxSerial.so && ln -s >> librxtxSerial-2.0.7pre1.so >>>>> librxtxSerial.so) >>>>> creating librxtxSerial.la >>>>> (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la >>>>> librxtxSerial.la) >>>>> gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu >> -I. >>>>> -I/usr/java/jdk1.5.0_13/include >> -I/usr/java/jdk1.5.0_13/include/./linux/ >>>> -g >>>>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o >>>>> /home/jboss/sources/rxtx- 2.0-7pre1 >>>> /x86_64-unknown-linux-gnu/ParallelImp.lo >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function >>>>> 'Java_javax_comm_LPRPort_readArray': >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: >>>>> comparison is always false due to limited range of data type >>>>> rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* >>>>> .libs/librxtxParallel-2.0.7pre1.* >>>>> gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so-o >>>>> .libs/librxtxParallel- 2.0.7pre1.so >>>>> (cd .libs && rm -f librxtxParallel.so && ln -s >>>> librxtxParallel-2.0.7pre1.so >>>>> librxtxParallel.so) >>>>> creating librxtxParallel.la >>>>> (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la >>>>> librxtxParallel.la) >>>>> make all-am >>>>> make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' >>>>> make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' >>>>> libtool: install: `x86_64-unknown-linux-gnu' must be an absolute >>>> directory >>>>> name >>>>> Try `libtool --help --mode=install' for more information. >>>>> make: *** [install] Error 1 >>>> >>>> A libtool change? Assuming you ran configure && make install in >>>> /home/jboss/sources/rxtx- 2.0-7pre1, libtool is looking for >>>> /home/jboss/sources/rxtx- >>>> 2.0-7pre1/x86_64-unknown-linux-gnu/.libs/librxtxSerial-2.0.7pre1.so. >>>> >>>> I think you have this? The file is just being copied to >>>> ~JAVA/jre/lib/$(JAVA_ARCH). >>>> >>>> -- >>>> Trent Jarvi >>>> tjarvi at qbang.org >>>> >>> >> > From guido.vogt at celsi.ch Tue Nov 13 00:28:01 2007 From: guido.vogt at celsi.ch (Guido Vogt) Date: Tue, 13 Nov 2007 08:28:01 +0100 Subject: [Rxtx] RTS Line can't be set Message-ID: <47395201.1050400@celsi.ch> I'm working on an Windows XP /SP2 System. Version of RXTX: 2.1.7. The serial line is connected to a modem. As I can see, the RTS-Line of the serial Port is inactive, when the port is opened (flowcontrol=none). Obviously, no data is coming from the modem. If I use the setRTS(true) command after open, the comport does not send out my data any more. This behaviour is regardless of flowcontrol. Anybody has an idea what do do? Thanks for help. From Martin.Oberhuber at windriver.com Tue Nov 13 08:58:23 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 13 Nov 2007 16:58:23 +0100 Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803880918@ism-mail03.corp.ad.wrs.com> Hi Trent, as said before, I like the idea of discussing such quality engineering issues, but why hide these away from the rest of the public? Anyways, if you do want to create a new mailing list for these kinds of things I'll happily subscribe. 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: Sunday, November 11, 2007 1:46 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: RE: [Rxtx] Quality Engineering with rxtx > > On Mon, 5 Nov 2007, Oberhuber, Martin wrote: > > > Hi Trent, > > > > are the interestes of hobbyists really so different > > from commercial ones? Both should be interested in > > high quality and innovation the like. > > > > I haven't seen too many Open Source projects from the > > "inside" but those that I have seen did not have > > separate mailing lists for quality/testing/qa > > versus innovation/development. > > > > What I have seen with the Open Source projects that > > one would call "successful" is a good deal of > > process around automated builds, automated unit > > tests, predictable release dates and milestones, > > and policies around commiting/contributing/reviewing > > changes. > > > > I think that all of these benefit commercial users > > and hobbyists the like. > > > > If you were just asking about who's interested in > > discussing changes to foster more quality, count > > me in. I'm just not sure whether discussing these > > on a separate mailing list or other channel is the > > right thing to do. > > > > Hi Martin, > > There are two issues I'm thinking about. The first is the > generic unit > testing and quality initiatives required to move rxtx > forward. The second > is the inevitable fact that rxtx connects to external hardware. The > discussion deals with a different set of problems. > > Here is a simple example of what I'm getting at. > > We have the capability of setting custom baud rates in rxtx. > We may be > interested in seeing regressions in rxtx, the C library or > the kernel. > Some people may be doing some tests with loopback > connections. These will > always work even if the baud rate is not set to the expected > value. Some > people may use null modems between two ports. This may be > able to catch > the problem but not always. > > Will the build machines be able to test this? (no - for a few reasons) > Will people be trying to catch these type of regressions? (yes) > What type of coverage does the community have in the end? (?) > > We could include the discussions in the same list or another > equally open > list that may be of interest to some folks that deal with > these types of > problems on a regular basis. > > -- > Trent Jarvi > tjarvi at qbang.org > From toupsz at cs.tamu.edu Tue Nov 13 10:33:03 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 13 Nov 2007 11:33:03 -0600 Subject: [Rxtx] [urgent] device's power off detection In-Reply-To: <4738F546.5010101@gatworks.com> References: <766782.10076.qm@web55803.mail.re3.yahoo.com> <4738F546.5010101@gatworks.com> Message-ID: Lacking any other specification on it...but can you set up the device to notify your software when it turns off? Send a message or somesuch? Maybe it can signal using RTS or DTR? -Zach On Nov 12, 2007 6:52 PM, U. George wrote: > Not sure what u are asking for. Are u asking for a way to detect if the > device is OFF? Are u asking how to power off the device - via software ? > Is it a Serial device? > is it a parallel device? > is it a usb device? > > Sara Hugh wrote: > > Hello all, > > I have a small application built on top of rxtx api. This application > > can retrieve the incoming data from a device through a port. The device > > can be powered off after the port get closed from the application. I > > have been trying a couple of hours to find a way to detect the power > > switching from device. If anyone knows how to handle it through rxtx, > > could you please give me a help? Thank you very much. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071113/e5859e4d/attachment-0011.html From tjarvi at qbang.org Tue Nov 13 20:02:03 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 13 Nov 2007 20:02:03 -0700 (MST) Subject: [Rxtx] #ifndef TIOCSERGETLSR In-Reply-To: <472E3AAF.7050709@gatworks.com> References: <472E3AAF.7050709@gatworks.com> Message-ID: On Sun, 4 Nov 2007, U. George wrote: > For Linux, it seems that you need the code for both *having* a > TIOCSERGETLSR, and *not having* a TIOCSERGETLSR. Maybe the ioctl exists > system wide, but not necessarily for the device driver itself ( always > returns -1 ) . > > Are there systems that have a *functioning* TIOCSERGETLSR for all their > devices? Then this would be the case where the "#ifndef TIOCSERGETLSR" > directive could be useful is eliminating the unnecessary code and tests. > > And for those systems that dont have a TIOCSERGETLSR, then the code for > TIOCSERGETLSR can be eliminated. > > It would be a simple case to have, as a foundation, all the code to > simulate the missing TIOCSERGETLSR ioctl. If the system does have the > ioctl, then that code can be ifdef'd in, and co-exist with the > functionality of the code that simulates the missing TIOCSERGETLSR ioctl. > Ah, there is the post. Sorry I was on vacation. Hi George, Yes there are systems that have functioning TIOCSERGETLSR for all of their devices. These are machines that just use traditional UARTs. If you mean operating systems, then probably not. Let me explain a bit about the history of those #ifdefs to help clear up a mess. RXTX aims to follow POSIX. TIOCSERGETLSR turns out to not be POSIX at all as I understand. It isn't in BSD, Solaris, AIX or HP-UX. It certainly provides access to important information. I assumed it was standard when I coded rxtx on a Linux system. Ya, laugh. Then I looked at Win32.. Oh you are still laughing? ..I could not navigate msft's web site at the time [still can't really find anything today]. So google pointed me to someones 'reverse documentation' of the w32 API and an example msft put together back in the win3.0 days. It was enough but maybe not 100% correct. They covered overlapped IO which was important for events in rxtx. Looking at Win32 and Linux, it made sense to implement TIOCSERGETLSR for win32 with the way rxtx works. That was how things matched up. But when I got feedback about other systems, it didn't match up. When people used multiport cards with money saving designs in Linux, it didn't match up. And today, there are drivers for unusual serial ports that don't match up. Now we have some ugly logic that mostly works for most serial ports. It isn't right though. The important aspect of TIOSERGETLSR is knowing when the output is really gone. But POSIX tcdrain tells us the same thing. So there is logic in the ifdefs to match that up as you suggest. Perhaps a more formal solution along those lines would be worth looking into. I would suggest the roles should be switched though. We should use POSIX calls on all systems and hide things that don't work on everything like we have with other undocumented calls. TIOSERGETLSR is nice and would be great if it was standard. It isn't as far as I can tell. In the end, many people write Java code because they want portability. The TIOSERGETLSR does not really fit. In someways, this is limiting to the least common denominator which is Solaris if you have seen it's serial kernel driver code. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 15 09:10:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 15 Nov 2007 17:10:59 +0100 Subject: [Rxtx] RXTX blocking on unconnected virtual port Message-ID: <460801A4097E3D4CA04CC64EE648584803919080@ism-mail03.corp.ad.wrs.com> Hello, we came across the following issue: * Set up a virtual serial port, e.g. with com0com: http://com0com.sourceforge.net/ * Connect RXTX to one end, e.g. cnc1a * Do not connect the other end, e.g. cnc1b * Have RXTX write data to the port --> Since the data is not being read, RXTX blocks - RXTXPort.SerialOutputStream.write increases the RXTXPort.IOLocked variable - it then calls the native writeByte or writeArray method (which blocks) closing the RXTXPort hangs for ever too: - RXTXPort.close() has a while( IOLocked > 0 ) {..Thread.sleep(500);...} which spins for ever ==> once the communication hangs, it cannot recover. Has anybody else seen such a problem before, or even got an idea how to solve it? When I connect Hyperterminal to the same half-open port, and type a character, it hangs for about 3 seconds but then times out and is available again. I guess that's what I'd like to see in RXTX as well, with a (configurable) timeout. Our big problem with the current situation is that once RXTX gets stuck, there is nothing at all we can do to make it go live again - that's why our original workaround of writing to the port in a background thread is not good enough. For more background information, the issue is being tracked in https://bugs.eclipse.org/bugs/show_bug.cgi?id=208185 Thanks for any hints or ideas, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Sun Nov 18 09:43:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 09:43:26 -0700 (MST) Subject: [Rxtx] PortInUseException - Cannot close and reopen serial port In-Reply-To: <460801A4097E3D4CA04CC64EE64858480351C711@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858480351C711@ism-mail03.corp.ad.wrs.com> Message-ID: These have been submitted to CVS and the bugzilla entries have been changed to reflect the changes. ChangeLog: find ports which were added after program startup on Mac OS X. Martin Oberhuber http://bugzilla.qbang.org/show_bug.cgi?id=48 Clean up CommPort Ownership code, avoid possible deadlocks, fix lost commport ownership events. http://bugzilla.qbang.org/show_bug.cgi?id=83 Martin Oberhuber On Wed, 24 Oct 2007, Oberhuber, Martin wrote: > 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) > > > > > > > > > > > > > > > From tjarvi at qbang.org Sun Nov 18 09:45:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 09:45:39 -0700 (MST) Subject: [Rxtx] PortInUseException - Cannot close and reopen serial port In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848020CAF26@ism-mail03.corp.ad.wrs.com> Message-ID: The current CVS code should have all the entries. With version information, I usually do not change the version until we tag and release a zip file. Any feedback would be appreciated. On Wed, 27 Jun 2007, Greg Johnson wrote: > 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) >> >> >> >> >> > From tjarvi at qbang.org Sun Nov 18 13:51:27 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 13:51:27 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs Message-ID: The following bugs have been closed and CVS updated as needed: CommPortIdentifier.getPortIdentifier throws NoSuchPortException http://bugzilla.qbang.org/show_bug.cgi?id=48 CommPortOwnership events not sent http://bugzilla.qbang.org/show_bug.cgi?id=83 JVM 1.6 builds http://bugzilla.qbang.org/show_bug.cgi?id=84 I'd like to give Martin Oberhuber CVS write access. He has been doing a great job of pushing safe patches into rxtx. I'll be preparing seperate patches for the changes I have and submitting them to the list. I'll need to work with George to do a couple things: 1) break the patch into smaller pieces to isolate issues for discussion. 2) work through the Line Status Register changes so it does not cause problems on other systems. George: If you could do the first one, it would be greatly appreciated. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Nov 18 15:33:36 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 15:33:36 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: Message-ID: I'm not running any tests at this point, I'm trying to apply the small safe patches and make sure everything is compiling. As mentioned at the bottom, there are 3 patches + the USB fix posted here that need more review before accepting. The following bugs have been closed and CVS updated as needed. Most of these are already in CVS. The diff will be small. configure script failed at line UTS_RELEASE megov http://bugzilla.qbang.org/show_bug.cgi?id=80 code cleanup patch (extra ';' creates bug for if statements + new String() calls removed) Xavier Le Vourch http://bugzilla.qbang.org/show_bug.cgi?id=77 Wont compile on linux ppc with glibc 2.5 - no sys/io.h Brian Johnson http://bugzilla.qbang.org/show_bug.cgi?id=72 rxtx overwrites System properties Andrew Gillett Nektarios K. Papadopoulos Neboj??a http://bugzilla.qbang.org/show_bug.cgi?id=64 Solaris ACM port support Dave Cleal http://bugzilla.qbang.org/show_bug.cgi?id=59 Setting of non-standard baud rate fails. Andrew Prunicki http://bugzilla.qbang.org/show_bug.cgi?id=58 RXTX uses lockfiles on MacOS X (instead of ioctl TIOCEXCL) Joachim Buechse http://bugzilla.qbang.org/show_bug.cgi?id=50 JavaDoc fixes Joachim Buechse http://bugzilla.qbang.org/show_bug.cgi?id=49 I need to further review the following: http://bugzilla.qbang.org/show_bug.cgi?id=53 http://bugzilla.qbang.org/show_bug.cgi?id=46 http://bugzilla.qbang.org/show_bug.cgi?id=41 On Sun, 18 Nov 2007, Trent Jarvi wrote: > > The following bugs have been closed and CVS updated as needed: > > CommPortIdentifier.getPortIdentifier throws NoSuchPortException > http://bugzilla.qbang.org/show_bug.cgi?id=48 > CommPortOwnership events not sent > http://bugzilla.qbang.org/show_bug.cgi?id=83 > JVM 1.6 builds > http://bugzilla.qbang.org/show_bug.cgi?id=84 > > I'd like to give Martin Oberhuber CVS write access. He has been doing a > great job of pushing safe patches into rxtx. > > I'll be preparing seperate patches for the changes I have and submitting > them to the list. > > I'll need to work with George to do a couple things: > > 1) break the patch into smaller pieces to isolate issues for discussion. > 2) work through the Line Status Register changes so it does not cause > problems on other systems. > > George: If you could do the first one, it would be greatly appreciated. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From netbeans at gatworks.com Sun Nov 18 16:20:02 2007 From: netbeans at gatworks.com (U. George) Date: Sun, 18 Nov 2007 18:20:02 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: Message-ID: <4740C8A2.6030908@gatworks.com> > I'll need to work with George to do a couple things: > > 1) break the patch into smaller pieces to isolate issues for discussion. > 2) work through the Line Status Register changes so it does not cause > problems on other systems. > > George: If you could do the first one, it would be greatly appreciated. there are ( probably ) 3 pieces: 1) the select() failure when the USB-serial device is unceremoniously unplugged ( causes rxtx to spin ) 2) TIOCSERGETLSR, need to have the simulation of it available for all os's . If the system has the capability, don't simulate for devices that have the capability. For devices that dont have the capability, but the OS still defines TIOCSERGETLSR, fall back to simulation. 3) I rearranged DEBUG ifdef's. This is probably the bulk of the patches. From tjarvi at qbang.org Sun Nov 18 18:26:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 18:26:26 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <4740C8A2.6030908@gatworks.com> References: <4740C8A2.6030908@gatworks.com> Message-ID: On Sun, 18 Nov 2007, U. George wrote: > >> I'll need to work with George to do a couple things: >> >> 1) break the patch into smaller pieces to isolate issues for discussion. >> 2) work through the Line Status Register changes so it does not cause >> problems on other systems. >> >> George: If you could do the first one, it would be greatly appreciated. > > there are ( probably ) 3 pieces: > 1) the select() failure when the USB-serial device is unceremoniously > unplugged ( causes rxtx to spin ) > 2) TIOCSERGETLSR, need to have the simulation of it available for all os's . > If the system has the capability, don't simulate for devices that have the > capability. For devices that dont have the capability, but the OS still > defines TIOCSERGETLSR, fall back to simulation. > 3) I rearranged DEBUG ifdef's. This is probably the bulk of the patches. > Hi George, I suspect if you do cvs update, there will be very few conflicts if any. While the list of fixes is fairly long, the changes are small. -- Trent Jarvi tjarvi at qbang.org From EdwardRF at xtremax.com Mon Nov 19 03:32:29 2007 From: EdwardRF at xtremax.com (Edward) Date: Mon, 19 Nov 2007 18:32:29 +0800 Subject: [Rxtx] Cannot Read under Windows XP Message-ID: <4741663D.4070200@xtremax.com> Hi Guys, I have a iTegno 3000 usb GSM modem, it is an usb-serial device. I am trying to use RXTX with it under Windows XP. The problem is it seems RXTX cannot read any data from it, but writing to it seems successful. I blindly issue a series of command to send off a SMS, it is successfully delivered, but neither the echo from the modem nor the "OK" response was received. I tried to connect to the modem directly using hyper terminal, there was no problem reading or writing. So can i assume it is not the driver problem? Then i turned to Serial Port Monitor for help, when I use hyper terminal, monitor shows both way traffic, and nothing abnormal, but when I connect using RXTX, only the data I sent to the modem is being detected, no input was detected. Does anyone else experience similar problem? Best Regards Edward From tjarvi at qbang.org Mon Nov 19 03:38:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Nov 2007 03:38:02 -0700 (MST) Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: <4741663D.4070200@xtremax.com> References: <4741663D.4070200@xtremax.com> Message-ID: On Mon, 19 Nov 2007, Edward wrote: > Hi Guys, > > I have a iTegno 3000 usb GSM modem, it is an usb-serial device. I am > trying to use RXTX with it under Windows XP. > The problem is it seems RXTX cannot read any data from it, but writing > to it seems successful. I blindly issue a series of command to send off > a SMS, it is successfully delivered, but neither the echo from the modem > nor the "OK" response was received. > > I tried to connect to the modem directly using hyper terminal, there was > no problem reading or writing. So can i assume it is not the driver problem? > > Then i turned to Serial Port Monitor for help, when I use hyper > terminal, monitor shows both way traffic, and nothing abnormal, but when > I connect using RXTX, only the data I sent to the modem is being > detected, no input was detected. > > Does anyone else experience similar problem? > Hi Edward, A common mistake is to send Strings to the modem which are i18n. You want to send the bytes. Examples of doing this are in the contrib directory with the sourcecode. ie SimpleSnuV1.java -- Trent Jarvi tjarvi at qbang.org From EdwardRF at xtremax.com Mon Nov 19 04:42:16 2007 From: EdwardRF at xtremax.com (Edward) Date: Mon, 19 Nov 2007 19:42:16 +0800 Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: References: <4741663D.4070200@xtremax.com> Message-ID: <47417698.3060705@xtremax.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071119/b0f08ba9/attachment-0006.html From netbeans at gatworks.com Mon Nov 19 06:31:30 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 19 Nov 2007 08:31:30 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: <4740C8A2.6030908@gatworks.com> Message-ID: <47419032.8080406@gatworks.com> Did the "make install". The install does not want to go to or use Makefiles's prefix = /usr/local/rxtx-devel Not terribly happy that it installed in /home/gat/JAVA/JDK14/j2sdk1.4.2_08/jre/lib/i386 Trent Jarvi wrote: > > I suspect if you do cvs update, there will be very few conflicts if any. > While the list of fixes is fairly long, the changes are small. > > -- > Trent Jarvi > tjarvi at qbang.org > > From Martin.Oberhuber at windriver.com Mon Nov 19 07:00:48 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 19 Nov 2007 15:00:48 +0100 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE6485848039986E6@ism-mail03.corp.ad.wrs.com> It's great to see things progressing - thanks Trent! I checked CVS, and it seems that most of the patch authors are yet missing from the AUTHORS file, is this intentional? The issues areound RXTXPort.close() are interesting for us in the context of Eclipse as well: https://bugs.eclipse.org/bugs/show_bug.cgi?id=208185#c3 I did a quick review and found some issues / comments: http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 http://bugzilla.qbang.org/show_bug.cgi?id=53#c9 Thanks for proposing CVS write access for me. I promise to use these thoughtfully, and discuss potential fixes openly (on bugzilla) before applying them [unless it's really trivial issues only like obvious Javadoc syntax or spelling errors]. Cheers, -- 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 Mon Nov 19 07:24:16 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 19 Nov 2007 15:24:16 +0100 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803998711@ism-mail03.corp.ad.wrs.com> Hi all, I think I've got a better version for RXTXCommDriver.checkSolaris(): http://bugzilla.qbang.org/show_bug.cgi?id=77#c3 Cheers, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From netbeans at gatworks.com Mon Nov 19 09:01:22 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 19 Nov 2007 11:01:22 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <47419032.8080406@gatworks.com> References: <4740C8A2.6030908@gatworks.com> <47419032.8080406@gatworks.com> Message-ID: <4741B352.8070205@gatworks.com> U. George wrote: > Did the "make install". The install does not want to go to or use > Makefiles's prefix = /usr/local/rxtx-devel > > Not terribly happy that it installed in > /home/gat/JAVA/JDK14/j2sdk1.4.2_08/jre/lib/i386 > Put libs and jar in MY preferential places. Ran application. And it loves to spin. Deja gnu all over again. :-/ It did find the avail /dev/ttyUSB0 port connected to LINUX usbserial/pl2303 device driver. Now to find the spin. and apply simpler set of patches From tjarvi at qbang.org Mon Nov 19 10:14:38 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Nov 2007 10:14:38 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <4741B352.8070205@gatworks.com> References: <4740C8A2.6030908@gatworks.com> <47419032.8080406@gatworks.com> <4741B352.8070205@gatworks.com> Message-ID: On Mon, 19 Nov 2007, U. George wrote: > U. George wrote: >> Did the "make install". The install does not want to go to or use >> Makefiles's prefix = /usr/local/rxtx-devel >> >> Not terribly happy that it installed in >> /home/gat/JAVA/JDK14/j2sdk1.4.2_08/jre/lib/i386 >> > Put libs and jar in MY preferential places. Ran application. And it loves to > spin. Deja gnu all over again. :-/ > > It did find the avail /dev/ttyUSB0 port connected to LINUX usbserial/pl2303 > device driver. > > Now to find the spin. and apply simpler set of patches > Hi George, When the prefix code was stomped on and the library was installed in the jre, It wasnt clear how the layout would end up looking. I'm still not sure. My usual attack was to dump a jdk onto the filesystem, set JAVA_HOME and install. When I was done, I would nuke the jdk. Obviously that may not be what people want but I'm not sure a prefix is enough to let us know what they do want. For a shared library prefix /usr/local means the library goes in /usr/local/lib. What would it mean for the jar and shared library in Java? -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Nov 19 10:24:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Nov 2007 10:24:08 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <460801A4097E3D4CA04CC64EE6485848039986E6@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848039986E6@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 19 Nov 2007, Oberhuber, Martin wrote: > > I checked CVS, and it seems that most of the patch > authors are yet missing from the AUTHORS file, > is this intentional? > There isn't a hard rule covering who goes into AUTHORS. If I recognize a person from previous patches, I try to make sure they are in. Everyone contributing (authors) is in the ChangeLog with what they did going all the way back to the first release. AUTHORS is more of a summary of what they did after a few submissions. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Nov 19 11:39:51 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 19 Nov 2007 13:39:51 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: <4740C8A2.6030908@gatworks.com> <47419032.8080406@gatworks.com> <4741B352.8070205@gatworks.com> Message-ID: <4741D877.80203@gatworks.com> For me, the makefile/prefix = /usr/local sorta suggest thats where the libs/bins/jars/... should eventually wind up. If a user does not like /usr/local, then a quick change would put it somewhere else. At this moment I dont care where the jar winds up ( in lib, or a jar directory ). So I like to keep the jre/sdk directory protected from meddling, and changes. But if a user has a penchant to use 'java -jar', then the RXTXcomm.jar file should be stuffed with the other jre/sdk jar files. From ajmas at sympatico.ca Mon Nov 19 11:54:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 19 Nov 2007 13:54:29 -0500 Subject: [Rxtx] CVS updates and closed bugs Message-ID: <20071119185429.SPYK18413.tomts22-srv.bellnexxia.net@smtp1.sympatico.ca> On this day in November "U. George" wrote: > > For me, the makefile/prefix = /usr/local sorta suggest thats where the > libs/bins/jars/... should eventually wind up. > If a user does not like /usr/local, then a quick change would put it > somewhere else. At this moment I dont care where the jar winds up ( in > lib, or a jar directory ). > So I like to keep the jre/sdk directory protected from meddling, and > changes. > But if a user has a penchant to use 'java -jar', then the RXTXcomm.jar > file should be stuffed with the other jre/sdk jar files. It should be noted that some platforms, such as MacOS X might have different conventions. In the case of MacOS X there are two 'correct' places for Java libraries that aren't part of an application: - /Library/Java/Extensions/ - ~/Library/Java/Extensions/ Andre From ajmas at sympatico.ca Mon Nov 19 18:15:37 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 19 Nov 2007 20:15:37 -0500 Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: <47417698.3060705@xtremax.com> References: <4741663D.4070200@xtremax.com> <47417698.3060705@xtremax.com> Message-ID: <3D24B671-06CA-4709-AE3C-BCDB542F427F@sympatico.ca> On 19-Nov-07, at 06:42 , Edward wrote: > Hi Trent, > > First of all, I did sent them as bytes, eg, > > output.write("at\r\n".getBytes()); > > And if writing is every the problem, it wouldn't be able to explain > why i could send out a sms successfully using RXTX. > If you have the section of code that does the communicating, could you share it with us? This should help us tell whether it is a coding issue or something more fundamental with RXTX. Andre From EdwardRF at xtremax.com Mon Nov 19 19:39:36 2007 From: EdwardRF at xtremax.com (EdwardRF) Date: Tue, 20 Nov 2007 10:39:36 +0800 Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: <3D24B671-06CA-4709-AE3C-BCDB542F427F@sympatico.ca> References: <4741663D.4070200@xtremax.com> <47417698.3060705@xtremax.com> <3D24B671-06CA-4709-AE3C-BCDB542F427F@sympatico.ca> Message-ID: <474248E8.7070002@xtremax.com> Hi Guys, Thanks for the help, i've finally found out the problem. It was a flow control issue, i did not set the flow control properly. Btw, what is the default flow control behavior for rxtx2.1.7? was it the same as 2.0? Because i remember i did not need to set the flow control when I use rxtx 2.0 2 years back. Best Regards Edward Andre-John Mas wrote: > > On 19-Nov-07, at 06:42 , Edward wrote: > >> Hi Trent, >> >> First of all, I did sent them as bytes, eg, >> >> output.write("at\r\n".getBytes()); >> >> And if writing is every the problem, it wouldn't be able to explain >> why i could send out a sms successfully using RXTX. >> > > If you have the section of code that does the communicating, could you > share it with us? This should help us tell whether it is a coding > issue or something more fundamental with RXTX. > > Andre > From netbeans at gatworks.com Tue Nov 20 06:23:26 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 20 Nov 2007 08:23:26 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: <4740C8A2.6030908@gatworks.com> Message-ID: <4742DFCE.5070504@gatworks.com> Here is the small subset of diffs just for TIOCSERGETLSR :) Next I'll pull out the usb device, and see if that also causes rxtx to spin. >> 2) TIOCSERGETLSR, need to have the simulation of it available for all >> os's . If the system has the capability, don't simulate for devices >> that have the capability. For devices that dont have the capability, >> but the OS still defines TIOCSERGETLSR, fall back to simulation. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: a Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20071120/2c5c8ee7/attachment-0003.pl From tjarvi at qbang.org Tue Nov 20 08:20:21 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Nov 2007 08:20:21 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <4742DFCE.5070504@gatworks.com> References: <4740C8A2.6030908@gatworks.com> <4742DFCE.5070504@gatworks.com> Message-ID: On Tue, 20 Nov 2007, U. George wrote: > Here is the small subset of diffs just for TIOCSERGETLSR :) > > Next I'll pull out the usb device, and see if that also causes rxtx to spin. > >>> 2) TIOCSERGETLSR, need to have the simulation of it available for all os's >>> . If the system has the capability, don't simulate for devices that have >>> the capability. For devices that dont have the capability, but the OS >>> still defines TIOCSERGETLSR, fall back to simulation. > Hi George, I'll be looking through this patch in detail tonight. I just wanted to make sure you are aware of this line in win32termios.h. The ifdef logic is messy as you noticed. That is combined with the later addition of support for it to windows. #define TIOCSERGETLSR 0x5459 (this is by far the strangest code in rxtx in retrospect) I'll be able to do extensive automated testing once we get to that point. I'm confident we can get something in that has a low probability of causing regressions. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Tue Nov 20 08:42:08 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 20 Nov 2007 10:42:08 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: <4740C8A2.6030908@gatworks.com> <4742DFCE.5070504@gatworks.com> Message-ID: <47430050.1010203@gatworks.com> It is of no difference. 1) If the define does not exist, then it should be as before. 2) If it does exist, then it should also be as before. 3) If it does exist, but the ioctl fails, then it will fallback as if it did not exist in the first place. Trent Jarvi wrote: > On Tue, 20 Nov 2007, U. George wrote: > >> Here is the small subset of diffs just for TIOCSERGETLSR :) >> >> Next I'll pull out the usb device, and see if that also causes rxtx to >> spin. >> >>>> 2) TIOCSERGETLSR, need to have the simulation of it available for >>>> all os's . If the system has the capability, don't simulate for >>>> devices that have the capability. For devices that dont have the >>>> capability, but the OS still defines TIOCSERGETLSR, fall back to >>>> simulation. >> > > Hi George, > > I'll be looking through this patch in detail tonight. I just wanted to > make sure you are aware of this line in win32termios.h. The ifdef logic > is messy as you noticed. That is combined with the later addition of > support for it to windows. > > #define TIOCSERGETLSR 0x5459 > > (this is by far the strangest code in rxtx in retrospect) > > I'll be able to do extensive automated testing once we get to that > point. I'm confident we can get something in that has a low probability > of causing regressions. > > -- > Trent Jarvi > tjarvi at qbang.org > > From netbeans at gatworks.com Tue Nov 20 08:36:56 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 20 Nov 2007 10:36:56 -0500 Subject: [Rxtx] Unplugged Opened USB devices In-Reply-To: <4742DFCE.5070504@gatworks.com> References: <4740C8A2.6030908@gatworks.com> <4742DFCE.5070504@gatworks.com> Message-ID: <4742FF18.3050005@gatworks.com> > Next I'll pull out the usb device, and see if that also causes rxtx to > spin. This is the error on a read. The select() should have failed, as well as the read(). java.io.IOException: Input/output error in nativeavailable at gnu.io.RXTXPort.nativeavailable(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1420) at jGPS.GpsData.DeviceDrivers.SerialPort.SerialPort_NMEA_GNU.serialEvent (SerialPort_NMEA_GNU.java:449) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:771) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1622) But for java program, it sees( when USB device is unplugged ) : 1) event: SerialPortEvent.DATA_AVAILABLE 2) read (non-existant) data. I think that its bad form to say DATA_AVAILABLE, when there is no data to be obtained. There does not seem to be an I/O error event. So basically, I think, and IMHO, that no events should be sent. Rather a thread timeout ( ie no data in X seconds ) AND recovery from user code should be instantiated. From manujnaman at yahoo.com Wed Nov 21 12:35:46 2007 From: manujnaman at yahoo.com (manuj naman) Date: Wed, 21 Nov 2007 11:35:46 -0800 (PST) Subject: [Rxtx] Problem reading 1-wire device using RXTX on Linux Message-ID: <371969.66249.qm@web37911.mail.mud.yahoo.com> Hello, I am trying to use the RXTX library on Ubuntu (Debian) linux to read iButtons. It works perfectly on Windows. However on my linux machines it gives the following errors. I am using DS9490 (USB port adapter) to read the iButtons. I have followed your instructions on the Wiki. I recompiled the rxtx library to produce the .so and .jar files. But still it gives me this: manujnaman at sensor:~/iButton/onewireviewer$ java -cp $CLASSPATH:./OneWireAPI.jar:./OneWireViewer.jar OneWireViewer Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Warning: serial communications API not setup properly, no ports in enumeration Pure-Java DS9097U adapter will not work, not added to adapter enum Standard drivers for 1-Wire are not found. Please download the latest drivers from http://www.ibutton.com Or install RXTX Serial Communications API from http://www.rxtx.org Do you know how to solve the "Serial communications API not setup properly, no ports in enumeration" problem? Also, how to detect which what /dev/* is the port to be used? On Windows this is simply USB1, on linux this is a bit unclear. Many thanks for your advice, Manuj Naman Dallas, TX, US manujnaman at yahoo.com --------------------------------- Be a better pen pal. Text or chat with friends inside Yahoo! Mail. See how. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071121/2760f691/attachment-0002.html From Martin.Oberhuber at windriver.com Wed Nov 21 13:55:25 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 21 Nov 2007 21:55:25 +0100 Subject: [Rxtx] Should RXTX Lixense link to LGPL-2.1 be changed? In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803A21160@ism-mail03.corp.ad.wrs.com> Hi Trent and all, In all the RXTX source files as well as http://users.frii.com/jarvi/rxtx/license.html there is the following lines: | A copy of the LGPL v 2.1 may be found at | http://www.gnu.org/licenses/lgpl.txt on March 4th 2007. A copy is | here for your convenience. But, as of today, at the link provided there is only a copy of the LGPL v3.0. I think there should be a link to the LGPL v2.1, e.g. http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html What do you think? Cheers, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Nov 21 20:46:18 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Nov 2007 20:46:18 -0700 (MST) Subject: [Rxtx] Problem reading 1-wire device using RXTX on Linux In-Reply-To: <371969.66249.qm@web37911.mail.mud.yahoo.com> References: <371969.66249.qm@web37911.mail.mud.yahoo.com> Message-ID: On Wed, 21 Nov 2007, manuj naman wrote: > Hello, > > I am trying to use the RXTX library on Ubuntu (Debian) linux to read iButtons. It works perfectly on Windows. However on my linux machines it gives the following errors. I am using DS9490 (USB port adapter) to read the iButtons. > > I have followed your instructions on the Wiki. I recompiled the rxtx library to produce the .so and .jar files. But still it gives me this: > > manujnaman at sensor:~/iButton/onewireviewer$ java -cp $CLASSPATH:./OneWireAPI.jar:./OneWireViewer.jar OneWireViewer > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > Warning: serial communications API not setup properly, no ports in enumeration > Pure-Java DS9097U adapter will not work, not added to adapter enum > > Standard drivers for 1-Wire are not found. > Please download the latest drivers from http://www.ibutton.com > Or install RXTX Serial Communications API from http://www.rxtx.org > > Do you know how to solve the "Serial communications API not setup properly, no ports in enumeration" problem? > > Also, how to detect which what /dev/* is the port to be used? On Windows this is simply USB1, on linux this is a bit unclear. Hi Manuj What is the output of the following? dmesg |grep tty touch /var/lock/test.lock && rm -f /var/lock/test.lock If you see something like /dev/ttyUSB0 in the dmesg output, what happens if you do something like tail -f /dev/ttyUSB0? These test each of the usual suspects. We are looking for missing USB drivers, no permission to create a lockfile and no read permission for the device. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Nov 21 21:05:23 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Nov 2007 21:05:23 -0700 (MST) Subject: [Rxtx] Should RXTX Lixense link to LGPL-2.1 be changed? In-Reply-To: <460801A4097E3D4CA04CC64EE648584803A21160@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803A21160@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 21 Nov 2007, Oberhuber, Martin wrote: > Hi Trent and all, > > In all the RXTX source files as well as > http://users.frii.com/jarvi/rxtx/license.html > there is the following lines: > > | A copy of the LGPL v 2.1 may be found at > | http://www.gnu.org/licenses/lgpl.txt on March 4th 2007. A copy is > | here for your convenience. > > But, as of today, at the link provided there is only > a copy of the LGPL v3.0. I think there should be a link > to the LGPL v2.1, e.g. > http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html > > What do you think? > Hi Martin, Thanks. I updated the link. Changing licences is a heavy process for me as a free software developer and an employee so I'd rather stay with 2.1 unless the current license becomes a show stopper. I figured that would happen someday so I put the date in to be clear. -- Trent Jarvi tjarvi at qbang.org From beat.arnet at gmail.com Thu Nov 22 08:45:45 2007 From: beat.arnet at gmail.com (Beat Arnet) Date: Thu, 22 Nov 2007 10:45:45 -0500 Subject: [Rxtx] Dual Core Problem Message-ID: <4745A429.9060604@gmail.com> Dear All, I am struggling with an application that uses RXTX 2.1.7 and has been working reliably in the past. When this program runs on a dual-core DELL (Intel T2500), strange things happen with the RS232 communication. The application is missing incoming characters and also often freezes when trying to close the serial port. I highly suspect a threading problem and was wondering if a) anybody had run into a similar problem with dual core processors and b) if there is a list of does and dont's when it comes to RXTX and threads. Regards, Beat From tjarvi at qbang.org Thu Nov 22 13:22:43 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 22 Nov 2007 13:22:43 -0700 (MST) Subject: [Rxtx] Dual Core Problem In-Reply-To: <4745A429.9060604@gmail.com> References: <4745A429.9060604@gmail.com> Message-ID: On Thu, 22 Nov 2007, Beat Arnet wrote: > Dear All, > I am struggling with an application that uses RXTX 2.1.7 and has been > working reliably in the past. When this program runs on a dual-core DELL > (Intel T2500), strange things happen with the RS232 communication. The > application is missing incoming characters and also often freezes when > trying to close the serial port. I highly suspect a threading problem > and was wondering if a) anybody had run into a similar problem with dual > core processors and b) if there is a list of does and dont's when it > comes to RXTX and threads. > I've used rxtx with SMP systems but have not experimented very much with threading and rxtx. One red flag rxtx raises is it stores pointers to java objects in SerialImp.c. If the JVM decides to move things around, rxtx becomes confused. Missing incomming characters is usually caused by someone running two applications. They then fight over the incomming data. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Fri Nov 23 03:12:28 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 23 Nov 2007 11:12:28 +0100 Subject: [Rxtx] Dual Core Problem In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803A84C59@ism-mail03.corp.ad.wrs.com> > Missing incomming characters is usually caused by someone running two > applications. They then fight over the incomming data. I've seen exactly this scenario on Linux with Lockfiles disabled. Usually, port locking (through Lockfiles or Ioctl method) should avoid exactly this problem. I know that on Mac, port locking through Kernel/Ioctl method has been added for the upcoming RXTX 2.1-8. What's the status of this feature for Linux and other Unixes? Cheers, Martin From chris.paton at red61.com Fri Nov 23 05:26:10 2007 From: chris.paton at red61.com (Chris Paton) Date: Fri, 23 Nov 2007 12:26:10 +0000 Subject: [Rxtx] RXTX parallel port issues Message-ID: <4746C6E2.3000304@red61.com> Hi there, I've been happily using RXTX to communicate with a serial based point-of-sale printer for a several months. I've recently received a parallel based printer and have been trying to get RXTX to talk to this too. I've encountered a few problems along the way and just wanted to check if I'm doing anything wrong, or if I've found any bugs. Writing ------- Writing to the parallel port using ParallelPort.getOutputStream works well, except when I use OutputStream.write(byte[]) to write a multiple of 8 bytes (!). Doing this causes the JVM to crash with an EXCEPTION_PRIV_INSTRUCTION on Windows. I worked around this in my application by adding an additional byte if bytesToWrite % 8 == 0. I guess I could also have called write(byte) repeatedly. This also generated a SIGSEGV on Linux but I was unable to reproduce it today using the CVS version of RXTX and a recent kernel. Reading status pins ------------------- On Linux, I've found that ParallelPort.isPaperOut and ParallelPort.isPrinterSelected appear to be inverted; i.e. when the paper is out ParallelPort.isPaperOut returns false, and when there is paper ParallelPort.isPaperOut returns true! I've tested this in both Sun JDK5 and JDK6 on machines running Linux 2.6.21 and 2.6.23. Fortunately it's easy to use a conditional based on System.getProperty("os.name") to hack around this. Reading from InputStream ------------------------ I've had more serious issues trying to read from ParallelPort.getInputStream. On Windows, readByte seems to return -1 (end of stream) any time data isn't available. On Linux, I got a kernel oops, even with a recent 2.6.23.1 kernel. I was able to stop this using a kernel patch that I found via Google. Although this stopped the oops, I still get frequent IOExceptions when calling InputStream.readByte. It appears that instead of blocking, readByte throws an IOException with message "Resource temporarily unavailable in readByte" any time it is called when no data is available. Occasionally, I get an exception instead of the data I was expecting to read, e.g when asking my printer for a version string I get "VER: S3306 * 06.03* 10/*6/06" where the *s indicate that an exception occurred and data was missed. Any advice that anyone can offer would be much appreciated. If you need any more details or debugging information about any of these problems then let me know. Cheers -- Chris Paton Technical Developer Red61 -- Transaction Marketing Software http://www.red61.com -------------- next part -------------- A non-text attachment was scrubbed... Name: chris.paton.vcf Type: text/x-vcard Size: 230 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20071123/00a747b6/attachment.vcf From chris.paton at red61.com Fri Nov 23 05:26:10 2007 From: chris.paton at red61.com (Chris Paton) Date: Fri, 23 Nov 2007 12:26:10 +0000 Subject: [Rxtx] RXTX parallel port issues Message-ID: <4746C6E2.3000304@red61.com> Hi there, I've been happily using RXTX to communicate with a serial based point-of-sale printer for a several months. I've recently received a parallel based printer and have been trying to get RXTX to talk to this too. I've encountered a few problems along the way and just wanted to check if I'm doing anything wrong, or if I've found any bugs. Writing ------- Writing to the parallel port using ParallelPort.getOutputStream works well, except when I use OutputStream.write(byte[]) to write a multiple of 8 bytes (!). Doing this causes the JVM to crash with an EXCEPTION_PRIV_INSTRUCTION on Windows. I worked around this in my application by adding an additional byte if bytesToWrite % 8 == 0. I guess I could also have called write(byte) repeatedly. This also generated a SIGSEGV on Linux but I was unable to reproduce it today using the CVS version of RXTX and a recent kernel. Reading status pins ------------------- On Linux, I've found that ParallelPort.isPaperOut and ParallelPort.isPrinterSelected appear to be inverted; i.e. when the paper is out ParallelPort.isPaperOut returns false, and when there is paper ParallelPort.isPaperOut returns true! I've tested this in both Sun JDK5 and JDK6 on machines running Linux 2.6.21 and 2.6.23. Fortunately it's easy to use a conditional based on System.getProperty("os.name") to hack around this. Reading from InputStream ------------------------ I've had more serious issues trying to read from ParallelPort.getInputStream. On Windows, readByte seems to return -1 (end of stream) any time data isn't available. On Linux, I got a kernel oops, even with a recent 2.6.23.1 kernel. I was able to stop this using a kernel patch that I found via Google. Although this stopped the oops, I still get frequent IOExceptions when calling InputStream.readByte. It appears that instead of blocking, readByte throws an IOException with message "Resource temporarily unavailable in readByte" any time it is called when no data is available. Occasionally, I get an exception instead of the data I was expecting to read, e.g when asking my printer for a version string I get "VER: S3306 * 06.03* 10/*6/06" where the *s indicate that an exception occurred and data was missed. Any advice that anyone can offer would be much appreciated. If you need any more details or debugging information about any of these problems then let me know. Cheers -- Chris Paton Technical Developer Red61 -- Transaction Marketing Software http://www.red61.com -------------- next part -------------- A non-text attachment was scrubbed... Name: chris.paton.vcf Type: text/x-vcard Size: 230 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20071123/00a747b6/attachment-0001.vcf From hho at bibliotheca.dk Fri Nov 23 06:45:36 2007 From: hho at bibliotheca.dk (Hans Hvelplund Odborg) Date: Fri, 23 Nov 2007 14:45:36 +0100 Subject: [Rxtx] RXTX parallel port issues In-Reply-To: <4746C6E2.3000304@red61.com> References: <4746C6E2.3000304@red61.com> Message-ID: <001201c82dd7$21c6e2c0$6a37a8c0@HANSLAPTOP> I've experienced similar crashes in JVM when writing to the parallel port in windows (with rxtx). Unfortunately I did not save the data sent to the parallel port so cannot say anything about the length. Furthermore, I recall having problems with .write(byte) (would never exit if I recall correctly), but I do not recall if this was with serial or parallel or both. In the end, we ended printing through Java's support of the windows driver. Unfortunately I currently don?t have the time to investigate these issues further. I just wanted to let you know that currently there are bugs in rxtx. Med venlig hilsen / Best regards / Med v?nliga h?lsningar Hans Hvelplund Odborg BIBLIOTHECA A/S Vallensb?kvej 20B ? 2605 Br?ndby ? Denmark Tel.: +45 70271008 Fax: +45 70271009 hho at bibliotheca.dk www.bibliotheca.dk -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Chris Paton Sent: 23. november 2007 13:26 To: rxtx at qbang.org Subject: [Rxtx] RXTX parallel port issues Hi there, I've been happily using RXTX to communicate with a serial based point-of-sale printer for a several months. I've recently received a parallel based printer and have been trying to get RXTX to talk to this too. I've encountered a few problems along the way and just wanted to check if I'm doing anything wrong, or if I've found any bugs. Writing ------- Writing to the parallel port using ParallelPort.getOutputStream works well, except when I use OutputStream.write(byte[]) to write a multiple of 8 bytes (!). Doing this causes the JVM to crash with an EXCEPTION_PRIV_INSTRUCTION on Windows. I worked around this in my application by adding an additional byte if bytesToWrite % 8 == 0. I guess I could also have called write(byte) repeatedly. This also generated a SIGSEGV on Linux but I was unable to reproduce it today using the CVS version of RXTX and a recent kernel. Reading status pins ------------------- On Linux, I've found that ParallelPort.isPaperOut and ParallelPort.isPrinterSelected appear to be inverted; i.e. when the paper is out ParallelPort.isPaperOut returns false, and when there is paper ParallelPort.isPaperOut returns true! I've tested this in both Sun JDK5 and JDK6 on machines running Linux 2.6.21 and 2.6.23. Fortunately it's easy to use a conditional based on System.getProperty("os.name") to hack around this. Reading from InputStream ------------------------ I've had more serious issues trying to read from ParallelPort.getInputStream. On Windows, readByte seems to return -1 (end of stream) any time data isn't available. On Linux, I got a kernel oops, even with a recent 2.6.23.1 kernel. I was able to stop this using a kernel patch that I found via Google. Although this stopped the oops, I still get frequent IOExceptions when calling InputStream.readByte. It appears that instead of blocking, readByte throws an IOException with message "Resource temporarily unavailable in readByte" any time it is called when no data is available. Occasionally, I get an exception instead of the data I was expecting to read, e.g when asking my printer for a version string I get "VER: S3306 * 06.03* 10/*6/06" where the *s indicate that an exception occurred and data was missed. Any advice that anyone can offer would be much appreciated. If you need any more details or debugging information about any of these problems then let me know. Cheers -- Chris Paton Technical Developer Red61 -- Transaction Marketing Software http://www.red61.com From keithvz at verizon.net Thu Nov 1 08:08:58 2007 From: keithvz at verizon.net (Keith) Date: Thu, 01 Nov 2007 10:08:58 -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: <4729DDFA.7080206@verizon.net> Trent Jarvi wrote: > 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? Well, I honestly don't know how all this fits together. I think it's just a matter of enabling the right flow control option within the standard serial framework to tell the device driver, "HEY START USING DTR/DSR FOR FLOW CONTROL." If what UGeorge said,(about that type of nitty-gritty lead control being done within the device driver), is true, then this confirms my suspicion. I tried narrowing down within the Linux drivers what you are looking for, but I can't entirely tell wth I'm looking at. (virtual com port drivers -- they are included compiled by default with Ubuntu, source included) http://www.ftdichip.com/Drivers/VCP/Linux/ftdi_sio.tar.gz Hahahaa, they make a reference to DTR flow control being supported but say (UGH) in parenthesis. You can also use their direct device driver library on Ubuntu -- libftd2xx.so.0.4.13. No source code. http://www.ftdichip.com/Drivers/D2XX/Linux/libftd2xx0.4.13.tar.gz In that case, you make a call to their FT_SetFlowControl() function. FT_STATUS FT_SetFlowControl (FT_HANDLE ftHandle, USHORT usFlowControl, UCHAR uXon,UCHAR uXoff) Parameters ftHandle Handle of the device. usFlowControl Must be one of FT_FLOW_NONE, FT_FLOW_RTS_CTS, ****FT_FLOW_DTR_DSR**** or FT_FLOW_XON_XOFF. uXon Character used to signal Xon. Only used if flow control is FT_FLOW_XON_XOFF. uXoff Character used to signal Xoff. Only used if flow control is FT_FLOW_XON_XOFF. This is from their programming guide http://www.ftdichip.com/Documents/ProgramGuides/D2XXPG34.pdf I actually want to take this a step further and say that I think the flow control is actually handled right on the device itself in hardware/firmware. It's enabled through the device driver, but I think the maintaining of buffers, asserting/deasserting of leads, etc is handled by the device. For the time being, I've switched to jd2xx, https://jd2xx.dev.java.net/ and http://bleyer.org/jd2xx/ These are Java wrappers for the device driver libraries. It allows almost direct access to the well-documented device drivers from Java. I hope this helps Keith From tjarvi at qbang.org Thu Nov 1 11:09:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:09:51 -0600 (MDT) 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: Hi Martin, What I usually have done is allow changes that do not impact working software including changes to methods not documented in CommAPI (which remain undocumented in rxtx) and fixes to known problems in the documented portions. That way if you use the documented API, the releases should only become better with time. If you use the undocumented portions, the behavior is not as predictable but open for improvement. On Wed, 31 Oct 2007, 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 >> > From tjarvi at qbang.org Thu Nov 1 11:15:52 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:15:52 -0600 (MDT) 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: I too use rxtx in commercial products. The problem I've been trying to address while bringing the server back was how to make it possible for hobby folks to build the same software as companies so we can move rxtx along a little faster. Exposing internal tools is not an option at this time, the public rxtx builds have been done on my home machine which has drives hanging out of it all over the place dying one at a time. This isn't maintainable. I'm currently looking at the possibility of making an S3 image available on Amazon's EC. These are machines you can rent for ~10 cents an hour which is more than enough to build rxtx. The S3 image is not changed when people use it so everyone has the same starting point. With this, we could all build rxtx for ~20 platforms for a small price and eliminate tool issues. On Wed, 31 Oct 2007, Greg Johnson wrote: > 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 tjarvi at qbang.org Thu Nov 1 11:19:55 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:19:55 -0600 (MDT) 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: On Wed, 31 Oct 2007, 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. I was helping Dmitry do the Mac OS X port without access to a machine when we put that in. In the archives there is information (easily found with google on Apple's site) that describes how their API (and others) can determine if a port is used and ignore it. I think these changes are in CVS but need to confirm. The bottom line is that rxtx should not have used lock files on Mac. It was just ignorance of the system on my part. -- Trent Jarvi tjarvi at qbang.org From fabioanjos at gmail.com Thu Nov 1 12:35:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Thu, 1 Nov 2007 15:35:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Hi, I was using SerialEventListener in my project. But, as was said here, id doesnt work very well with virtual serial ports. So, I changed the strategy using the code posted here in this thread: try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > 0) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } The thing is that in my tests I could notice that in.read(buffer) never blocks. Even when there's nothing to read. Instead of blocking when there's nothing to read it returns 0. So, my questions are: 1. Am I doing something wrong? 2. If not, wouldnt this decrease performance? (the thread would be locked in a loop that does nothing.) 3. Is there a better way to do the job? Thanks in advance!! F?bio -------- On 10/31/07, Andre-John Mas wrote: > > > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/0aee59d0/attachment-0024.html From ajmas at sympatico.ca Thu Nov 1 16:07:55 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Nov 2007 18:07:55 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Message-ID: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From sarah_662005 at yahoo.com Thu Nov 1 17:10:05 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Thu, 1 Nov 2007 16:10:05 -0700 (PDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Message-ID: <351433.37166.qm@web55814.mail.re3.yahoo.com> Thank you very much for your help. Now the application works fine. the serialEvent gets triggered. Rxtx is cool! ----- Original Message ---- From: Andre-John Mas To: Sara Hugh ; RXTX Developers and Users Sent: Wednesday, October 31, 2007 9:55:45 AM Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered 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 __________________________________________________ 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/20071101/4a86bea6/attachment-0024.html From tjarvi at qbang.org Thu Nov 1 17:58:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 17:58:02 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx Message-ID: The rxtx.org site is primarily interested in the hobby aspects of rxtx. Obviously, there are some companies following the work too. These interests bring larger workflows and concerns about details hobby folks may not care about. They also bring many more users. I know the company I work for has a quality engineering effort going on which includes rxtx. While the server was down, I was contacted by another company that was missing the binaries for their testing. Several people have mentioned concerns about a stable release for like reasons. Would there be interest on the quality side of the coin to get together? It could be just sharing email's with each other or a seperate list for QE/QA. I can not say for sure, but we may be able to share some of our efforts/results that could help keep rxtx releases stable. -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Fri Nov 2 01:42:55 2007 From: scldad at sdc.com.au (Stephen Davies) Date: Fri, 2 Nov 2007 18:12:55 +1030 Subject: [Rxtx] Multiple modems Message-ID: <200711021812.56047.scldad@sdc.com.au> This may or may not be related to the Multiple Ports thread. I have an application which uses rxtx on Linux (via cron jobs) to connect multiple modems to remote sensing devices. The application works fine most of the time but occasionally fails to connect if two (or more) connection attempts happen at about the same time. When it fails, it looks as if it may get confused as to which port it is talking to. The app has a "base" component that looks for an available port, opens it and then creates an input thread and an output thread for the connection and data transfer. The "base" component uses this code: // loop round all known ports until one is available. Give up after three minutes Counter ptimeout = new Counter(); while(!portFound && ptimeout.elapsed() < 180000) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // special case. ttyS0 is not available to us on this server. if (!portId.isCurrentlyOwned() && !portId.getName().equals("/dev/ttyS0")) { gLog.debug(lognm + ": Found port " + portId.getName()); try { serialPort = (RXTXPort) portId.open("AguaModem", 10000); } catch (Exception e) { gLog.error(lognm + ": Port " + portId.getName() + " will not open."); gLog.error(e.getMessage()); continue; } AguaModem aguamodem = new AguaModem(); portFound = true; break; } gLog.debug(lognm + ": Port " + portId.getName() + " is busy"); } } } I am wondering about the isCurrentlyOwned method. Does this actually tell me whether a port is currently being used by another process? TIA, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From fabioanjos at gmail.com Fri Nov 2 04:59:58 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 07:59:58 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Message-ID: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/9009eb1d/attachment-0024.html From netbeans at gatworks.com Fri Nov 2 06:28:13 2007 From: netbeans at gatworks.com (U. George) Date: Fri, 02 Nov 2007 08:28:13 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <472B17DD.1050508@gatworks.com> It should normally block ( unless eof / event ) . so its a :{ whats the device ( to recreate if possible ) and how do u open. > My question is, is there a way to make in.read block the thead until > there's something to read? > From fabioanjos at gmail.com Fri Nov 2 06:34:46 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 09:34:46 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > On 11/1/07, Andre-John Mas wrote: > > > > Fabio, > > > > Turns out there was a small error in my example. The test should be: > > > > (numBytes = in.read(buffer)) > -1 > > > > This is because -1 indicates an end of file (end of data stream) > > > > Andre > > > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > > > Hi, > > > > > > I was using SerialEventListener in my project. But, as was said > > > here, id doesnt work very well with virtual serial ports. > > > So, I changed the strategy using the code posted here in this thread: > > > > > > try{ > > > in = port.getInputStream(); > > > out = port.getOutputStream(); > > > int numBytes = 0; > > > while(active){ > > > > > > byte[] buffer = new byte[10]; > > > > > > while ( (numBytes = in.read(buffer)) > 0) > > > { > > > String dataValue = new String(buffer,0,numBytes); > > > processInput(dataValue); > > > } > > > > > > if(numBytes==-1){ > > > break; > > > } > > > > > > Thread.sleep(50); > > > } > > > > > > }catch(IOException e){ > > > logger.info("falha de comunicacao "+ > > > getReceptor().getPort() ); > > > > > > }catch(InterruptedException e){ > > > logger.info ("Interrompendo leitura da porta "+ > > > getReceptor().getPort() ); > > > } > > > > > > The thing is that in my tests I could notice that in.read(buffer) > > > never blocks. Even when there's nothing to read. Instead of blocking > > > when there's nothing to read it returns 0. > > > > > > So, my questions are: > > > > > > 1. Am I doing something wrong? > > > 2. If not, wouldnt this decrease performance? (the thread would be > > > locked in a loop that does nothing.) > > > 3. Is there a better way to do the job? > > > > > > Thanks in advance!! > > > > > > F?bio > > > -------- > > > > > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > > 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 > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > > > > > -- > > > Atenciosamente, > > > F?bio Cristiano dos Anjos > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/5306c4b1/attachment-0024.html From nick.circelli at infrasafe.com Fri Nov 2 07:01:17 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Fri, 2 Nov 2007 08:01:17 -0500 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com><29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com><90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca><29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Message-ID: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> I'm pretty sure that not blocking has to do with you virtual ports. Cause it should block. Maybe you should try: while ((numBytes = in.available()) > 0) { If (numBytes > buffer.length) { numBytes = buffer.length; // in case you have buffer overflow } numBytes = in.read(buffer, 0 , numBytes)); String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } Also, just for optimization, I'd move that byte[] buffer = new byte[10]; out of the while since you don't need to reallocate it every iteration. ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of F?bio Cristiano dos Anjos Sent: Friday, November 02, 2007 8:35 AM To: RXTX Developers and Users Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream (); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas < ajmas at sympatico.ca > wrote: Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info ("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Atenciosamente, F?bio Cristiano dos Anjos -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/4de7f6a3/attachment-0024.html From fabioanjos at gmail.com Fri Nov 2 07:36:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 10:36:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> Message-ID: <29788b250711020636q1588c88fgaa5e27f5504164fb@mail.gmail.com> Hi Nick, Actually, it doesnt block for physical ports too. And, the method avaiable does not block either, so when there's nothing avaiable the loop ends and the thread stops lintening to the port. But I did some more test with serialEventListener, and now its working. I realy dont know what I've done to get it working. I just start woking as soon as I decided to test it again. It was said here that serialEventListener is not reliable for virtual serial ports. Is there another way to read it, without compromising performance? Tanks again!! F?bio ------- On 11/2/07, Nick Circelli wrote: > > I'm pretty sure that not blocking has to do with you virtual ports. > Cause it should block. > > Maybe you should try: > > > > while ((numBytes = in.available()) > 0) > > { > > If (numBytes > buffer.length) { > > numBytes = buffer.length; // in case you have buffer overflow > > } > > numBytes = in.read(buffer, 0 , numBytes)); > > String dataValue = new String(buffer,0,numBytes,"ASCII"); > > processInput(dataValue); > > } > > > > Also, just for optimization, I'd move that byte[] buffer = new > byte[10]; > > out of the while since you don't need to reallocate it every iteration. > > > ------------------------------ > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On Behalf > Of *F?bio Cristiano dos Anjos > *Sent:* Friday, November 02, 2007 8:35 AM > *To:* RXTX Developers and Users > *Subject:* Re: [Rxtx] serialEvent(SerialPortEvent event) never be > triggered > > > > Hi, > > I think i missunderstand something here. > The code you post here was meant to be used inside serialEvent method, > right? > > The think is, that i cannot user SerialEventListener to read serial ports, > because i need to read virual serial ports and id does not behaves well, as > said here before. serialEvent is never triggered. > > So what I quit using SerialEventListener and created a thread to listen to > the port: > > public void run(){ > try{ > in = port.getInputStream(); > out = port.getOutputStream (); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new > String(buffer,0,numBytes,"ASCII"); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ getReceptor().getPort() > ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > } > > > So, the problem is that in.read(buffer) always returns 0 when there is > nothing to read, instead of blocking the flow, and the thread becames locked > in the loop. > > I hope you can help me solve this. > > Thanks in advance! > > F?bio > -------- > > On 11/2/07, *F?bio Cristiano dos Anjos* wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > > > On 11/1/07, *Andre-John Mas* < ajmas at sympatico.ca> wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info ("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/571df6ea/attachment-0023.html From tjarvi at qbang.org Fri Nov 2 08:32:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Nov 2007 08:32:15 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: References: Message-ID: On Fri, 2 Nov 2007, Greg Johnson wrote: > Hi Trent, folks, > Having a single rxtx that is suitable for commercial uses and hobbyists both > would be a great idea? Perhaps it would be worth submitting rxtx as a > proposal to Codehaus - they not only provide excellent tools (Jira (bug > tracker), Confluence (wiki)) but also support build management ( > maestro, continuum, bamboo). Relying on your personal machine (btw, frii.com > / rxtx.org is down again?) seems like a burden you shouldn't have to shoulder > alone. Hi Greg, There may be a little confusion here. There is no need to have two seperate rxtx releases. What I'm trying to encourage is a discussion between some of the people responsible for making sure rxtx does not break their products each release. Usually these people are interested in testing a set of functionality their product depends upon. They do not work with rxtx code but rather traps to catch when rxtx developers break something. This goes on all the time in isolated labs. There are many services that offer to do various pieces of a project for you if you... Anyone is free to do the 'if you' portion with rxtx and see how it goes. I'm actually interested in doing less of that than more. The rxtx.org work I do just happens to overlap with other things I do for personal/family use. The reason I suggest the amazon solution is that anyone can take full control of the environment for a day and it costs less than a package of gum without causing harm to what anyone else is doing. I assume the down question was with respect to a mod_security setting that has been resolved. If not, please post a url to the problem. -- Trent Jarvi tjarvi at qbang.org From nsayer at kfu.com Sat Nov 3 20:17:49 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 19:17:49 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? Message-ID: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Has anyone got RXTX working with an app under Leopard? My app hangs on port open (it works fine with Tiger). The relevant thread looks like this in the activity monitor: 1536 JVM_InvokeMethod 1536 0x48ccd0 1536 0x46f8a0 1536 0x4c3ff4 1536 0x4c4284 1536 0x357d160 1536 0x357faac 1536 Java_gnu_io_RXTXPort_open 1536 open $NOCANCEL$UNIX2003 1536 open $NOCANCEL$UNIX2003 From ajmas at sympatico.ca Sat Nov 3 22:02:04 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 00:02:04 -0400 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> RXTX works for me with Leopard. I am currently using it communicate with a Bluetooth GPS. What computer and device are you trying to use? Is the driver for your serial device compatible with MacOS X 10.5? Andre On 3-Nov-07, at 22:17 , Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From nsayer at kfu.com Sat Nov 3 22:17:47 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 21:17:47 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> Message-ID: <1720F723-3643-438C-B3AB-E09A67536977@kfu.com> On Nov 3, 2007, at 9:02 PM, Andre-John Mas wrote: > RXTX works for me with Leopard. I am currently using it communicate > with a Bluetooth GPS. > > What computer and device are you trying to use? Is the driver for > your serial device compatible with MacOS X 10.5? An Intel mac mini The FTDI USB serial driver an XMPCR, which is just a fancy serial controlled radio and an FTDI usb-to-serial chip I've successfully used the FTDI driver with another FTDI device in another context. > > > Andre > > On 3-Nov-07, at 22:17 , Nick Sayer wrote: > >> Has anyone got RXTX working with an app under Leopard? >> >> My app hangs on port open (it works fine with Tiger). The relevant >> thread looks like this in the activity monitor: >> >> 1536 JVM_InvokeMethod >> 1536 0x48ccd0 >> 1536 0x46f8a0 >> 1536 0x4c3ff4 >> 1536 0x4c4284 >> 1536 0x357d160 >> 1536 0x357faac >> 1536 >> Java_gnu_io_RXTXPort_open >> 1536 open >> $NOCANCEL$UNIX2003 >> 1536 open >> $NOCANCEL$UNIX2003 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From racecar at gmail.com Sat Nov 3 22:25:53 2007 From: racecar at gmail.com (Kevin Mateo Lim) Date: Sat, 3 Nov 2007 21:25:53 -0700 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: Message-ID: I am alternating between two errors. After i run the macosx_setup.command, "everyone" is set to Read only in /var/lock. I notice in the terminal that the group for these perms is _uucp, not uucp. In that state, I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 check_group_uucp(): error testing lock file creation Error details:Permission deniedcheck_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException : Error inside Serial.() at processing.serial.Serial.errorMessage(Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.( Serial.java:102) at Temporary_829_3245.setup(Temporary_829_3245.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java :690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) Then, I hand edit the "everyone" permissions for /var/lock/ to Read and Write (note /var/spool/uucp is Read/Write in all cases, and doesn't change). I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX uucp_lock() /var/lock/LK.003.009.000 is there gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException: Error inside Serial.() at processing.serial.Serial.errorMessage (Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.(Serial.java:102) at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java:690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) See here: http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071103/f1a2c467/attachment-0022.html From greg.johnson at manchester.ac.uk Sun Nov 4 02:31:13 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sun, 4 Nov 2007 10:31:13 +0100 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <28B5E0A0-0802-4C74-AC21-87ED35F3B9A2@manchester.ac.uk> Hi Nick, I also had problems initially with Leopard, but it was resolved by reinstalling the serial USB driver (FTDI in my case). The symptoms were a non-detection of any ports (but I twigged when I tried ZTerm and it had the same problem). Good luck! Cheers, greg PS I did a "Archive and install" which may be the reason my FTDI driver had disappeared - I don't think the driver has changed for 10.5 ------------------------------------------------------------------------- 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 4 Nov 2007, at 03:17, Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Sun Nov 4 13:01:12 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 15:01:12 -0500 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: Message-ID: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Hi, You will need to get the 2.1-8 code from CVS. See the FAQ for more information: http://rxtx.qbang.org/wiki/index.php/FAQ Andre On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > I am alternating between two errors. > > After i run the macosx_setup.command, "everyone" is set to Read only > in /var/lock. I notice in the terminal that the group for these > perms is _uucp, not uucp. > > In that state, I get this error: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > check_group_uucp(): error testing lock file creation Error > details:Permission deniedcheck_lock_status: No permission to create > lock file. > please see: How can I use Lock Files with rxtx? in INSTALL > gnu.io.PortInUseException: Unknown Application > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > java.lang.RuntimeException : Error inside Serial.() > > at processing.serial.Serial.errorMessage(Serial.java:583) > > at processing.serial.Serial.(Serial.java:148) > > at processing.serial.Serial.( Serial.java:102) > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > at processing.core.PApplet.run(PApplet.java:1556) > > at java.lang.Thread.run(Thread.java:613) > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > and Write (note /var/spool/uucp is Read/Write in all cases, and > doesn't change). I get this error: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > gnu.io.PortInUseException: Unknown Application > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > java.lang.RuntimeException: Error inside Serial.() > > at processing.serial.Serial.errorMessage (Serial.java:583) > > at processing.serial.Serial.(Serial.java:148) > > at processing.serial.Serial.(Serial.java:102) > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > at processing.core.PApplet.run(PApplet.java:1556) > > at java.lang.Thread.run(Thread.java:613) > > See here: > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From netbeans at gatworks.com Sun Nov 4 14:33:35 2007 From: netbeans at gatworks.com (U. George) Date: Sun, 04 Nov 2007 16:33:35 -0500 Subject: [Rxtx] #ifndef TIOCSERGETLSR Message-ID: <472E3AAF.7050709@gatworks.com> For Linux, it seems that you need the code for both *having* a TIOCSERGETLSR, and *not having* a TIOCSERGETLSR. Maybe the ioctl exists system wide, but not necessarily for the device driver itself ( always returns -1 ) . Are there systems that have a *functioning* TIOCSERGETLSR for all their devices? Then this would be the case where the "#ifndef TIOCSERGETLSR" directive could be useful is eliminating the unnecessary code and tests. And for those systems that dont have a TIOCSERGETLSR, then the code for TIOCSERGETLSR can be eliminated. It would be a simple case to have, as a foundation, all the code to simulate the missing TIOCSERGETLSR ioctl. If the system does have the ioctl, then that code can be ifdef'd in, and co-exist with the functionality of the code that simulates the missing TIOCSERGETLSR ioctl. From racecar at gmail.com Sun Nov 4 17:30:19 2007 From: racecar at gmail.com (Kevin Mateo Lim) Date: Sun, 4 Nov 2007 17:30:19 -0700 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: the README.OSX reads: Put libSerial.jnilib in the directory of the application (the JavaVM will find it there). Add RXTXComm.jar to the application classpath or include the classes in the application jar. (Some applications already include the RXTX classes in their application jar, in which case only the file libSerial.jnilib is required). I can't find libSerial.jnilib I put librxtxSerial.jnilib into my Processing /libraries/serial/library/ directory. Yet it still sees the old version: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 On 11/4/07, Andre-John Mas wrote: > > Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > 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/20071104/c0a83f91/attachment-0021.html From ajmas at sympatico.ca Sun Nov 4 17:41:47 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 19:41:47 -0500 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> If you are wanting it to be available for all applications, - for all users: /Library/Java/Extensions - for your user: ~/Library/Java/Extensions Or just for your application, then it should be in the same directory from which yo are launching your application. If you are getting the 2.1-8 source, then the library built is called: librxtxSerial.jnilib despite what the docs say. Andre On 4-Nov-07, at 19:30 , Kevin Mateo Lim wrote: > > the README.OSX reads: > Put > libSerial.jnilib > in the directory of the application (the JavaVM will find it there). > Add > RXTXComm.jar > to the application classpath or include the classes in the > application jar. > (Some applications already include the RXTX classes in their > application jar, > in which case only the file libSerial.jnilib is required). > > > I can't find libSerial.jnilib > I put librxtxSerial.jnilib into my Processing /libraries/serial/ > library/ directory. > > Yet it still sees the old version: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > On 11/4/07, Andre-John Mas wrote: Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial .(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay (PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > From bschlining at gmail.com Sun Nov 4 19:46:23 2007 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 4 Nov 2007 18:46:23 -0800 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> Message-ID: > > Or just for your application, then it should be in the same directory > from which yo are launching your application. Just wanted to add one more way of specifying the native lib location... If you don't want to define it globally by putting it in /Library/Java/Extensions (and you don't, it's a very very bad practice) you can also specify the location of the native library when starting the JVM by specifying the 'java.library.path' property. For example: java -Djava.library.path=/Path/To/Directory/With/RXTX/Library YourMainClass -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071104/c5af6980/attachment-0021.html From greg.johnson at manchester.ac.uk Mon Nov 5 01:39:02 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Mon, 5 Nov 2007 09:39:02 +0100 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: The 2.1-8 code reports 2.1-7, hence your (and my) confusion. But as long as you've removed all traces of the old library, it really _is_ 2.1-8. And if you specify the library path to the VM, don't make my mistake (on OSX at least) - you need to respecify the entire library path it had by default, as the command line argument replaces the path, rather than appending to it. 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 5 Nov 2007, at 01:30, Kevin Mateo Lim wrote: > > the README.OSX reads: > Put > libSerial.jnilib > in the directory of the application (the JavaVM will find it there). > Add > RXTXComm.jar > to the application classpath or include the classes in the > application jar. > (Some applications already include the RXTX classes in their > application jar, > in which case only the file libSerial.jnilib is required). > > > I can't find libSerial.jnilib > I put librxtxSerial.jnilib into my Processing /libraries/serial/ > library/ directory. > > Yet it still sees the old version: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > On 11/4/07, Andre-John Mas wrote: > Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial .(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay (PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > 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 HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071105/7f50506d/attachment-0021.html From cyrille.dumont at tatexpress.fr Mon Nov 5 05:46:03 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 05 Nov 2007 13:46:03 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: References: <472727F1.1000704@tatexpress.fr> Message-ID: <472F108B.2090101@tatexpress.fr> Thanks a lot for your solution ... but I'm not a expert in JAVA ... (sorry) For the moment I've this function : """ public void serialEvent(SerialPortEvent e) { StringBuffer inputBuffer = new StringBuffer(); int newData = 0; switch (e.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } //-- Manag. Data from Scanner this.MngDataScanner(inputBuffer.toString()); break; case SerialPortEvent.BI:; //-- Break Received } } """ How can I do what you write ? ( maybe a simple ex ? ) PS : I don't know the PDF417 size (could be, for example, 338 char, or 500 ... ; what I know is that it can't be more than 800 char) Thanks in advance. Best regards. Trent Jarvi a ?crit : > 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 Martin.Oberhuber at windriver.com Mon Nov 5 08:47:50 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 5 Nov 2007 16:47:50 +0100 Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> Hi Trent, are the interestes of hobbyists really so different from commercial ones? Both should be interested in high quality and innovation the like. I haven't seen too many Open Source projects from the "inside" but those that I have seen did not have separate mailing lists for quality/testing/qa versus innovation/development. What I have seen with the Open Source projects that one would call "successful" is a good deal of process around automated builds, automated unit tests, predictable release dates and milestones, and policies around commiting/contributing/reviewing changes. I think that all of these benefit commercial users and hobbyists the like. If you were just asking about who's interested in discussing changes to foster more quality, count me in. I'm just not sure whether discussing these on a separate mailing list or other channel is the right thing to do. Cheers, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From toupsz at cs.tamu.edu Tue Nov 6 14:27:04 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 15:27:04 -0600 Subject: [Rxtx] reading TTL level signals from serial? Message-ID: Dear RXTX community- I've been using RXTX to handle communicating with several hardware devices in Java (a GPS and some custom audio circuitry for my dissertation work). I have a new, high-accuracy GPS which only communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there any way to communicate with this device using RXTX, perhaps by modding the native code for Windows? If so, does anyone have any tips on how to do it? Has it perhaps already been done? Another option is for me to invert / amplify the signal in hardware, but this is difficult for me to pull off due to the sensitivity of the electronics involved...I'll likely end up using a much less accurate piece of equipment rather than go that far! If anyone could help out, I'd really appreciate it! Thanks! -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/b6c59c2b/attachment-0019.html From netbeans at gatworks.com Tue Nov 6 14:55:22 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 06 Nov 2007 16:55:22 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: Message-ID: <4730E2CA.3090009@gatworks.com> This is really a hardware issue. Is there any device ( ie the serial port ) on your computer that will accept the voltage signals ( and load ) that your device produces? Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it happen safely ( ie u dont cook the GPS device ) I have a new, high-accuracy GPS which only > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there > any way to communicate with this device using RXTX, From toupsz at cs.tamu.edu Tue Nov 6 15:14:01 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 16:14:01 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4730E2CA.3090009@gatworks.com> References: <4730E2CA.3090009@gatworks.com> Message-ID: Actually, the device runs over USB, but shows up as a virtual serial port and is outputting these signals. The software that comes with the device (a u-blox ANTARIS 4 eval kit) is able to communicate. RXTX is able to detect and properly configure the port, but does not get any of the data from it. :-/ It seems like there must be some way to do it (obviously, ublox knows how)... -Zach On Nov 6, 2007 3:55 PM, U. George wrote: > This is really a hardware issue. > Is there any device ( ie the serial port ) on your computer that will > accept the voltage signals ( and load ) that your device produces? > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it > happen safely ( ie u dont cook the GPS device ) > > > I have a new, high-accuracy GPS which only > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there > > any way to communicate with this device using RXTX, > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/15ae7a0b/attachment-0019.html From keithvz at verizon.net Tue Nov 6 16:16:55 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 06 Nov 2007 18:16:55 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> Message-ID: <4730F5E7.1030704@verizon.net> Zach Toups wrote: > On Nov 6, 2007 3:55 PM, U. George > wrote: > > This is really a hardware issue. > Is there any device ( ie the serial port ) on your computer that will > accept the voltage signals ( and load ) that your device produces? > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it > happen safely ( ie u dont cook the GPS device ) > > > I have a new, high-accuracy GPS which only > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is > there > > any way to communicate with this device using RXTX, > _______________________________________________ As UGeorge intimated, it's a hardware issue. If your device outputs TTL level voltages, and your USB to serial converter is RS-232, then you've got a physical hardware differences. Inverted leads and voltage issues are mainly the problem. MAXIM makes a neat little chip called the MAX233 (better than the 232, no extern caps required) You can't solve this in software. Now, there are TTL level compatible USB to serial converters available, I happen to be using one right now. This unit below is from a UK company (there might be sources in the US) http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm Parallax makes one that does 3.3 and 5v http://www.parallax.com/detail.asp?product_id=32201 (but only supports RX, TX, GND, AND DTR towards device) (i've tested a variant of the unit above, and it works with RXTX) In both cases, you'll need some creative wiring depending on the interface on your GPS. Hope this helps Keith From toupsz at cs.tamu.edu Tue Nov 6 16:53:01 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 17:53:01 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4730F5E7.1030704@verizon.net> References: <4730E2CA.3090009@gatworks.com> <4730F5E7.1030704@verizon.net> Message-ID: Yeah...I used an FTDI chip to handle USB/serial conversion on the audio equipment I built. I'm leery of trying to build a board for this ublox GPS due to all the grounding/shielding issues around it. Anyway, I apreciate the help...just sad that I can't handle the problem in software! Ublox did send me the source code for their USB drivers...but as a Java programmer, it's a bit tough for me to sort out. ;) Thanks again! -Zach On Nov 6, 2007 5:16 PM, Keith Monahan wrote: > Zach Toups wrote: > > > On Nov 6, 2007 3:55 PM, U. George > > wrote: > > > > This is really a hardware issue. > > Is there any device ( ie the serial port ) on your computer that > will > > accept the voltage signals ( and load ) that your device produces? > > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make > it > > happen safely ( ie u dont cook the GPS device ) > > > > > > I have a new, high-accuracy GPS which only > > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is > > there > > > any way to communicate with this device using RXTX, > > _______________________________________________ > > As UGeorge intimated, it's a hardware issue. > > If your device outputs TTL level voltages, and your USB to serial > converter is RS-232, then you've got a physical hardware differences. > Inverted leads and voltage issues are mainly the problem. MAXIM makes a > neat little chip called the MAX233 (better than the 232, no extern caps > required) > > You can't solve this in software. > > Now, there are TTL level compatible USB to serial converters available, > I happen to be using one right now. > > This unit below is from a UK company (there might be sources in the US) > > http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm > > Parallax makes one that does 3.3 and 5v > > http://www.parallax.com/detail.asp?product_id=32201 > (but only supports RX, TX, GND, AND DTR towards device) > > (i've tested a variant of the unit above, and it works with RXTX) > > In both cases, you'll need some creative wiring depending on the > interface on your GPS. > > Hope this helps > > Keith > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/06e88ad4/attachment-0019.html From netbeans at gatworks.com Tue Nov 6 17:14:01 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 06 Nov 2007 19:14:01 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> <4730F5E7.1030704@verizon.net> Message-ID: <47310349.5000406@gatworks.com> what gps chipset do u have? > Ublox did send me the source code for their USB drivers...but as a Java > programmer, it's a bit tough for me to sort out. ;) From Steffen.DETTMER at ingenico.com Wed Nov 7 03:10:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 7 Nov 2007 11:10:01 +0100 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> Message-ID: <20071107101000.GN10978@elberon.bln.de.ingenico.com> * Zach Toups wrote on Tue, Nov 06, 2007 at 16:14 -0600: > Actually, the device runs over USB, but shows up as a virtual > serial port and is outputting these signals. Ahh, so what you want is to use rxtx on the serial port that is created by the driver and mapped maybe as some COM8 or whatever? I this case then IMHO it would be no hardware question but maybe a problem in your application, or some driver or indeed a rxtx issue. > The software that > comes with the device (a u-blox ANTARIS 4 eval kit) is able to > communicate. Is it sure that this software is really using the virtual serial port and only this port? oki, Steffen -- About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Wed Nov 7 04:59:10 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 06:59:10 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <20071107101000.GN10978@elberon.bln.de.ingenico.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> Message-ID: <4731A88E.6080705@gatworks.com> >> The software that >> comes with the device (a u-blox ANTARIS 4 eval kit) is able to >> communicate. > > Is it sure that this software is really using the virtual serial > port and only this port? > I have tried to read the docs. I have yet to find any explanation on a (windoz) device driver for this device ( the usb device ). That magic is not explained. For a developer thats important magic. Maybe a call to their support team is in order? From netbeans at gatworks.com Wed Nov 7 05:01:38 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 07:01:38 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <20071107101000.GN10978@elberon.bln.de.ingenico.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> Message-ID: <4731A922.7@gatworks.com> Steffen DETTMER wrote: > * Zach Toups wrote on Tue, Nov 06, 2007 at 16:14 -0600: >> Actually, the device runs over USB, but shows up as a virtual BTW: it seems that I am not getting all the Rxtx mail. Is there still a problem? From toupsz at cs.tamu.edu Wed Nov 7 07:36:20 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Wed, 7 Nov 2007 08:36:20 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4731A88E.6080705@gatworks.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> <4731A88E.6080705@gatworks.com> Message-ID: When I emailed them about this issue, they sent me their WinCE drivers, which are apparently based on this open source driver: http://www.yetanotherhomepage.com/j7xx/j7xx.html?/j7xx/software/util/usbdriver.html These include srcdll, and x86 subfolders, though it's not 100% clear to me that these are useful. The ublox communication suite appears to only communicate with serial ports...I've communicated with the ublox on two different comm ports (one with the serial adapter plugged into the serial port, one with the main USB connection), as well as a Garmin bluetooth GPS (which comes up as a bluetooth serial device). I'm not well versed in code this close to the hardware, but it seems to me that if you're running a virtual serial port, then you're virtually controlling the "voltages" that come in on this "port"...so why would they be "ttl level"? :-/ Shouldn't the USB driver be able to interpret the signals in whatever way it wants and just supply software with the binary interpretation? Thanks for all the help, guys, it's really appreciated! -Zach On Nov 7, 2007 5:59 AM, U. George wrote: > > >> The software that > >> comes with the device (a u-blox ANTARIS 4 eval kit) is able to > >> communicate. > > > > Is it sure that this software is really using the virtual serial > > port and only this port? > > > > I have tried to read the docs. I have yet to find any explanation on a > (windoz) device driver for this device ( the usb device ). That magic > is not explained. For a developer thats important magic. Maybe a call > to their support team is in order? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071107/18a13314/attachment-0018.html From netbeans at gatworks.com Wed Nov 7 08:55:55 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 10:55:55 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> <4731A88E.6080705@gatworks.com> Message-ID: <4731E00B.9030902@gatworks.com> There are 2 components to talking to hardware. There is the electrical specification, and then there is the software specification. there is the rs232 specification, parallel port specification, and the USB electrical specification. Generally these are used to plug in the various devices, and hook up electrically. Then there is the software side. There is the device driver, a software component that sits somewhere in the kernel that handles the USB ( in your case ) controller. The device driver generally does not care about the electrical component. There are various chips that handle USB signals, and these chips have I/O addresses so that signals and data can be properly routed. There is also the side that communicates to the user via the COM port device-name. The device driver that you mentioned is for the "Support PL2303 serial chip". This device driver, which hopefully works, handles the USB chip, and eventually recognzes the gps device, and hopefully creates an COM port so the user can open up and communicate. These are a lot of "HOPES". Since u have the web address of the device driver, and developer, I would think that the developer, and any docs, might be better able to help u to first determine if the GPS device is recognized, and the COM port ( maybe its called by another name ) is created, as per documentation. > > These include srcdll, and x86 subfolders, though it's not 100% clear to > me that these are useful. From tjarvi at qbang.org Sat Nov 10 17:46:13 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Nov 2007 17:46:13 -0700 (MST) Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 5 Nov 2007, Oberhuber, Martin wrote: > Hi Trent, > > are the interestes of hobbyists really so different > from commercial ones? Both should be interested in > high quality and innovation the like. > > I haven't seen too many Open Source projects from the > "inside" but those that I have seen did not have > separate mailing lists for quality/testing/qa > versus innovation/development. > > What I have seen with the Open Source projects that > one would call "successful" is a good deal of > process around automated builds, automated unit > tests, predictable release dates and milestones, > and policies around commiting/contributing/reviewing > changes. > > I think that all of these benefit commercial users > and hobbyists the like. > > If you were just asking about who's interested in > discussing changes to foster more quality, count > me in. I'm just not sure whether discussing these > on a separate mailing list or other channel is the > right thing to do. > Hi Martin, There are two issues I'm thinking about. The first is the generic unit testing and quality initiatives required to move rxtx forward. The second is the inevitable fact that rxtx connects to external hardware. The discussion deals with a different set of problems. Here is a simple example of what I'm getting at. We have the capability of setting custom baud rates in rxtx. We may be interested in seeing regressions in rxtx, the C library or the kernel. Some people may be doing some tests with loopback connections. These will always work even if the baud rate is not set to the expected value. Some people may use null modems between two ports. This may be able to catch the problem but not always. Will the build machines be able to test this? (no - for a few reasons) Will people be trying to catch these type of regressions? (yes) What type of coverage does the community have in the end? (?) We could include the discussions in the same list or another equally open list that may be of interest to some folks that deal with these types of problems on a regular basis. -- Trent Jarvi tjarvi at qbang.org From timlow84 at gmail.com Mon Nov 12 00:31:17 2007 From: timlow84 at gmail.com (Timothy Low) Date: Mon, 12 Nov 2007 15:31:17 +0800 Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> Message-ID: <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> ---------- Forwarded message ---------- From: Timothy Low Date: Nov 12, 2007 3:02 PM Subject: Building RXTX From Source To: taj at www.linux.org.uk Cc: ferdinand.tang at tangs.net, Timothy Low , chweehuat.ng at tangs.net Hi Trent, I tried building RXTX from source, and I got this error. I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm trying to get the necessary ".so" files to use for my serial port communication through java. My linux kernal information is: *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 x86_64 x86_64 x86_64 GNU/Linux* I'll most glad if you can provide me some direction on this. Thanks ! ---------------- [root at smsgateway rxtx-2.0-7pre1]# ./configure checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu configure: WARNING: Trying libtool. If the following fails install libtool checking for gcc... gcc checking for C compiler default output... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking for ld used by GCC... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking for a sed that does not truncate output... /bin/sed checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking command to parse /usr/bin/nm -B output... ok checking how to run the C preprocessor... gcc -E checking for egrep... grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for ranlib... ranlib checking for strip... strip checking for objdir... .libs checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.lo... yes checking if gcc supports -fno-rtti -fno-exceptions... yes checking whether the linker (/usr/bin/ld) supports shared libraries... yes checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking dynamic linker characteristics... GNU/Linux ld.so checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no checking whether -lc should be explicitly linked in... no creating libtool checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking for style of include used by make... GNU checking dependency style of gcc... none checking fcntl.h usability... yes checking fcntl.h presence... yes checking for fcntl.h... yes checking sys/fcntl.h usability... yes checking sys/fcntl.h presence... yes checking for sys/fcntl.h... yes checking sys/file.h usability... yes checking sys/file.h presence... yes checking for sys/file.h... yes checking sys/time.h usability... yes checking sys/time.h presence... yes checking for sys/time.h... yes checking sys/signal.h usability... yes checking sys/signal.h presence... yes checking for sys/signal.h... yes checking signal.h usability... yes checking signal.h presence... yes checking for signal.h.. . yes checking termios.h usability... yes checking termios.h presence... yes checking for termios.h... yes checking asm/termbits.h usability... yes checking asm/termbits.h presence... yes checking for asm/termbits.h... yes checking grp.h usability... yes checking grp.h presence... yes checking for grp.h... yes checking pwd.h usability... yes checking pwd.h presence... yes checking for pwd.h... yes checking whether gcc needs -traditional... no checking whether to enable maintainer-specific portions of Makefiles... no /usr/java/jdk1.5.0_13 configure: WARNING: using JAVA_HOME environmental variable adjusted java.home is /usr/java/jdk1.5.0_13 checking os.name Linux checking os.arch i386 checking java.vendor Sun Microsystems Inc. checking java.version 1.5.0_13 checking os.version 2.6.18-8.el5xen comm.jar appears to be installed already. conftest.c: In function 'main': conftest.c:6: warning: incompatible implicit declaration of built-in function 'printf' conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:6: error: (Each undeclared identifier is reported only once conftest.c:6: error: for each function it appears in.) conftest.c:6: error: expected ')' before string constant conftest.c:7: warning: incompatible implicit declaration of built-in function 'exit' ./configure: line 9649: ./conftest: No such file or directory ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected conftest.c: In function 'main': conftest.c:5: warning: incompatible implicit declaration of built-in function 'printf' conftest.c:10: warning: incompatible implicit declaration of built-in function 'exit' configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status : config.h is unchanged config.status: executing depfiles commands [root at smsgateway rxtx-2.0-7pre1]# make install /usr/java/jdk1.5.0_13/bin/javac -classpath .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d /home/jboss/sources/rxtx- 2.0-7pre1/ -O /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java /home/jboss/sources/rxtx-2.0-7pre1/./src/UnSupportedLoggerException.java /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o /home/jboss/sources/rxtx-2.0-7pre1/x86_64-unknown-linux-gnu/SerialImp.lo /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'init_threads': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: cast from pointer to integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_nativeDrain': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: cast to pointer from integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'read_byte_array': /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: cast to pointer from integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_readArray': /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: comparison is always false due to limited range of data type /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_readTerminatedArray': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: comparison is always false due to limited range of data type mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial- 2.0.7pre1.* gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so -o .libs/librxtxSerial-2.0.7pre1.so (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.0.7pre1.so librxtxSerial.so) creating librxtxSerial.la (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la librxtxSerial.la) gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/ParallelImp.lo /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function 'Java_javax_comm_LPRPort_readArray': /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: comparison is always false due to limited range of data type rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* .libs/librxtxParallel-2.0.7pre1.* gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so -o .libs/librxtxParallel- 2.0.7pre1.so (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.0.7pre1.so librxtxParallel.so) creating librxtxParallel.la (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la librxtxParallel.la) make all-am make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' libtool: install: `x86_64-unknown-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 ------------- Regards, Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071112/27758c3c/attachment-0014.html From tjarvi at qbang.org Mon Nov 12 01:02:09 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Nov 2007 01:02:09 -0700 (MST) Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> Message-ID: On Mon, 12 Nov 2007, Timothy Low wrote: > > Hi Trent, Hi Tim, Comments are inline. As I mentioned off the list, rxtx 2.0 is on the edge of deprecation. We can get it working but this is not the path of least resistance for future work. You will probably need to bounce another round of questions off the list. The following is intended to isolate the problem. > > I tried building RXTX from source, and I got this error. > > > I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm trying > to get the necessary ".so" files to use for my serial port communication > through java. > My linux kernal information is: > > *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 x86_64 > x86_64 x86_64 GNU/Linux* > > I'll most glad if you can provide me some direction on this. Thanks ! > > ---------------- > [root at smsgateway rxtx-2.0-7pre1]# ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > checking for C compiler default output... a.out > checking whether the C compiler works... yes > checking whether we are cross compiling... no > checking for suffix of executables... > checking for suffix of object files... o > checking whether we are using the GNU C compiler... yes > checking whether gcc accepts -g... yes > checking for gcc option to accept ANSI C... none needed > checking for ld used by GCC... /usr/bin/ld > checking if the linker (/usr/bin/ld) is GNU ld... yes > checking for /usr/bin/ld option to reload object files... -r > checking for BSD-compatible nm... /usr/bin/nm -B > checking for a sed that does not truncate output... /bin/sed > checking whether ln -s works... yes > checking how to recognise dependent libraries... pass_all > checking command to parse /usr/bin/nm -B output... ok > checking how to run the C preprocessor... gcc -E > checking for egrep... grep -E > checking for ANSI C header files... yes > checking for sys/types.h... yes > checking for sys/stat.h... yes > checking for stdlib.h... yes > checking for string.h... yes > checking for memory.h... yes > checking for strings.h... yes > checking for inttypes.h... yes > checking for stdint.h... yes > checking for unistd.h... yes > checking dlfcn.h usability... yes > checking dlfcn.h presence... yes > checking for dlfcn.h... yes > checking for ranlib... ranlib > checking for strip... strip > checking for objdir... .libs > checking for gcc option to produce PIC... -fPIC > checking if gcc PIC flag -fPIC works... yes > checking if gcc static flag -static works... yes > checking if gcc supports -c -o file.o... yes > checking if gcc supports -c -o file.lo... yes > checking if gcc supports -fno-rtti -fno-exceptions... yes > checking whether the linker (/usr/bin/ld) supports shared libraries... yes > checking how to hardcode library paths into programs... immediate > checking whether stripping libraries is possible... yes > checking dynamic linker characteristics... GNU/Linux ld.so > checking if libtool supports shared libraries... yes > checking whether to build shared libraries... yes > checking whether to build static libraries... no > checking whether -lc should be explicitly linked in... no > creating libtool > checking for a BSD-compatible install... /usr/bin/install -c > checking whether build environment is sane... yes > checking for gawk... gawk > checking whether make sets $(MAKE)... yes > checking for style of include used by make... GNU > checking dependency style of gcc... none > checking fcntl.h usability... yes > checking fcntl.h presence... yes > checking for fcntl.h... yes > checking sys/fcntl.h usability... yes > checking sys/fcntl.h presence... yes > checking for sys/fcntl.h... yes > checking sys/file.h usability... yes > checking sys/file.h presence... yes > checking for sys/file.h... yes > checking sys/time.h usability... yes > checking sys/time.h presence... yes > checking for sys/time.h... yes > checking sys/signal.h usability... yes > checking sys/signal.h presence... yes > checking for sys/signal.h... yes > checking signal.h usability... yes > checking signal.h presence... yes > checking for signal.h.. . yes > checking termios.h usability... yes > checking termios.h presence... yes > checking for termios.h... yes > checking asm/termbits.h usability... yes > checking asm/termbits.h presence... yes > checking for asm/termbits.h... yes > checking grp.h usability... yes > checking grp.h presence... yes > checking for grp.h... yes > checking pwd.h usability... yes > checking pwd.h presence... yes > checking for pwd.h... yes > checking whether gcc needs -traditional... no > checking whether to enable maintainer-specific portions of Makefiles... no > /usr/java/jdk1.5.0_13 > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /usr/java/jdk1.5.0_13 > checking os.name Linux > checking os.arch i386 > checking java.vendor Sun Microsystems Inc. > checking java.version 1.5.0_13 > checking os.version 2.6.18-8.el5xen > comm.jar appears to be installed already. > conftest.c: In function 'main': > conftest.c:6: warning: incompatible implicit declaration of built-in > function 'printf' > conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:6: error: (Each undeclared identifier is reported only once > conftest.c:6: error: for each function it appears in.) > conftest.c:6: error: expected ')' before string constant This is an outdated kernel version check for when headers and kernels could cause problems for rxtx. If we made it past this, then you are OK. > conftest.c:7: warning: incompatible implicit declaration of built-in > function 'exit' > ./configure: line 9649: ./conftest: No such file or directory > ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected It blew up but continues.. > conftest.c: In function 'main': > conftest.c:5: warning: incompatible implicit declaration of built-in > function 'printf' > conftest.c:10: warning: incompatible implicit declaration of built-in > function 'exit' > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status : config.h is unchanged > config.status: executing depfiles commands > [root at smsgateway rxtx-2.0-7pre1]# make install > /usr/java/jdk1.5.0_13/bin/javac -classpath > .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d > /home/jboss/sources/rxtx- 2.0-7pre1/ -O > /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java > /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/UnSupportedLoggerException.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java > Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or > overrides a deprecated API. > Note: Recompile with -Xlint:deprecation for details. > /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* The java jar should be fine now. You may need to change the source files as mentioned below. > gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. > -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g > -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o > /home/jboss/sources/rxtx-2.0-7pre1/x86_64-unknown-linux-gnu/SerialImp.lo > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'init_threads': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: cast > from pointer to integer of different size > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_nativeDrain': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: cast to > pointer from integer of different size > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'read_byte_array': > /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: cast to > pointer from integer of different size As I recall, this was caused by pointers (now 64 bit rather than 32 bit) being stored in java ints (jints). I would look at the diff between the CVS 2.1 SerialImp.c and RXTXPort.java files against 2.0. We did fix those issues. You have a .so file but the different pointer sizes will cause runtime errors. > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_readArray': > /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: > comparison is always false due to limited range of data type > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_readTerminatedArray': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: > comparison is always false due to limited range of data type > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial- > 2.0.7pre1.* > gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so -o > .libs/librxtxSerial-2.0.7pre1.so > (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.0.7pre1.so > librxtxSerial.so) > creating librxtxSerial.la > (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la > librxtxSerial.la) > gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. > -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g > -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o > /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/ParallelImp.lo > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function > 'Java_javax_comm_LPRPort_readArray': > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: > comparison is always false due to limited range of data type > rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* > .libs/librxtxParallel-2.0.7pre1.* > gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so -o > .libs/librxtxParallel- 2.0.7pre1.so > (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.0.7pre1.so > librxtxParallel.so) > creating librxtxParallel.la > (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la > librxtxParallel.la) > make all-am > make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' > make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' > libtool: install: `x86_64-unknown-linux-gnu' must be an absolute directory > name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 A libtool change? Assuming you ran configure && make install in /home/jboss/sources/rxtx- 2.0-7pre1, libtool is looking for /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/.libs/librxtxSerial-2.0.7pre1.so. I think you have this? The file is just being copied to ~JAVA/jre/lib/$(JAVA_ARCH). -- Trent Jarvi tjarvi at qbang.org From sarah_662005 at yahoo.com Mon Nov 12 16:10:28 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Mon, 12 Nov 2007 15:10:28 -0800 (PST) Subject: [Rxtx] [urgent] device's power off detection Message-ID: <766782.10076.qm@web55803.mail.re3.yahoo.com> Hello all, I have a small application built on top of rxtx api. This application can retrieve the incoming data from a device through a port. The device can be powered off after the port get closed from the application. I have been trying a couple of hours to find a way to detect the power switching from device. If anyone knows how to handle it through rxtx, could you please give me a help? Thank you very much. r, Sara ____________________________________________________________________________________ Get easy, one-click access to your favorites. Make Yahoo! your homepage. http://www.yahoo.com/r/hs -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071112/4599f3ec/attachment-0013.html From netbeans at gatworks.com Mon Nov 12 17:52:22 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 12 Nov 2007 19:52:22 -0500 Subject: [Rxtx] [urgent] device's power off detection In-Reply-To: <766782.10076.qm@web55803.mail.re3.yahoo.com> References: <766782.10076.qm@web55803.mail.re3.yahoo.com> Message-ID: <4738F546.5010101@gatworks.com> Not sure what u are asking for. Are u asking for a way to detect if the device is OFF? Are u asking how to power off the device - via software ? Is it a Serial device? is it a parallel device? is it a usb device? Sara Hugh wrote: > Hello all, > I have a small application built on top of rxtx api. This application > can retrieve the incoming data from a device through a port. The device > can be powered off after the port get closed from the application. I > have been trying a couple of hours to find a way to detect the power > switching from device. If anyone knows how to handle it through rxtx, > could you please give me a help? Thank you very much. From tjarvi at qbang.org Mon Nov 12 22:48:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Nov 2007 22:48:11 -0700 (MST) Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711120225x562db8cbxb750767ade3b0d73@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> <900c6ba90711120031p66edc001ted76f7ba24e34b98@mail.gmail.com> <900c6ba90711120225x562db8cbxb750767ade3b0d73@mail.gmail.com> Message-ID: Hi Tim, The gnu.io namespace looks just like the javax.comm 2.0 namespace. There are additional (discouraged) undocumented methods in gnu.io that you need not use. We just used the different namespace to avoid poluting Sun's by mistake and to make sure we stayed off any potential licensing related radar. Usuaully, you just change your imports and make sure you do not use the javax.comm namespace for anything like exception handling. As I mentioned off the list, there are no issues with rxtx going through the JSR process to be more Sun friendly other than time. rxtx has no hidden intentions there; anything that does not work like CommAPI 2.0 documented is a bug. The reason we do not support CommAPI 2.1 is technical in nature and is in the list archives as well as the front page of www.rxtx.org. On Mon, 12 Nov 2007, Timothy Low wrote: > Hi Trent, > > I'll move to use a JDK1.5 64-bit version... but do I need to make any source > code changes to use the package (gnu.io) in the RTXTcomm.jar instead of the > ones from the javacomm api ? > > > Regards, > Tim > > On Nov 12, 2007 5:22 PM, Trent Jarvi wrote: > >> >> Hi Tim, >> >> I see a couple things here. >> >> First your jdk is for i686 yet the library is compiled on a x86_64 >> machine. You may try passing configure the --target=i686-unknown-linux to >> try using the i686 backend to gcc if it is available. Or move to the 64 >> bit jdk. >> >> The other error I see is again the moved UTF_RELEASE define that we need >> to fix. You can probably get around that with: >> >> make -DUTF_RELEASE=`uname -r` >> >> even more simple would be to just specify the serial library which should >> be in configure --help. >> >> You can remove the UTF_RELEASE check from configure by editing >> configure.in, searching for the simple C program check and deleting it. >> Running autoconf after that will regenerate a new configure without the >> check. >> >> Note that you should remove the previous native libraries >> (librxtxSerial.so) when moving from rxtx 2.0 to 2.1. These are compiled >> for different namespaces (javax.comm/gnu.io). >> >> On Mon, 12 Nov 2007, Timothy Low wrote: >> >>> *Hi Trent, >>> >>> I moved on to rxtx 2.1.7r2, and updated my jre to 1.6.0 (64-bit)... I >> tried >>> the following 2 methods: >>> >>> (1) using the rxtx 2.1.7 binaries from the RXTX website* >>> *Are these binaries suitable for a 64-bit OS ? There mentioning of the >>> gnu.io that you've talked about previously...* >>> ------ >>> [root at smsgateway sources]# java -Djava.library.path=/usr/lib PortLister >>> Experimental: JNI_OnLoad called. >>> >>> java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion >>> ()Ljava/lang/String; >>> at gnu.io.RXTXCommDriver.nativeGetVersion(Native Method) >>> at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:85) >>> at java.lang.Class.forName0(Native Method) >>> at java.lang.Class.forName(Unknown Source) >>> at javax.comm.CommPortIdentifier.loadDriver( >> CommPortIdentifier.java >>> :237) >>> at javax.comm.CommPortIdentifier.(CommPortIdentifier.java >>> :109) >>> at PortLister.(PortLister.java:6) >>> at PortLister.main(PortLister.java:25) >>> Exception in thread "main" java.lang.UnsatisfiedLinkError: >>> com.sun.comm.SunrayInfo.isSessionActive()Z >>> at com.sun.comm.SunrayInfo.isSessionActive(Native Method) >>> at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java >> :155) >>> at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java >>> :100) >>> at javax.comm.CommPortIdentifier.(CommPortIdentifier.java >>> :138) >>> at PortLister.(PortLister.java:6) >>> at PortLister.main(PortLister.java:25) >>> >>> ------ >>> >>> (2) compiling the rxtx 2.1.7 from source >>> *but i got the following error while running ./configure and make all* >>> >>> ------ >>> [root at smsgateway rxtx-2.1-7r2]# ./configure >>> checking build system type... x86_64-unknown-linux-gnu >>> checking host system type... x86_64-unknown-linux-gnu >>> checking target system type... x86_64-unknown-linux-gnu >>> configure: WARNING: Trying libtool. If the following fails install >> libtool >>> checking for gcc... gcc >>> checking for C compiler default output file name... a.out >>> checking whether the C compiler works... yes >>> checking whether we are cross compiling... no >>> checking for suffix of executables... >>> checking for suffix of object files... o >>> checking whether we are using the GNU C compiler... yes >>> checking whether gcc accepts -g... yes >>> checking for gcc option to accept ANSI C... none needed >>> checking for a sed that does not truncate output... /bin/sed >>> checking for egrep... grep -E >>> checking for ld used by gcc... /usr/bin/ld >>> checking if the linker (/usr/bin/ld) is GNU ld... yes >>> checking for /usr/bin/ld option to reload object files... -r >>> checking for BSD-compatible nm... /usr/bin/nm -B >>> checking whether ln -s works... yes >>> checking how to recognise dependent libraries... pass_all >>> checking how to run the C preprocessor... gcc -E >>> checking for ANSI C header files... yes >>> checking for sys/types.h... yes >>> checking for sys/stat.h... yes >>> checking for stdlib.h... yes >>> checking for string.h... yes >>> checking for memory.h... yes >>> checking for strings.h... yes >>> checking for inttypes.h... yes >>> checking for stdint.h... yes >>> checking for unistd.h... yes >>> checking dlfcn.h usability... yes >>> checking dlfcn.h presence... yes >>> checking for dlfcn.h... yes >>> checking for g++... g++ >>> checking whether we are using the GNU C++ compiler... yes >>> checking whether g++ accepts -g... yes >>> checking how to run the C++ preprocessor... g++ -E >>> checking for g77... no >>> checking for f77... no >>> checking for xlf... no >>> checking for frt... no >>> checking for pgf77... no >>> checking for fort77... no >>> checking for fl32... no >>> checking for af77... no >>> checking for f90... no >>> checking for xlf90... no >>> checking for pgf90... no >>> checking for epcf90... no >>> checking for f95... f95 >>> checking whether we are using the GNU Fortran 77 compiler... yes >>> checking whether f95 accepts -g... yes >>> checking the maximum length of command line arguments... 32768 >>> checking command to parse /usr/bin/nm -B output from gcc object... ok >>> checking for objdir... .libs >>> checking for ar... ar >>> checking for ranlib... ranlib >>> checking for strip... strip >>> checking if gcc static flag works... yes >>> checking if gcc supports -fno-rtti -fno-exceptions... no >>> checking for gcc option to produce PIC... -fPIC >>> checking if gcc PIC flag -fPIC works... yes >>> checking if gcc supports -c -o file.o... yes >>> checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking whether -lc should be explicitly linked in... no >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> checking if libtool supports shared libraries... yes >>> checking whether to build shared libraries... yes >>> checking whether to build static libraries... no >>> configure: creating libtool >>> appending configuration tag "CXX" to libtool >>> checking for ld used by g++... /usr/bin/ld -m elf_x86_64 >>> checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes >>> checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking for g++ option to produce PIC... -fPIC >>> checking if g++ PIC flag -fPIC works... yes >>> checking if g++ supports -c -o file.o... yes >>> checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> appending configuration tag "F77" to libtool >>> checking if libtool supports shared libraries... yes >>> checking whether to build shared libraries... yes >>> checking whether to build static libraries... no >>> checking for f95 option to produce PIC... -fPIC >>> checking if f95 PIC flag -fPIC works... yes >>> checking if f95 supports -c -o file.o... yes >>> checking whether the f95 linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> checking for a BSD-compatible install... /usr/bin/install -c >>> checking whether build environment is sane... yes >>> checking for gawk... gawk >>> checking whether make sets $(MAKE)... yes >>> checking for style of include used by make... GNU >>> checking dependency style of gcc... none >>> checking dependency style of g++... none >>> checking fcntl.h usability... yes >>> checking fcntl.h presence... yes >>> checking for fcntl.h... yes >>> checking sys/fcntl.h usability... yes >>> checking sys/fcntl.h presence... yes >>> checking for sys/fcntl.h... yes >>> checking sys/file.h usability... yes >>> checking sys/file.h presence... yes >>> checking for sys/file.h... yes >>> checking sys/time.h usability... yes >>> checking sys/time.h presence... yes >>> checking for sys/time.h... yes >>> checking sys/signal.h usability... yes >>> checking sys/signal.h presence... yes >>> checking for sys/signal.h... yes >>> checking signal.h usability... yes >>> checking signal.h presence... yes >>> checking for signal.h... yes >>> checking termios.h usability... yes >>> checking termios.h presence... yes >>> checking for termios.h... yes >>> checking grp.h usability... yes >>> checking grp.h presence... yes >>> checking for grp.h... yes >>> checking pwd.h usability... yes >>> checking pwd.h presence... yes >>> checking for pwd.h... yes >>> checking whether gcc needs -traditional... no >>> checking whether to enable maintainer-specific portions of Makefiles... >> no >>> /usr/java/jdk1.5.0_13 >>> configure: WARNING: using JAVA_HOME environmental variable >>> adjusted java.home is /usr/java/jdk1.5.0_13 >>> checking os.name Linux >>> checking os.arch i386 >>> checking java.vendor Sun Microsystems Inc. >>> checking java.version 1.5.0_13 >>> checking os.version 2.6.18-8.el5xen >>> conftest.c: In function 'main': >>> conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this >> function) >>> conftest.c:8: error: (Each undeclared identifier is reported only once >>> conftest.c:8: error: for each function it appears in.) >>> conftest.c:8: error: expected ')' before string constant >>> ./configure: line 21462: ./conftest: No such file or directory >>> ./configure: line 21462: test: 2.6.18-8.el5xen: unary operator expected >>> configure: creating ./config.status >>> config.status: creating Makefile >>> config.status: creating config.h >>> config.status: executing depfiles commands >>> [root at smsgateway rxtx-2.1-7r2]# make install >>> /usr/java/jdk1.5.0_13/bin/javac -classpath .:/home/jboss/sources/rxtx- >>> >> 2.1-7r2:/home/jboss/sources/rxtx-2.1-7r2/src:/usr/java/jdk1.5.0_13/jre/lib/ext/RXTXcomm.jar-d >>> /home/jboss/sources/rxtx- >>> 2.1-7r2/ -O -source 1.3 -target 1.3 >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommDriver.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortEnumerator.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortIdentifier.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortOwnershipListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Configure.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2C.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/I2CPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/LPRPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/NoSuchPortException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/PortInUseException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Raw.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/RawPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RawPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RawPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/RS485PortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485PortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485Port.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXCommDriver.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXVersion.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPort.java >>> /home/jboss/sources/rxtx-2.1-7r2 >> /./src/UnsupportedCommOperationException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/UnSupportedLoggerException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Zystem.java >>> /usr/java/jdk1.5.0_13/bin/javah -classpath .:/home/jboss/sources/rxtx- >>> >> 2.1-7r2:/home/jboss/sources/rxtx-2.1-7r2/src:/usr/java/jdk1.5.0_13/jre/lib/ext/RXTXcomm.jar-d >>> x86_64-unknown-linux-gnu -jni `(for i in CommDriver CommPortEnumerator >>> CommPortIdentifier CommPort CommPortOwnershipListener Configure I2C >>> I2CPortEvent I2CPortEventListener I2CPort LPRPort NoSuchPortException >>> ParallelPortEvent ParallelPortEventListener ParallelPort >> PortInUseException >>> Raw RawPortEvent RawPortEventListener RawPort RS485 RS485PortEvent >>> RS485PortEventListener RS485Port RXTXCommDriver RXTXPort RXTXVersion >>> SerialPortEvent SerialPortEventListener SerialPort >>> UnsupportedCommOperationException UnSupportedLoggerException Zystem;do \ >>> if grep > /dev/null native.*\( /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/$i.java; then \ >>> echo gnu.io.$i; \ >>> fi; \ >>> done)` >>> /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialImp.c -o >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo; >>> \ >>> if [ "Serial" = "Serial" ]; >>> then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxSerial.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxSerial.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo; >> \ >>> fi; \ >>> ) >>> mkdir /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/.libs >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/SerialImp.o >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/fuserImp.o >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c: In function >> 'show_user': >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c:238: warning: cast >> from >>> pointer to integer of different size >>> gcc -shared /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/SerialImp.o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/fuserImp.o >>> -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7.so -o >> .libs/librxtxSerial- >>> 2.1-7.so >>> (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.1-7.so >>> librxtxSerial.so) >>> creating librxtxSerial.la >>> (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la >>> librxtxSerial.la) >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelImp.c -o >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/ParallelImp.lo; >>> \ >>> if [ "Parallel" = "Serial" ]; >>> then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxParallel.la -rpath >>> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/ParallelImp.lo >>> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxParallel.la -rpath >>> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/ParallelImp.lo; >>> \ >>> fi; \ >>> ) >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >>> /x86_64-unknown-linux-gnu/.libs/ParallelImp.o >>> gcc -shared /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/ParallelImp.o >>> -lpthread -Wl,-soname -Wl,librxtxParallel-2.1-7.so -o >>> .libs/librxtxParallel-2.1-7.so >>> (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.1-7.so >>> librxtxParallel.so) >>> creating librxtxParallel.la >>> (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la >>> librxtxParallel.la) >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo; >>> \ >>> if [ "I2C" = "Serial" ]; then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxI2C.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo >>> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxI2C.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo; >>> \ >>> fi; \ >>> ) >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/.libs/I2CImp.o >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c: In function >>> 'Java_gnu_io_I2CPort_Initialize': >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: 'UTS_RELEASE' >>> undeclared (first use in this function) >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: (Each >> undeclared >>> identifier is reported only once >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: for each >> function >>> it appears in.) >>> libtool: link: `/home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/I2CImp.lo' >>> is not a valid libtool object >>> make: *** [x86_64-unknown-linux-gnu/librxtxI2C.la] Error 1 >>> >>> ------ >>> >>> >>> >>> On Nov 12, 2007 4:02 PM, Trent Jarvi wrote: >>> >>>> On Mon, 12 Nov 2007, Timothy Low wrote: >>>>> >>>>> Hi Trent, >>>> >>>> Hi Tim, >>>> >>>> Comments are inline. As I mentioned off the list, rxtx 2.0 is on the >> edge >>>> of deprecation. We can get it working but this is not the path of >> least >>>> resistance for future work. >>>> >>>> You will probably need to bounce another round of questions off the >> list. >>>> The following is intended to isolate the problem. >>>> >>>>> >>>>> I tried building RXTX from source, and I got this error. >>>>> >>>>> >>>>> I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm >>>> trying >>>>> to get the necessary ".so" files to use for my serial port >> communication >>>>> through java. >>>>> My linux kernal information is: >>>>> >>>>> *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 >>>> x86_64 >>>>> x86_64 x86_64 GNU/Linux* >>>>> >>>>> I'll most glad if you can provide me some direction on this. Thanks ! >>>>> >>>>> ---------------- >>>>> [root at smsgateway rxtx-2.0-7pre1]# ./configure >>>>> checking build system type... x86_64-unknown-linux-gnu >>>>> checking host system type... x86_64-unknown-linux-gnu >>>>> checking target system type... x86_64-unknown-linux-gnu >>>>> configure: WARNING: Trying libtool. If the following fails install >>>> libtool >>>>> checking for gcc... gcc >>>>> checking for C compiler default output... a.out >>>>> checking whether the C compiler works... yes >>>>> checking whether we are cross compiling... no >>>>> checking for suffix of executables... >>>>> checking for suffix of object files... o >>>>> checking whether we are using the GNU C compiler... yes >>>>> checking whether gcc accepts -g... yes >>>>> checking for gcc option to accept ANSI C... none needed >>>>> checking for ld used by GCC... /usr/bin/ld >>>>> checking if the linker (/usr/bin/ld) is GNU ld... yes >>>>> checking for /usr/bin/ld option to reload object files... -r >>>>> checking for BSD-compatible nm... /usr/bin/nm -B >>>>> checking for a sed that does not truncate output... /bin/sed >>>>> checking whether ln -s works... yes >>>>> checking how to recognise dependent libraries... pass_all >>>>> checking command to parse /usr/bin/nm -B output... ok >>>>> checking how to run the C preprocessor... gcc -E >>>>> checking for egrep... grep -E >>>>> checking for ANSI C header files... yes >>>>> checking for sys/types.h... yes >>>>> checking for sys/stat.h... yes >>>>> checking for stdlib.h... yes >>>>> checking for string.h... yes >>>>> checking for memory.h... yes >>>>> checking for strings.h... yes >>>>> checking for inttypes.h... yes >>>>> checking for stdint.h... yes >>>>> checking for unistd.h... yes >>>>> checking dlfcn.h usability... yes >>>>> checking dlfcn.h presence... yes >>>>> checking for dlfcn.h... yes >>>>> checking for ranlib... ranlib >>>>> checking for strip... strip >>>>> checking for objdir... .libs >>>>> checking for gcc option to produce PIC... -fPIC >>>>> checking if gcc PIC flag -fPIC works... yes >>>>> checking if gcc static flag -static works... yes >>>>> checking if gcc supports -c -o file.o... yes >>>>> checking if gcc supports -c -o file.lo... yes >>>>> checking if gcc supports -fno-rtti -fno-exceptions... yes >>>>> checking whether the linker (/usr/bin/ld) supports shared libraries... >>>> yes >>>>> checking how to hardcode library paths into programs... immediate >>>>> checking whether stripping libraries is possible... yes >>>>> checking dynamic linker characteristics... GNU/Linux ld.so >>>>> checking if libtool supports shared libraries... yes >>>>> checking whether to build shared libraries... yes >>>>> checking whether to build static libraries... no >>>>> checking whether -lc should be explicitly linked in... no >>>>> creating libtool >>>>> checking for a BSD-compatible install... /usr/bin/install -c >>>>> checking whether build environment is sane... yes >>>>> checking for gawk... gawk >>>>> checking whether make sets $(MAKE)... yes >>>>> checking for style of include used by make... GNU >>>>> checking dependency style of gcc... none >>>>> checking fcntl.h usability... yes >>>>> checking fcntl.h presence... yes >>>>> checking for fcntl.h... yes >>>>> checking sys/fcntl.h usability... yes >>>>> checking sys/fcntl.h presence... yes >>>>> checking for sys/fcntl.h... yes >>>>> checking sys/file.h usability... yes >>>>> checking sys/file.h presence... yes >>>>> checking for sys/file.h... yes >>>>> checking sys/time.h usability... yes >>>>> checking sys/time.h presence... yes >>>>> checking for sys/time.h... yes >>>>> checking sys/signal.h usability... yes >>>>> checking sys/signal.h presence... yes >>>>> checking for sys/signal.h... yes >>>>> checking signal.h usability... yes >>>>> checking signal.h presence... yes >>>>> checking for signal.h.. . yes >>>>> checking termios.h usability... yes >>>>> checking termios.h presence... yes >>>>> checking for termios.h... yes >>>>> checking asm/termbits.h usability... yes >>>>> checking asm/termbits.h presence... yes >>>>> checking for asm/termbits.h... yes >>>>> checking grp.h usability... yes >>>>> checking grp.h presence... yes >>>>> checking for grp.h... yes >>>>> checking pwd.h usability... yes >>>>> checking pwd.h presence... yes >>>>> checking for pwd.h... yes >>>>> checking whether gcc needs -traditional... no >>>>> checking whether to enable maintainer-specific portions of >> Makefiles... >>>> no >>>>> /usr/java/jdk1.5.0_13 >>>>> configure: WARNING: using JAVA_HOME environmental variable >>>>> adjusted java.home is /usr/java/jdk1.5.0_13 >>>>> checking os.name Linux >>>>> checking os.arch i386 >>>>> checking java.vendor Sun Microsystems Inc. >>>>> checking java.version 1.5.0_13 >>>>> checking os.version 2.6.18-8.el5xen >>>>> comm.jar appears to be installed already. >>>>> conftest.c: In function 'main': >>>>> conftest.c:6: warning: incompatible implicit declaration of built-in >>>>> function 'printf' >>>>> conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this >>>> function) >>>>> conftest.c:6: error: (Each undeclared identifier is reported only once >>>>> conftest.c:6: error: for each function it appears in.) >>>>> conftest.c:6: error: expected ')' before string constant >>>> >>>> >>>> This is an outdated kernel version check for when headers and kernels >>>> could cause problems for rxtx. If we made it past this, then you are >> OK. >>>> >>>> >>>>> conftest.c:7: warning: incompatible implicit declaration of built-in >>>>> function 'exit' >>>>> ./configure: line 9649: ./conftest: No such file or directory >>>>> ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected >>>> >>>> It blew up but continues.. >>>> >>>>> conftest.c: In function 'main': >>>>> conftest.c:5: warning: incompatible implicit declaration of built-in >>>>> function 'printf' >>>>> conftest.c:10: warning: incompatible implicit declaration of built-in >>>>> function 'exit' >>>>> configure: creating ./config.status >>>>> config.status: creating Makefile >>>>> config.status: creating config.h >>>>> config.status : config.h is unchanged >>>>> config.status: executing depfiles commands >>>>> [root at smsgateway rxtx-2.0-7pre1]# make install >>>>> /usr/java/jdk1.5.0_13/bin/javac -classpath >>>>> .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/ -O >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1 >> /./src/UnSupportedLoggerException.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java >>>>> Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or >>>>> overrides a deprecated API. >>>>> Note: Recompile with -Xlint:deprecation for details. >>>>> /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* >>>> >>>> >>>> The java jar should be fine now. You may need to change the source >> files >>>> as mentioned below. >>>> >>>>> gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu >> -I. >>>>> -I/usr/java/jdk1.5.0_13/include >> -I/usr/java/jdk1.5.0_13/include/./linux/ >>>> -g >>>>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o >>>>> /home/jboss/sources/rxtx-2.0-7pre1 >> /x86_64-unknown-linux-gnu/SerialImp.lo >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'init_threads': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: >>>> cast >>>>> from pointer to integer of different size >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_nativeDrain': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: >>>> cast to >>>>> pointer from integer of different size >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'read_byte_array': >>>>> /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: >>>> cast to >>>>> pointer from integer of different size >>>> >>>> >>>> As I recall, this was caused by pointers (now 64 bit rather than 32 >> bit) >>>> being stored in java ints (jints). I would look at the diff between >> the >>>> CVS 2.1 SerialImp.c and RXTXPort.java files against 2.0. We >>>> did fix those issues. >>>> >>>> You have a .so file but the different pointer sizes will cause runtime >>>> errors. >>>> >>>> >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_readArray': >>>>> /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: >>>>> comparison is always false due to limited range of data type >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_readTerminatedArray': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: >>>>> comparison is always false due to limited range of data type >>>>> mkdir .libs >>>>> rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* >> .libs/librxtxSerial- >>>>> 2.0.7pre1.* >>>>> gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so-o >>>>> .libs/librxtxSerial-2.0.7pre1.so >>>>> (cd .libs && rm -f librxtxSerial.so && ln -s >> librxtxSerial-2.0.7pre1.so >>>>> librxtxSerial.so) >>>>> creating librxtxSerial.la >>>>> (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la >>>>> librxtxSerial.la) >>>>> gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu >> -I. >>>>> -I/usr/java/jdk1.5.0_13/include >> -I/usr/java/jdk1.5.0_13/include/./linux/ >>>> -g >>>>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o >>>>> /home/jboss/sources/rxtx- 2.0-7pre1 >>>> /x86_64-unknown-linux-gnu/ParallelImp.lo >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function >>>>> 'Java_javax_comm_LPRPort_readArray': >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: >>>>> comparison is always false due to limited range of data type >>>>> rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* >>>>> .libs/librxtxParallel-2.0.7pre1.* >>>>> gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so-o >>>>> .libs/librxtxParallel- 2.0.7pre1.so >>>>> (cd .libs && rm -f librxtxParallel.so && ln -s >>>> librxtxParallel-2.0.7pre1.so >>>>> librxtxParallel.so) >>>>> creating librxtxParallel.la >>>>> (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la >>>>> librxtxParallel.la) >>>>> make all-am >>>>> make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' >>>>> make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' >>>>> libtool: install: `x86_64-unknown-linux-gnu' must be an absolute >>>> directory >>>>> name >>>>> Try `libtool --help --mode=install' for more information. >>>>> make: *** [install] Error 1 >>>> >>>> A libtool change? Assuming you ran configure && make install in >>>> /home/jboss/sources/rxtx- 2.0-7pre1, libtool is looking for >>>> /home/jboss/sources/rxtx- >>>> 2.0-7pre1/x86_64-unknown-linux-gnu/.libs/librxtxSerial-2.0.7pre1.so. >>>> >>>> I think you have this? The file is just being copied to >>>> ~JAVA/jre/lib/$(JAVA_ARCH). >>>> >>>> -- >>>> Trent Jarvi >>>> tjarvi at qbang.org >>>> >>> >> > From guido.vogt at celsi.ch Tue Nov 13 00:28:01 2007 From: guido.vogt at celsi.ch (Guido Vogt) Date: Tue, 13 Nov 2007 08:28:01 +0100 Subject: [Rxtx] RTS Line can't be set Message-ID: <47395201.1050400@celsi.ch> I'm working on an Windows XP /SP2 System. Version of RXTX: 2.1.7. The serial line is connected to a modem. As I can see, the RTS-Line of the serial Port is inactive, when the port is opened (flowcontrol=none). Obviously, no data is coming from the modem. If I use the setRTS(true) command after open, the comport does not send out my data any more. This behaviour is regardless of flowcontrol. Anybody has an idea what do do? Thanks for help. From Martin.Oberhuber at windriver.com Tue Nov 13 08:58:23 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 13 Nov 2007 16:58:23 +0100 Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803880918@ism-mail03.corp.ad.wrs.com> Hi Trent, as said before, I like the idea of discussing such quality engineering issues, but why hide these away from the rest of the public? Anyways, if you do want to create a new mailing list for these kinds of things I'll happily subscribe. 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: Sunday, November 11, 2007 1:46 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: RE: [Rxtx] Quality Engineering with rxtx > > On Mon, 5 Nov 2007, Oberhuber, Martin wrote: > > > Hi Trent, > > > > are the interestes of hobbyists really so different > > from commercial ones? Both should be interested in > > high quality and innovation the like. > > > > I haven't seen too many Open Source projects from the > > "inside" but those that I have seen did not have > > separate mailing lists for quality/testing/qa > > versus innovation/development. > > > > What I have seen with the Open Source projects that > > one would call "successful" is a good deal of > > process around automated builds, automated unit > > tests, predictable release dates and milestones, > > and policies around commiting/contributing/reviewing > > changes. > > > > I think that all of these benefit commercial users > > and hobbyists the like. > > > > If you were just asking about who's interested in > > discussing changes to foster more quality, count > > me in. I'm just not sure whether discussing these > > on a separate mailing list or other channel is the > > right thing to do. > > > > Hi Martin, > > There are two issues I'm thinking about. The first is the > generic unit > testing and quality initiatives required to move rxtx > forward. The second > is the inevitable fact that rxtx connects to external hardware. The > discussion deals with a different set of problems. > > Here is a simple example of what I'm getting at. > > We have the capability of setting custom baud rates in rxtx. > We may be > interested in seeing regressions in rxtx, the C library or > the kernel. > Some people may be doing some tests with loopback > connections. These will > always work even if the baud rate is not set to the expected > value. Some > people may use null modems between two ports. This may be > able to catch > the problem but not always. > > Will the build machines be able to test this? (no - for a few reasons) > Will people be trying to catch these type of regressions? (yes) > What type of coverage does the community have in the end? (?) > > We could include the discussions in the same list or another > equally open > list that may be of interest to some folks that deal with > these types of > problems on a regular basis. > > -- > Trent Jarvi > tjarvi at qbang.org > From toupsz at cs.tamu.edu Tue Nov 13 10:33:03 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 13 Nov 2007 11:33:03 -0600 Subject: [Rxtx] [urgent] device's power off detection In-Reply-To: <4738F546.5010101@gatworks.com> References: <766782.10076.qm@web55803.mail.re3.yahoo.com> <4738F546.5010101@gatworks.com> Message-ID: Lacking any other specification on it...but can you set up the device to notify your software when it turns off? Send a message or somesuch? Maybe it can signal using RTS or DTR? -Zach On Nov 12, 2007 6:52 PM, U. George wrote: > Not sure what u are asking for. Are u asking for a way to detect if the > device is OFF? Are u asking how to power off the device - via software ? > Is it a Serial device? > is it a parallel device? > is it a usb device? > > Sara Hugh wrote: > > Hello all, > > I have a small application built on top of rxtx api. This application > > can retrieve the incoming data from a device through a port. The device > > can be powered off after the port get closed from the application. I > > have been trying a couple of hours to find a way to detect the power > > switching from device. If anyone knows how to handle it through rxtx, > > could you please give me a help? Thank you very much. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071113/e5859e4d/attachment-0012.html From tjarvi at qbang.org Tue Nov 13 20:02:03 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 13 Nov 2007 20:02:03 -0700 (MST) Subject: [Rxtx] #ifndef TIOCSERGETLSR In-Reply-To: <472E3AAF.7050709@gatworks.com> References: <472E3AAF.7050709@gatworks.com> Message-ID: On Sun, 4 Nov 2007, U. George wrote: > For Linux, it seems that you need the code for both *having* a > TIOCSERGETLSR, and *not having* a TIOCSERGETLSR. Maybe the ioctl exists > system wide, but not necessarily for the device driver itself ( always > returns -1 ) . > > Are there systems that have a *functioning* TIOCSERGETLSR for all their > devices? Then this would be the case where the "#ifndef TIOCSERGETLSR" > directive could be useful is eliminating the unnecessary code and tests. > > And for those systems that dont have a TIOCSERGETLSR, then the code for > TIOCSERGETLSR can be eliminated. > > It would be a simple case to have, as a foundation, all the code to > simulate the missing TIOCSERGETLSR ioctl. If the system does have the > ioctl, then that code can be ifdef'd in, and co-exist with the > functionality of the code that simulates the missing TIOCSERGETLSR ioctl. > Ah, there is the post. Sorry I was on vacation. Hi George, Yes there are systems that have functioning TIOCSERGETLSR for all of their devices. These are machines that just use traditional UARTs. If you mean operating systems, then probably not. Let me explain a bit about the history of those #ifdefs to help clear up a mess. RXTX aims to follow POSIX. TIOCSERGETLSR turns out to not be POSIX at all as I understand. It isn't in BSD, Solaris, AIX or HP-UX. It certainly provides access to important information. I assumed it was standard when I coded rxtx on a Linux system. Ya, laugh. Then I looked at Win32.. Oh you are still laughing? ..I could not navigate msft's web site at the time [still can't really find anything today]. So google pointed me to someones 'reverse documentation' of the w32 API and an example msft put together back in the win3.0 days. It was enough but maybe not 100% correct. They covered overlapped IO which was important for events in rxtx. Looking at Win32 and Linux, it made sense to implement TIOCSERGETLSR for win32 with the way rxtx works. That was how things matched up. But when I got feedback about other systems, it didn't match up. When people used multiport cards with money saving designs in Linux, it didn't match up. And today, there are drivers for unusual serial ports that don't match up. Now we have some ugly logic that mostly works for most serial ports. It isn't right though. The important aspect of TIOSERGETLSR is knowing when the output is really gone. But POSIX tcdrain tells us the same thing. So there is logic in the ifdefs to match that up as you suggest. Perhaps a more formal solution along those lines would be worth looking into. I would suggest the roles should be switched though. We should use POSIX calls on all systems and hide things that don't work on everything like we have with other undocumented calls. TIOSERGETLSR is nice and would be great if it was standard. It isn't as far as I can tell. In the end, many people write Java code because they want portability. The TIOSERGETLSR does not really fit. In someways, this is limiting to the least common denominator which is Solaris if you have seen it's serial kernel driver code. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 15 09:10:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 15 Nov 2007 17:10:59 +0100 Subject: [Rxtx] RXTX blocking on unconnected virtual port Message-ID: <460801A4097E3D4CA04CC64EE648584803919080@ism-mail03.corp.ad.wrs.com> Hello, we came across the following issue: * Set up a virtual serial port, e.g. with com0com: http://com0com.sourceforge.net/ * Connect RXTX to one end, e.g. cnc1a * Do not connect the other end, e.g. cnc1b * Have RXTX write data to the port --> Since the data is not being read, RXTX blocks - RXTXPort.SerialOutputStream.write increases the RXTXPort.IOLocked variable - it then calls the native writeByte or writeArray method (which blocks) closing the RXTXPort hangs for ever too: - RXTXPort.close() has a while( IOLocked > 0 ) {..Thread.sleep(500);...} which spins for ever ==> once the communication hangs, it cannot recover. Has anybody else seen such a problem before, or even got an idea how to solve it? When I connect Hyperterminal to the same half-open port, and type a character, it hangs for about 3 seconds but then times out and is available again. I guess that's what I'd like to see in RXTX as well, with a (configurable) timeout. Our big problem with the current situation is that once RXTX gets stuck, there is nothing at all we can do to make it go live again - that's why our original workaround of writing to the port in a background thread is not good enough. For more background information, the issue is being tracked in https://bugs.eclipse.org/bugs/show_bug.cgi?id=208185 Thanks for any hints or ideas, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Sun Nov 18 09:43:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 09:43:26 -0700 (MST) Subject: [Rxtx] PortInUseException - Cannot close and reopen serial port In-Reply-To: <460801A4097E3D4CA04CC64EE64858480351C711@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858480351C711@ism-mail03.corp.ad.wrs.com> Message-ID: These have been submitted to CVS and the bugzilla entries have been changed to reflect the changes. ChangeLog: find ports which were added after program startup on Mac OS X. Martin Oberhuber http://bugzilla.qbang.org/show_bug.cgi?id=48 Clean up CommPort Ownership code, avoid possible deadlocks, fix lost commport ownership events. http://bugzilla.qbang.org/show_bug.cgi?id=83 Martin Oberhuber On Wed, 24 Oct 2007, Oberhuber, Martin wrote: > 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) > > > > > > > > > > > > > > > From tjarvi at qbang.org Sun Nov 18 09:45:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 09:45:39 -0700 (MST) Subject: [Rxtx] PortInUseException - Cannot close and reopen serial port In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848020CAF26@ism-mail03.corp.ad.wrs.com> Message-ID: The current CVS code should have all the entries. With version information, I usually do not change the version until we tag and release a zip file. Any feedback would be appreciated. On Wed, 27 Jun 2007, Greg Johnson wrote: > 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) >> >> >> >> >> > From tjarvi at qbang.org Sun Nov 18 13:51:27 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 13:51:27 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs Message-ID: The following bugs have been closed and CVS updated as needed: CommPortIdentifier.getPortIdentifier throws NoSuchPortException http://bugzilla.qbang.org/show_bug.cgi?id=48 CommPortOwnership events not sent http://bugzilla.qbang.org/show_bug.cgi?id=83 JVM 1.6 builds http://bugzilla.qbang.org/show_bug.cgi?id=84 I'd like to give Martin Oberhuber CVS write access. He has been doing a great job of pushing safe patches into rxtx. I'll be preparing seperate patches for the changes I have and submitting them to the list. I'll need to work with George to do a couple things: 1) break the patch into smaller pieces to isolate issues for discussion. 2) work through the Line Status Register changes so it does not cause problems on other systems. George: If you could do the first one, it would be greatly appreciated. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Nov 18 15:33:36 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 15:33:36 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: Message-ID: I'm not running any tests at this point, I'm trying to apply the small safe patches and make sure everything is compiling. As mentioned at the bottom, there are 3 patches + the USB fix posted here that need more review before accepting. The following bugs have been closed and CVS updated as needed. Most of these are already in CVS. The diff will be small. configure script failed at line UTS_RELEASE megov http://bugzilla.qbang.org/show_bug.cgi?id=80 code cleanup patch (extra ';' creates bug for if statements + new String() calls removed) Xavier Le Vourch http://bugzilla.qbang.org/show_bug.cgi?id=77 Wont compile on linux ppc with glibc 2.5 - no sys/io.h Brian Johnson http://bugzilla.qbang.org/show_bug.cgi?id=72 rxtx overwrites System properties Andrew Gillett Nektarios K. Papadopoulos Neboj??a http://bugzilla.qbang.org/show_bug.cgi?id=64 Solaris ACM port support Dave Cleal http://bugzilla.qbang.org/show_bug.cgi?id=59 Setting of non-standard baud rate fails. Andrew Prunicki http://bugzilla.qbang.org/show_bug.cgi?id=58 RXTX uses lockfiles on MacOS X (instead of ioctl TIOCEXCL) Joachim Buechse http://bugzilla.qbang.org/show_bug.cgi?id=50 JavaDoc fixes Joachim Buechse http://bugzilla.qbang.org/show_bug.cgi?id=49 I need to further review the following: http://bugzilla.qbang.org/show_bug.cgi?id=53 http://bugzilla.qbang.org/show_bug.cgi?id=46 http://bugzilla.qbang.org/show_bug.cgi?id=41 On Sun, 18 Nov 2007, Trent Jarvi wrote: > > The following bugs have been closed and CVS updated as needed: > > CommPortIdentifier.getPortIdentifier throws NoSuchPortException > http://bugzilla.qbang.org/show_bug.cgi?id=48 > CommPortOwnership events not sent > http://bugzilla.qbang.org/show_bug.cgi?id=83 > JVM 1.6 builds > http://bugzilla.qbang.org/show_bug.cgi?id=84 > > I'd like to give Martin Oberhuber CVS write access. He has been doing a > great job of pushing safe patches into rxtx. > > I'll be preparing seperate patches for the changes I have and submitting > them to the list. > > I'll need to work with George to do a couple things: > > 1) break the patch into smaller pieces to isolate issues for discussion. > 2) work through the Line Status Register changes so it does not cause > problems on other systems. > > George: If you could do the first one, it would be greatly appreciated. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From netbeans at gatworks.com Sun Nov 18 16:20:02 2007 From: netbeans at gatworks.com (U. George) Date: Sun, 18 Nov 2007 18:20:02 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: Message-ID: <4740C8A2.6030908@gatworks.com> > I'll need to work with George to do a couple things: > > 1) break the patch into smaller pieces to isolate issues for discussion. > 2) work through the Line Status Register changes so it does not cause > problems on other systems. > > George: If you could do the first one, it would be greatly appreciated. there are ( probably ) 3 pieces: 1) the select() failure when the USB-serial device is unceremoniously unplugged ( causes rxtx to spin ) 2) TIOCSERGETLSR, need to have the simulation of it available for all os's . If the system has the capability, don't simulate for devices that have the capability. For devices that dont have the capability, but the OS still defines TIOCSERGETLSR, fall back to simulation. 3) I rearranged DEBUG ifdef's. This is probably the bulk of the patches. From tjarvi at qbang.org Sun Nov 18 18:26:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 18:26:26 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <4740C8A2.6030908@gatworks.com> References: <4740C8A2.6030908@gatworks.com> Message-ID: On Sun, 18 Nov 2007, U. George wrote: > >> I'll need to work with George to do a couple things: >> >> 1) break the patch into smaller pieces to isolate issues for discussion. >> 2) work through the Line Status Register changes so it does not cause >> problems on other systems. >> >> George: If you could do the first one, it would be greatly appreciated. > > there are ( probably ) 3 pieces: > 1) the select() failure when the USB-serial device is unceremoniously > unplugged ( causes rxtx to spin ) > 2) TIOCSERGETLSR, need to have the simulation of it available for all os's . > If the system has the capability, don't simulate for devices that have the > capability. For devices that dont have the capability, but the OS still > defines TIOCSERGETLSR, fall back to simulation. > 3) I rearranged DEBUG ifdef's. This is probably the bulk of the patches. > Hi George, I suspect if you do cvs update, there will be very few conflicts if any. While the list of fixes is fairly long, the changes are small. -- Trent Jarvi tjarvi at qbang.org From EdwardRF at xtremax.com Mon Nov 19 03:32:29 2007 From: EdwardRF at xtremax.com (Edward) Date: Mon, 19 Nov 2007 18:32:29 +0800 Subject: [Rxtx] Cannot Read under Windows XP Message-ID: <4741663D.4070200@xtremax.com> Hi Guys, I have a iTegno 3000 usb GSM modem, it is an usb-serial device. I am trying to use RXTX with it under Windows XP. The problem is it seems RXTX cannot read any data from it, but writing to it seems successful. I blindly issue a series of command to send off a SMS, it is successfully delivered, but neither the echo from the modem nor the "OK" response was received. I tried to connect to the modem directly using hyper terminal, there was no problem reading or writing. So can i assume it is not the driver problem? Then i turned to Serial Port Monitor for help, when I use hyper terminal, monitor shows both way traffic, and nothing abnormal, but when I connect using RXTX, only the data I sent to the modem is being detected, no input was detected. Does anyone else experience similar problem? Best Regards Edward From tjarvi at qbang.org Mon Nov 19 03:38:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Nov 2007 03:38:02 -0700 (MST) Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: <4741663D.4070200@xtremax.com> References: <4741663D.4070200@xtremax.com> Message-ID: On Mon, 19 Nov 2007, Edward wrote: > Hi Guys, > > I have a iTegno 3000 usb GSM modem, it is an usb-serial device. I am > trying to use RXTX with it under Windows XP. > The problem is it seems RXTX cannot read any data from it, but writing > to it seems successful. I blindly issue a series of command to send off > a SMS, it is successfully delivered, but neither the echo from the modem > nor the "OK" response was received. > > I tried to connect to the modem directly using hyper terminal, there was > no problem reading or writing. So can i assume it is not the driver problem? > > Then i turned to Serial Port Monitor for help, when I use hyper > terminal, monitor shows both way traffic, and nothing abnormal, but when > I connect using RXTX, only the data I sent to the modem is being > detected, no input was detected. > > Does anyone else experience similar problem? > Hi Edward, A common mistake is to send Strings to the modem which are i18n. You want to send the bytes. Examples of doing this are in the contrib directory with the sourcecode. ie SimpleSnuV1.java -- Trent Jarvi tjarvi at qbang.org From EdwardRF at xtremax.com Mon Nov 19 04:42:16 2007 From: EdwardRF at xtremax.com (Edward) Date: Mon, 19 Nov 2007 19:42:16 +0800 Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: References: <4741663D.4070200@xtremax.com> Message-ID: <47417698.3060705@xtremax.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071119/b0f08ba9/attachment-0007.html From netbeans at gatworks.com Mon Nov 19 06:31:30 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 19 Nov 2007 08:31:30 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: <4740C8A2.6030908@gatworks.com> Message-ID: <47419032.8080406@gatworks.com> Did the "make install". The install does not want to go to or use Makefiles's prefix = /usr/local/rxtx-devel Not terribly happy that it installed in /home/gat/JAVA/JDK14/j2sdk1.4.2_08/jre/lib/i386 Trent Jarvi wrote: > > I suspect if you do cvs update, there will be very few conflicts if any. > While the list of fixes is fairly long, the changes are small. > > -- > Trent Jarvi > tjarvi at qbang.org > > From Martin.Oberhuber at windriver.com Mon Nov 19 07:00:48 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 19 Nov 2007 15:00:48 +0100 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE6485848039986E6@ism-mail03.corp.ad.wrs.com> It's great to see things progressing - thanks Trent! I checked CVS, and it seems that most of the patch authors are yet missing from the AUTHORS file, is this intentional? The issues areound RXTXPort.close() are interesting for us in the context of Eclipse as well: https://bugs.eclipse.org/bugs/show_bug.cgi?id=208185#c3 I did a quick review and found some issues / comments: http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 http://bugzilla.qbang.org/show_bug.cgi?id=53#c9 Thanks for proposing CVS write access for me. I promise to use these thoughtfully, and discuss potential fixes openly (on bugzilla) before applying them [unless it's really trivial issues only like obvious Javadoc syntax or spelling errors]. Cheers, -- 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 Mon Nov 19 07:24:16 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 19 Nov 2007 15:24:16 +0100 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803998711@ism-mail03.corp.ad.wrs.com> Hi all, I think I've got a better version for RXTXCommDriver.checkSolaris(): http://bugzilla.qbang.org/show_bug.cgi?id=77#c3 Cheers, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From netbeans at gatworks.com Mon Nov 19 09:01:22 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 19 Nov 2007 11:01:22 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <47419032.8080406@gatworks.com> References: <4740C8A2.6030908@gatworks.com> <47419032.8080406@gatworks.com> Message-ID: <4741B352.8070205@gatworks.com> U. George wrote: > Did the "make install". The install does not want to go to or use > Makefiles's prefix = /usr/local/rxtx-devel > > Not terribly happy that it installed in > /home/gat/JAVA/JDK14/j2sdk1.4.2_08/jre/lib/i386 > Put libs and jar in MY preferential places. Ran application. And it loves to spin. Deja gnu all over again. :-/ It did find the avail /dev/ttyUSB0 port connected to LINUX usbserial/pl2303 device driver. Now to find the spin. and apply simpler set of patches From tjarvi at qbang.org Mon Nov 19 10:14:38 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Nov 2007 10:14:38 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <4741B352.8070205@gatworks.com> References: <4740C8A2.6030908@gatworks.com> <47419032.8080406@gatworks.com> <4741B352.8070205@gatworks.com> Message-ID: On Mon, 19 Nov 2007, U. George wrote: > U. George wrote: >> Did the "make install". The install does not want to go to or use >> Makefiles's prefix = /usr/local/rxtx-devel >> >> Not terribly happy that it installed in >> /home/gat/JAVA/JDK14/j2sdk1.4.2_08/jre/lib/i386 >> > Put libs and jar in MY preferential places. Ran application. And it loves to > spin. Deja gnu all over again. :-/ > > It did find the avail /dev/ttyUSB0 port connected to LINUX usbserial/pl2303 > device driver. > > Now to find the spin. and apply simpler set of patches > Hi George, When the prefix code was stomped on and the library was installed in the jre, It wasnt clear how the layout would end up looking. I'm still not sure. My usual attack was to dump a jdk onto the filesystem, set JAVA_HOME and install. When I was done, I would nuke the jdk. Obviously that may not be what people want but I'm not sure a prefix is enough to let us know what they do want. For a shared library prefix /usr/local means the library goes in /usr/local/lib. What would it mean for the jar and shared library in Java? -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Nov 19 10:24:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Nov 2007 10:24:08 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <460801A4097E3D4CA04CC64EE6485848039986E6@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848039986E6@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 19 Nov 2007, Oberhuber, Martin wrote: > > I checked CVS, and it seems that most of the patch > authors are yet missing from the AUTHORS file, > is this intentional? > There isn't a hard rule covering who goes into AUTHORS. If I recognize a person from previous patches, I try to make sure they are in. Everyone contributing (authors) is in the ChangeLog with what they did going all the way back to the first release. AUTHORS is more of a summary of what they did after a few submissions. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Nov 19 11:39:51 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 19 Nov 2007 13:39:51 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: <4740C8A2.6030908@gatworks.com> <47419032.8080406@gatworks.com> <4741B352.8070205@gatworks.com> Message-ID: <4741D877.80203@gatworks.com> For me, the makefile/prefix = /usr/local sorta suggest thats where the libs/bins/jars/... should eventually wind up. If a user does not like /usr/local, then a quick change would put it somewhere else. At this moment I dont care where the jar winds up ( in lib, or a jar directory ). So I like to keep the jre/sdk directory protected from meddling, and changes. But if a user has a penchant to use 'java -jar', then the RXTXcomm.jar file should be stuffed with the other jre/sdk jar files. From ajmas at sympatico.ca Mon Nov 19 11:54:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 19 Nov 2007 13:54:29 -0500 Subject: [Rxtx] CVS updates and closed bugs Message-ID: <20071119185429.SPYK18413.tomts22-srv.bellnexxia.net@smtp1.sympatico.ca> On this day in November "U. George" wrote: > > For me, the makefile/prefix = /usr/local sorta suggest thats where the > libs/bins/jars/... should eventually wind up. > If a user does not like /usr/local, then a quick change would put it > somewhere else. At this moment I dont care where the jar winds up ( in > lib, or a jar directory ). > So I like to keep the jre/sdk directory protected from meddling, and > changes. > But if a user has a penchant to use 'java -jar', then the RXTXcomm.jar > file should be stuffed with the other jre/sdk jar files. It should be noted that some platforms, such as MacOS X might have different conventions. In the case of MacOS X there are two 'correct' places for Java libraries that aren't part of an application: - /Library/Java/Extensions/ - ~/Library/Java/Extensions/ Andre From ajmas at sympatico.ca Mon Nov 19 18:15:37 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 19 Nov 2007 20:15:37 -0500 Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: <47417698.3060705@xtremax.com> References: <4741663D.4070200@xtremax.com> <47417698.3060705@xtremax.com> Message-ID: <3D24B671-06CA-4709-AE3C-BCDB542F427F@sympatico.ca> On 19-Nov-07, at 06:42 , Edward wrote: > Hi Trent, > > First of all, I did sent them as bytes, eg, > > output.write("at\r\n".getBytes()); > > And if writing is every the problem, it wouldn't be able to explain > why i could send out a sms successfully using RXTX. > If you have the section of code that does the communicating, could you share it with us? This should help us tell whether it is a coding issue or something more fundamental with RXTX. Andre From EdwardRF at xtremax.com Mon Nov 19 19:39:36 2007 From: EdwardRF at xtremax.com (EdwardRF) Date: Tue, 20 Nov 2007 10:39:36 +0800 Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: <3D24B671-06CA-4709-AE3C-BCDB542F427F@sympatico.ca> References: <4741663D.4070200@xtremax.com> <47417698.3060705@xtremax.com> <3D24B671-06CA-4709-AE3C-BCDB542F427F@sympatico.ca> Message-ID: <474248E8.7070002@xtremax.com> Hi Guys, Thanks for the help, i've finally found out the problem. It was a flow control issue, i did not set the flow control properly. Btw, what is the default flow control behavior for rxtx2.1.7? was it the same as 2.0? Because i remember i did not need to set the flow control when I use rxtx 2.0 2 years back. Best Regards Edward Andre-John Mas wrote: > > On 19-Nov-07, at 06:42 , Edward wrote: > >> Hi Trent, >> >> First of all, I did sent them as bytes, eg, >> >> output.write("at\r\n".getBytes()); >> >> And if writing is every the problem, it wouldn't be able to explain >> why i could send out a sms successfully using RXTX. >> > > If you have the section of code that does the communicating, could you > share it with us? This should help us tell whether it is a coding > issue or something more fundamental with RXTX. > > Andre > From netbeans at gatworks.com Tue Nov 20 06:23:26 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 20 Nov 2007 08:23:26 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: <4740C8A2.6030908@gatworks.com> Message-ID: <4742DFCE.5070504@gatworks.com> Here is the small subset of diffs just for TIOCSERGETLSR :) Next I'll pull out the usb device, and see if that also causes rxtx to spin. >> 2) TIOCSERGETLSR, need to have the simulation of it available for all >> os's . If the system has the capability, don't simulate for devices >> that have the capability. For devices that dont have the capability, >> but the OS still defines TIOCSERGETLSR, fall back to simulation. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: a Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20071120/2c5c8ee7/attachment-0004.pl From tjarvi at qbang.org Tue Nov 20 08:20:21 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Nov 2007 08:20:21 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <4742DFCE.5070504@gatworks.com> References: <4740C8A2.6030908@gatworks.com> <4742DFCE.5070504@gatworks.com> Message-ID: On Tue, 20 Nov 2007, U. George wrote: > Here is the small subset of diffs just for TIOCSERGETLSR :) > > Next I'll pull out the usb device, and see if that also causes rxtx to spin. > >>> 2) TIOCSERGETLSR, need to have the simulation of it available for all os's >>> . If the system has the capability, don't simulate for devices that have >>> the capability. For devices that dont have the capability, but the OS >>> still defines TIOCSERGETLSR, fall back to simulation. > Hi George, I'll be looking through this patch in detail tonight. I just wanted to make sure you are aware of this line in win32termios.h. The ifdef logic is messy as you noticed. That is combined with the later addition of support for it to windows. #define TIOCSERGETLSR 0x5459 (this is by far the strangest code in rxtx in retrospect) I'll be able to do extensive automated testing once we get to that point. I'm confident we can get something in that has a low probability of causing regressions. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Tue Nov 20 08:42:08 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 20 Nov 2007 10:42:08 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: <4740C8A2.6030908@gatworks.com> <4742DFCE.5070504@gatworks.com> Message-ID: <47430050.1010203@gatworks.com> It is of no difference. 1) If the define does not exist, then it should be as before. 2) If it does exist, then it should also be as before. 3) If it does exist, but the ioctl fails, then it will fallback as if it did not exist in the first place. Trent Jarvi wrote: > On Tue, 20 Nov 2007, U. George wrote: > >> Here is the small subset of diffs just for TIOCSERGETLSR :) >> >> Next I'll pull out the usb device, and see if that also causes rxtx to >> spin. >> >>>> 2) TIOCSERGETLSR, need to have the simulation of it available for >>>> all os's . If the system has the capability, don't simulate for >>>> devices that have the capability. For devices that dont have the >>>> capability, but the OS still defines TIOCSERGETLSR, fall back to >>>> simulation. >> > > Hi George, > > I'll be looking through this patch in detail tonight. I just wanted to > make sure you are aware of this line in win32termios.h. The ifdef logic > is messy as you noticed. That is combined with the later addition of > support for it to windows. > > #define TIOCSERGETLSR 0x5459 > > (this is by far the strangest code in rxtx in retrospect) > > I'll be able to do extensive automated testing once we get to that > point. I'm confident we can get something in that has a low probability > of causing regressions. > > -- > Trent Jarvi > tjarvi at qbang.org > > From netbeans at gatworks.com Tue Nov 20 08:36:56 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 20 Nov 2007 10:36:56 -0500 Subject: [Rxtx] Unplugged Opened USB devices In-Reply-To: <4742DFCE.5070504@gatworks.com> References: <4740C8A2.6030908@gatworks.com> <4742DFCE.5070504@gatworks.com> Message-ID: <4742FF18.3050005@gatworks.com> > Next I'll pull out the usb device, and see if that also causes rxtx to > spin. This is the error on a read. The select() should have failed, as well as the read(). java.io.IOException: Input/output error in nativeavailable at gnu.io.RXTXPort.nativeavailable(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1420) at jGPS.GpsData.DeviceDrivers.SerialPort.SerialPort_NMEA_GNU.serialEvent (SerialPort_NMEA_GNU.java:449) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:771) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1622) But for java program, it sees( when USB device is unplugged ) : 1) event: SerialPortEvent.DATA_AVAILABLE 2) read (non-existant) data. I think that its bad form to say DATA_AVAILABLE, when there is no data to be obtained. There does not seem to be an I/O error event. So basically, I think, and IMHO, that no events should be sent. Rather a thread timeout ( ie no data in X seconds ) AND recovery from user code should be instantiated. From manujnaman at yahoo.com Wed Nov 21 12:35:46 2007 From: manujnaman at yahoo.com (manuj naman) Date: Wed, 21 Nov 2007 11:35:46 -0800 (PST) Subject: [Rxtx] Problem reading 1-wire device using RXTX on Linux Message-ID: <371969.66249.qm@web37911.mail.mud.yahoo.com> Hello, I am trying to use the RXTX library on Ubuntu (Debian) linux to read iButtons. It works perfectly on Windows. However on my linux machines it gives the following errors. I am using DS9490 (USB port adapter) to read the iButtons. I have followed your instructions on the Wiki. I recompiled the rxtx library to produce the .so and .jar files. But still it gives me this: manujnaman at sensor:~/iButton/onewireviewer$ java -cp $CLASSPATH:./OneWireAPI.jar:./OneWireViewer.jar OneWireViewer Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Warning: serial communications API not setup properly, no ports in enumeration Pure-Java DS9097U adapter will not work, not added to adapter enum Standard drivers for 1-Wire are not found. Please download the latest drivers from http://www.ibutton.com Or install RXTX Serial Communications API from http://www.rxtx.org Do you know how to solve the "Serial communications API not setup properly, no ports in enumeration" problem? Also, how to detect which what /dev/* is the port to be used? On Windows this is simply USB1, on linux this is a bit unclear. Many thanks for your advice, Manuj Naman Dallas, TX, US manujnaman at yahoo.com --------------------------------- Be a better pen pal. Text or chat with friends inside Yahoo! Mail. See how. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071121/2760f691/attachment-0003.html From Martin.Oberhuber at windriver.com Wed Nov 21 13:55:25 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 21 Nov 2007 21:55:25 +0100 Subject: [Rxtx] Should RXTX Lixense link to LGPL-2.1 be changed? In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803A21160@ism-mail03.corp.ad.wrs.com> Hi Trent and all, In all the RXTX source files as well as http://users.frii.com/jarvi/rxtx/license.html there is the following lines: | A copy of the LGPL v 2.1 may be found at | http://www.gnu.org/licenses/lgpl.txt on March 4th 2007. A copy is | here for your convenience. But, as of today, at the link provided there is only a copy of the LGPL v3.0. I think there should be a link to the LGPL v2.1, e.g. http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html What do you think? Cheers, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Nov 21 20:46:18 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Nov 2007 20:46:18 -0700 (MST) Subject: [Rxtx] Problem reading 1-wire device using RXTX on Linux In-Reply-To: <371969.66249.qm@web37911.mail.mud.yahoo.com> References: <371969.66249.qm@web37911.mail.mud.yahoo.com> Message-ID: On Wed, 21 Nov 2007, manuj naman wrote: > Hello, > > I am trying to use the RXTX library on Ubuntu (Debian) linux to read iButtons. It works perfectly on Windows. However on my linux machines it gives the following errors. I am using DS9490 (USB port adapter) to read the iButtons. > > I have followed your instructions on the Wiki. I recompiled the rxtx library to produce the .so and .jar files. But still it gives me this: > > manujnaman at sensor:~/iButton/onewireviewer$ java -cp $CLASSPATH:./OneWireAPI.jar:./OneWireViewer.jar OneWireViewer > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > Warning: serial communications API not setup properly, no ports in enumeration > Pure-Java DS9097U adapter will not work, not added to adapter enum > > Standard drivers for 1-Wire are not found. > Please download the latest drivers from http://www.ibutton.com > Or install RXTX Serial Communications API from http://www.rxtx.org > > Do you know how to solve the "Serial communications API not setup properly, no ports in enumeration" problem? > > Also, how to detect which what /dev/* is the port to be used? On Windows this is simply USB1, on linux this is a bit unclear. Hi Manuj What is the output of the following? dmesg |grep tty touch /var/lock/test.lock && rm -f /var/lock/test.lock If you see something like /dev/ttyUSB0 in the dmesg output, what happens if you do something like tail -f /dev/ttyUSB0? These test each of the usual suspects. We are looking for missing USB drivers, no permission to create a lockfile and no read permission for the device. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Nov 21 21:05:23 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Nov 2007 21:05:23 -0700 (MST) Subject: [Rxtx] Should RXTX Lixense link to LGPL-2.1 be changed? In-Reply-To: <460801A4097E3D4CA04CC64EE648584803A21160@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803A21160@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 21 Nov 2007, Oberhuber, Martin wrote: > Hi Trent and all, > > In all the RXTX source files as well as > http://users.frii.com/jarvi/rxtx/license.html > there is the following lines: > > | A copy of the LGPL v 2.1 may be found at > | http://www.gnu.org/licenses/lgpl.txt on March 4th 2007. A copy is > | here for your convenience. > > But, as of today, at the link provided there is only > a copy of the LGPL v3.0. I think there should be a link > to the LGPL v2.1, e.g. > http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html > > What do you think? > Hi Martin, Thanks. I updated the link. Changing licences is a heavy process for me as a free software developer and an employee so I'd rather stay with 2.1 unless the current license becomes a show stopper. I figured that would happen someday so I put the date in to be clear. -- Trent Jarvi tjarvi at qbang.org From beat.arnet at gmail.com Thu Nov 22 08:45:45 2007 From: beat.arnet at gmail.com (Beat Arnet) Date: Thu, 22 Nov 2007 10:45:45 -0500 Subject: [Rxtx] Dual Core Problem Message-ID: <4745A429.9060604@gmail.com> Dear All, I am struggling with an application that uses RXTX 2.1.7 and has been working reliably in the past. When this program runs on a dual-core DELL (Intel T2500), strange things happen with the RS232 communication. The application is missing incoming characters and also often freezes when trying to close the serial port. I highly suspect a threading problem and was wondering if a) anybody had run into a similar problem with dual core processors and b) if there is a list of does and dont's when it comes to RXTX and threads. Regards, Beat From tjarvi at qbang.org Thu Nov 22 13:22:43 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 22 Nov 2007 13:22:43 -0700 (MST) Subject: [Rxtx] Dual Core Problem In-Reply-To: <4745A429.9060604@gmail.com> References: <4745A429.9060604@gmail.com> Message-ID: On Thu, 22 Nov 2007, Beat Arnet wrote: > Dear All, > I am struggling with an application that uses RXTX 2.1.7 and has been > working reliably in the past. When this program runs on a dual-core DELL > (Intel T2500), strange things happen with the RS232 communication. The > application is missing incoming characters and also often freezes when > trying to close the serial port. I highly suspect a threading problem > and was wondering if a) anybody had run into a similar problem with dual > core processors and b) if there is a list of does and dont's when it > comes to RXTX and threads. > I've used rxtx with SMP systems but have not experimented very much with threading and rxtx. One red flag rxtx raises is it stores pointers to java objects in SerialImp.c. If the JVM decides to move things around, rxtx becomes confused. Missing incomming characters is usually caused by someone running two applications. They then fight over the incomming data. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Fri Nov 23 03:12:28 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 23 Nov 2007 11:12:28 +0100 Subject: [Rxtx] Dual Core Problem In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803A84C59@ism-mail03.corp.ad.wrs.com> > Missing incomming characters is usually caused by someone running two > applications. They then fight over the incomming data. I've seen exactly this scenario on Linux with Lockfiles disabled. Usually, port locking (through Lockfiles or Ioctl method) should avoid exactly this problem. I know that on Mac, port locking through Kernel/Ioctl method has been added for the upcoming RXTX 2.1-8. What's the status of this feature for Linux and other Unixes? Cheers, Martin From chris.paton at red61.com Fri Nov 23 05:26:10 2007 From: chris.paton at red61.com (Chris Paton) Date: Fri, 23 Nov 2007 12:26:10 +0000 Subject: [Rxtx] RXTX parallel port issues Message-ID: <4746C6E2.3000304@red61.com> Hi there, I've been happily using RXTX to communicate with a serial based point-of-sale printer for a several months. I've recently received a parallel based printer and have been trying to get RXTX to talk to this too. I've encountered a few problems along the way and just wanted to check if I'm doing anything wrong, or if I've found any bugs. Writing ------- Writing to the parallel port using ParallelPort.getOutputStream works well, except when I use OutputStream.write(byte[]) to write a multiple of 8 bytes (!). Doing this causes the JVM to crash with an EXCEPTION_PRIV_INSTRUCTION on Windows. I worked around this in my application by adding an additional byte if bytesToWrite % 8 == 0. I guess I could also have called write(byte) repeatedly. This also generated a SIGSEGV on Linux but I was unable to reproduce it today using the CVS version of RXTX and a recent kernel. Reading status pins ------------------- On Linux, I've found that ParallelPort.isPaperOut and ParallelPort.isPrinterSelected appear to be inverted; i.e. when the paper is out ParallelPort.isPaperOut returns false, and when there is paper ParallelPort.isPaperOut returns true! I've tested this in both Sun JDK5 and JDK6 on machines running Linux 2.6.21 and 2.6.23. Fortunately it's easy to use a conditional based on System.getProperty("os.name") to hack around this. Reading from InputStream ------------------------ I've had more serious issues trying to read from ParallelPort.getInputStream. On Windows, readByte seems to return -1 (end of stream) any time data isn't available. On Linux, I got a kernel oops, even with a recent 2.6.23.1 kernel. I was able to stop this using a kernel patch that I found via Google. Although this stopped the oops, I still get frequent IOExceptions when calling InputStream.readByte. It appears that instead of blocking, readByte throws an IOException with message "Resource temporarily unavailable in readByte" any time it is called when no data is available. Occasionally, I get an exception instead of the data I was expecting to read, e.g when asking my printer for a version string I get "VER: S3306 * 06.03* 10/*6/06" where the *s indicate that an exception occurred and data was missed. Any advice that anyone can offer would be much appreciated. If you need any more details or debugging information about any of these problems then let me know. Cheers -- Chris Paton Technical Developer Red61 -- Transaction Marketing Software http://www.red61.com -------------- next part -------------- A non-text attachment was scrubbed... Name: chris.paton.vcf Type: text/x-vcard Size: 230 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20071123/00a747b6/attachment-0002.vcf From chris.paton at red61.com Fri Nov 23 05:26:10 2007 From: chris.paton at red61.com (Chris Paton) Date: Fri, 23 Nov 2007 12:26:10 +0000 Subject: [Rxtx] RXTX parallel port issues Message-ID: <4746C6E2.3000304@red61.com> Hi there, I've been happily using RXTX to communicate with a serial based point-of-sale printer for a several months. I've recently received a parallel based printer and have been trying to get RXTX to talk to this too. I've encountered a few problems along the way and just wanted to check if I'm doing anything wrong, or if I've found any bugs. Writing ------- Writing to the parallel port using ParallelPort.getOutputStream works well, except when I use OutputStream.write(byte[]) to write a multiple of 8 bytes (!). Doing this causes the JVM to crash with an EXCEPTION_PRIV_INSTRUCTION on Windows. I worked around this in my application by adding an additional byte if bytesToWrite % 8 == 0. I guess I could also have called write(byte) repeatedly. This also generated a SIGSEGV on Linux but I was unable to reproduce it today using the CVS version of RXTX and a recent kernel. Reading status pins ------------------- On Linux, I've found that ParallelPort.isPaperOut and ParallelPort.isPrinterSelected appear to be inverted; i.e. when the paper is out ParallelPort.isPaperOut returns false, and when there is paper ParallelPort.isPaperOut returns true! I've tested this in both Sun JDK5 and JDK6 on machines running Linux 2.6.21 and 2.6.23. Fortunately it's easy to use a conditional based on System.getProperty("os.name") to hack around this. Reading from InputStream ------------------------ I've had more serious issues trying to read from ParallelPort.getInputStream. On Windows, readByte seems to return -1 (end of stream) any time data isn't available. On Linux, I got a kernel oops, even with a recent 2.6.23.1 kernel. I was able to stop this using a kernel patch that I found via Google. Although this stopped the oops, I still get frequent IOExceptions when calling InputStream.readByte. It appears that instead of blocking, readByte throws an IOException with message "Resource temporarily unavailable in readByte" any time it is called when no data is available. Occasionally, I get an exception instead of the data I was expecting to read, e.g when asking my printer for a version string I get "VER: S3306 * 06.03* 10/*6/06" where the *s indicate that an exception occurred and data was missed. Any advice that anyone can offer would be much appreciated. If you need any more details or debugging information about any of these problems then let me know. Cheers -- Chris Paton Technical Developer Red61 -- Transaction Marketing Software http://www.red61.com -------------- next part -------------- A non-text attachment was scrubbed... Name: chris.paton.vcf Type: text/x-vcard Size: 230 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20071123/00a747b6/attachment-0003.vcf From hho at bibliotheca.dk Fri Nov 23 06:45:36 2007 From: hho at bibliotheca.dk (Hans Hvelplund Odborg) Date: Fri, 23 Nov 2007 14:45:36 +0100 Subject: [Rxtx] RXTX parallel port issues In-Reply-To: <4746C6E2.3000304@red61.com> References: <4746C6E2.3000304@red61.com> Message-ID: <001201c82dd7$21c6e2c0$6a37a8c0@HANSLAPTOP> I've experienced similar crashes in JVM when writing to the parallel port in windows (with rxtx). Unfortunately I did not save the data sent to the parallel port so cannot say anything about the length. Furthermore, I recall having problems with .write(byte) (would never exit if I recall correctly), but I do not recall if this was with serial or parallel or both. In the end, we ended printing through Java's support of the windows driver. Unfortunately I currently don?t have the time to investigate these issues further. I just wanted to let you know that currently there are bugs in rxtx. Med venlig hilsen / Best regards / Med v?nliga h?lsningar Hans Hvelplund Odborg BIBLIOTHECA A/S Vallensb?kvej 20B ? 2605 Br?ndby ? Denmark Tel.: +45 70271008 Fax: +45 70271009 hho at bibliotheca.dk www.bibliotheca.dk -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Chris Paton Sent: 23. november 2007 13:26 To: rxtx at qbang.org Subject: [Rxtx] RXTX parallel port issues Hi there, I've been happily using RXTX to communicate with a serial based point-of-sale printer for a several months. I've recently received a parallel based printer and have been trying to get RXTX to talk to this too. I've encountered a few problems along the way and just wanted to check if I'm doing anything wrong, or if I've found any bugs. Writing ------- Writing to the parallel port using ParallelPort.getOutputStream works well, except when I use OutputStream.write(byte[]) to write a multiple of 8 bytes (!). Doing this causes the JVM to crash with an EXCEPTION_PRIV_INSTRUCTION on Windows. I worked around this in my application by adding an additional byte if bytesToWrite % 8 == 0. I guess I could also have called write(byte) repeatedly. This also generated a SIGSEGV on Linux but I was unable to reproduce it today using the CVS version of RXTX and a recent kernel. Reading status pins ------------------- On Linux, I've found that ParallelPort.isPaperOut and ParallelPort.isPrinterSelected appear to be inverted; i.e. when the paper is out ParallelPort.isPaperOut returns false, and when there is paper ParallelPort.isPaperOut returns true! I've tested this in both Sun JDK5 and JDK6 on machines running Linux 2.6.21 and 2.6.23. Fortunately it's easy to use a conditional based on System.getProperty("os.name") to hack around this. Reading from InputStream ------------------------ I've had more serious issues trying to read from ParallelPort.getInputStream. On Windows, readByte seems to return -1 (end of stream) any time data isn't available. On Linux, I got a kernel oops, even with a recent 2.6.23.1 kernel. I was able to stop this using a kernel patch that I found via Google. Although this stopped the oops, I still get frequent IOExceptions when calling InputStream.readByte. It appears that instead of blocking, readByte throws an IOException with message "Resource temporarily unavailable in readByte" any time it is called when no data is available. Occasionally, I get an exception instead of the data I was expecting to read, e.g when asking my printer for a version string I get "VER: S3306 * 06.03* 10/*6/06" where the *s indicate that an exception occurred and data was missed. Any advice that anyone can offer would be much appreciated. If you need any more details or debugging information about any of these problems then let me know. Cheers -- Chris Paton Technical Developer Red61 -- Transaction Marketing Software http://www.red61.com From tjarvi at qbang.org Fri Nov 23 16:28:23 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 23 Nov 2007 16:28:23 -0700 (MST) Subject: [Rxtx] RXTX parallel port issues In-Reply-To: <001201c82dd7$21c6e2c0$6a37a8c0@HANSLAPTOP> References: <4746C6E2.3000304@red61.com> <001201c82dd7$21c6e2c0$6a37a8c0@HANSLAPTOP> Message-ID: It would be good to create a bug report for this so others can either look into it or find the report to confirm their suspicions. Currently, there is only one parallel port bug report. http://bugzilla.qbang.org/show_bug.cgi?id=40 As we do update the reports when bugs are fixed, it gives people a chance to put themselves on the CC list and get notification of fixes they are interested in. On Fri, 23 Nov 2007, Hans Hvelplund Odborg wrote: > > I've experienced similar crashes in JVM when writing to the parallel port in > windows (with rxtx). > > Unfortunately I did not save the data sent to the parallel port so cannot > say anything about the length. > > Furthermore, I recall having problems with .write(byte) (would never exit if > I recall correctly), but I do not recall if this was with serial or parallel > or both. > > In the end, we ended printing through Java's support of the windows driver. > > Unfortunately I currently don?t have the time to investigate these issues > further. I just wanted to let you know that currently there are bugs in > rxtx. > > > Med venlig hilsen / Best regards / Med v?nliga h?lsningar > Hans Hvelplund Odborg > > BIBLIOTHECA A/S > Vallensb?kvej 20B ? 2605 Br?ndby ? Denmark > Tel.: +45 70271008 > Fax: +45 70271009 > hho at bibliotheca.dk > www.bibliotheca.dk > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Chris Paton > Sent: 23. november 2007 13:26 > To: rxtx at qbang.org > Subject: [Rxtx] RXTX parallel port issues > > Hi there, > > I've been happily using RXTX to communicate with a serial based > point-of-sale printer for a several months. I've recently received a > parallel based printer and have been trying to get RXTX to talk to this > too. I've encountered a few problems along the way and just wanted to > check if I'm doing anything wrong, or if I've found any bugs. > > Writing > ------- > Writing to the parallel port using ParallelPort.getOutputStream works > well, except when I use OutputStream.write(byte[]) to write a multiple > of 8 bytes (!). Doing this causes the JVM to crash with an > EXCEPTION_PRIV_INSTRUCTION on Windows. I worked around this in my > application by adding an additional byte if bytesToWrite % 8 == 0. I > guess I could also have called write(byte) repeatedly. > > This also generated a SIGSEGV on Linux but I was unable to reproduce it > today using the CVS version of RXTX and a recent kernel. > > Reading status pins > ------------------- > On Linux, I've found that ParallelPort.isPaperOut and > ParallelPort.isPrinterSelected appear to be inverted; i.e. when the > paper is out ParallelPort.isPaperOut returns false, and when there is > paper ParallelPort.isPaperOut returns true! I've tested this in both Sun > JDK5 and JDK6 on machines running Linux 2.6.21 and 2.6.23. Fortunately > it's easy to use a conditional based on System.getProperty("os.name") to > hack around this. > > Reading from InputStream > ------------------------ > > I've had more serious issues trying to read from > ParallelPort.getInputStream. On Windows, readByte seems to return -1 > (end of stream) any time data isn't available. > > On Linux, I got a kernel oops, even with a recent 2.6.23.1 > kernel. I was able to stop this using a kernel patch > > that I found via Google. Although this stopped the oops, I still get > frequent IOExceptions when calling InputStream.readByte. It appears that > instead of blocking, readByte throws an IOException with message > "Resource temporarily unavailable in readByte" any time it is called > when no data is available. Occasionally, I get an exception instead of > the data I was expecting to read, e.g when asking my printer for a > version string I get "VER: S3306 * 06.03* 10/*6/06" where the *s > indicate that an exception occurred and data was missed. > > > Any advice that anyone can offer would be much appreciated. If you need > any more details or debugging information about any of these problems > then let me know. > > Cheers > From keithvz at verizon.net Thu Nov 1 08:08:58 2007 From: keithvz at verizon.net (Keith) Date: Thu, 01 Nov 2007 10:08:58 -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: <4729DDFA.7080206@verizon.net> Trent Jarvi wrote: > 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? Well, I honestly don't know how all this fits together. I think it's just a matter of enabling the right flow control option within the standard serial framework to tell the device driver, "HEY START USING DTR/DSR FOR FLOW CONTROL." If what UGeorge said,(about that type of nitty-gritty lead control being done within the device driver), is true, then this confirms my suspicion. I tried narrowing down within the Linux drivers what you are looking for, but I can't entirely tell wth I'm looking at. (virtual com port drivers -- they are included compiled by default with Ubuntu, source included) http://www.ftdichip.com/Drivers/VCP/Linux/ftdi_sio.tar.gz Hahahaa, they make a reference to DTR flow control being supported but say (UGH) in parenthesis. You can also use their direct device driver library on Ubuntu -- libftd2xx.so.0.4.13. No source code. http://www.ftdichip.com/Drivers/D2XX/Linux/libftd2xx0.4.13.tar.gz In that case, you make a call to their FT_SetFlowControl() function. FT_STATUS FT_SetFlowControl (FT_HANDLE ftHandle, USHORT usFlowControl, UCHAR uXon,UCHAR uXoff) Parameters ftHandle Handle of the device. usFlowControl Must be one of FT_FLOW_NONE, FT_FLOW_RTS_CTS, ****FT_FLOW_DTR_DSR**** or FT_FLOW_XON_XOFF. uXon Character used to signal Xon. Only used if flow control is FT_FLOW_XON_XOFF. uXoff Character used to signal Xoff. Only used if flow control is FT_FLOW_XON_XOFF. This is from their programming guide http://www.ftdichip.com/Documents/ProgramGuides/D2XXPG34.pdf I actually want to take this a step further and say that I think the flow control is actually handled right on the device itself in hardware/firmware. It's enabled through the device driver, but I think the maintaining of buffers, asserting/deasserting of leads, etc is handled by the device. For the time being, I've switched to jd2xx, https://jd2xx.dev.java.net/ and http://bleyer.org/jd2xx/ These are Java wrappers for the device driver libraries. It allows almost direct access to the well-documented device drivers from Java. I hope this helps Keith From tjarvi at qbang.org Thu Nov 1 11:09:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:09:51 -0600 (MDT) 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: Hi Martin, What I usually have done is allow changes that do not impact working software including changes to methods not documented in CommAPI (which remain undocumented in rxtx) and fixes to known problems in the documented portions. That way if you use the documented API, the releases should only become better with time. If you use the undocumented portions, the behavior is not as predictable but open for improvement. On Wed, 31 Oct 2007, 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 >> > From tjarvi at qbang.org Thu Nov 1 11:15:52 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:15:52 -0600 (MDT) 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: I too use rxtx in commercial products. The problem I've been trying to address while bringing the server back was how to make it possible for hobby folks to build the same software as companies so we can move rxtx along a little faster. Exposing internal tools is not an option at this time, the public rxtx builds have been done on my home machine which has drives hanging out of it all over the place dying one at a time. This isn't maintainable. I'm currently looking at the possibility of making an S3 image available on Amazon's EC. These are machines you can rent for ~10 cents an hour which is more than enough to build rxtx. The S3 image is not changed when people use it so everyone has the same starting point. With this, we could all build rxtx for ~20 platforms for a small price and eliminate tool issues. On Wed, 31 Oct 2007, Greg Johnson wrote: > 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 tjarvi at qbang.org Thu Nov 1 11:19:55 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:19:55 -0600 (MDT) 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: On Wed, 31 Oct 2007, 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. I was helping Dmitry do the Mac OS X port without access to a machine when we put that in. In the archives there is information (easily found with google on Apple's site) that describes how their API (and others) can determine if a port is used and ignore it. I think these changes are in CVS but need to confirm. The bottom line is that rxtx should not have used lock files on Mac. It was just ignorance of the system on my part. -- Trent Jarvi tjarvi at qbang.org From fabioanjos at gmail.com Thu Nov 1 12:35:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Thu, 1 Nov 2007 15:35:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Hi, I was using SerialEventListener in my project. But, as was said here, id doesnt work very well with virtual serial ports. So, I changed the strategy using the code posted here in this thread: try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > 0) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } The thing is that in my tests I could notice that in.read(buffer) never blocks. Even when there's nothing to read. Instead of blocking when there's nothing to read it returns 0. So, my questions are: 1. Am I doing something wrong? 2. If not, wouldnt this decrease performance? (the thread would be locked in a loop that does nothing.) 3. Is there a better way to do the job? Thanks in advance!! F?bio -------- On 10/31/07, Andre-John Mas wrote: > > > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/0aee59d0/attachment-0025.html From ajmas at sympatico.ca Thu Nov 1 16:07:55 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Nov 2007 18:07:55 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Message-ID: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From sarah_662005 at yahoo.com Thu Nov 1 17:10:05 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Thu, 1 Nov 2007 16:10:05 -0700 (PDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Message-ID: <351433.37166.qm@web55814.mail.re3.yahoo.com> Thank you very much for your help. Now the application works fine. the serialEvent gets triggered. Rxtx is cool! ----- Original Message ---- From: Andre-John Mas To: Sara Hugh ; RXTX Developers and Users Sent: Wednesday, October 31, 2007 9:55:45 AM Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered 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 __________________________________________________ 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/20071101/4a86bea6/attachment-0025.html From tjarvi at qbang.org Thu Nov 1 17:58:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 17:58:02 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx Message-ID: The rxtx.org site is primarily interested in the hobby aspects of rxtx. Obviously, there are some companies following the work too. These interests bring larger workflows and concerns about details hobby folks may not care about. They also bring many more users. I know the company I work for has a quality engineering effort going on which includes rxtx. While the server was down, I was contacted by another company that was missing the binaries for their testing. Several people have mentioned concerns about a stable release for like reasons. Would there be interest on the quality side of the coin to get together? It could be just sharing email's with each other or a seperate list for QE/QA. I can not say for sure, but we may be able to share some of our efforts/results that could help keep rxtx releases stable. -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Fri Nov 2 01:42:55 2007 From: scldad at sdc.com.au (Stephen Davies) Date: Fri, 2 Nov 2007 18:12:55 +1030 Subject: [Rxtx] Multiple modems Message-ID: <200711021812.56047.scldad@sdc.com.au> This may or may not be related to the Multiple Ports thread. I have an application which uses rxtx on Linux (via cron jobs) to connect multiple modems to remote sensing devices. The application works fine most of the time but occasionally fails to connect if two (or more) connection attempts happen at about the same time. When it fails, it looks as if it may get confused as to which port it is talking to. The app has a "base" component that looks for an available port, opens it and then creates an input thread and an output thread for the connection and data transfer. The "base" component uses this code: // loop round all known ports until one is available. Give up after three minutes Counter ptimeout = new Counter(); while(!portFound && ptimeout.elapsed() < 180000) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // special case. ttyS0 is not available to us on this server. if (!portId.isCurrentlyOwned() && !portId.getName().equals("/dev/ttyS0")) { gLog.debug(lognm + ": Found port " + portId.getName()); try { serialPort = (RXTXPort) portId.open("AguaModem", 10000); } catch (Exception e) { gLog.error(lognm + ": Port " + portId.getName() + " will not open."); gLog.error(e.getMessage()); continue; } AguaModem aguamodem = new AguaModem(); portFound = true; break; } gLog.debug(lognm + ": Port " + portId.getName() + " is busy"); } } } I am wondering about the isCurrentlyOwned method. Does this actually tell me whether a port is currently being used by another process? TIA, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From fabioanjos at gmail.com Fri Nov 2 04:59:58 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 07:59:58 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Message-ID: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/9009eb1d/attachment-0025.html From netbeans at gatworks.com Fri Nov 2 06:28:13 2007 From: netbeans at gatworks.com (U. George) Date: Fri, 02 Nov 2007 08:28:13 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <472B17DD.1050508@gatworks.com> It should normally block ( unless eof / event ) . so its a :{ whats the device ( to recreate if possible ) and how do u open. > My question is, is there a way to make in.read block the thead until > there's something to read? > From fabioanjos at gmail.com Fri Nov 2 06:34:46 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 09:34:46 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > On 11/1/07, Andre-John Mas wrote: > > > > Fabio, > > > > Turns out there was a small error in my example. The test should be: > > > > (numBytes = in.read(buffer)) > -1 > > > > This is because -1 indicates an end of file (end of data stream) > > > > Andre > > > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > > > Hi, > > > > > > I was using SerialEventListener in my project. But, as was said > > > here, id doesnt work very well with virtual serial ports. > > > So, I changed the strategy using the code posted here in this thread: > > > > > > try{ > > > in = port.getInputStream(); > > > out = port.getOutputStream(); > > > int numBytes = 0; > > > while(active){ > > > > > > byte[] buffer = new byte[10]; > > > > > > while ( (numBytes = in.read(buffer)) > 0) > > > { > > > String dataValue = new String(buffer,0,numBytes); > > > processInput(dataValue); > > > } > > > > > > if(numBytes==-1){ > > > break; > > > } > > > > > > Thread.sleep(50); > > > } > > > > > > }catch(IOException e){ > > > logger.info("falha de comunicacao "+ > > > getReceptor().getPort() ); > > > > > > }catch(InterruptedException e){ > > > logger.info ("Interrompendo leitura da porta "+ > > > getReceptor().getPort() ); > > > } > > > > > > The thing is that in my tests I could notice that in.read(buffer) > > > never blocks. Even when there's nothing to read. Instead of blocking > > > when there's nothing to read it returns 0. > > > > > > So, my questions are: > > > > > > 1. Am I doing something wrong? > > > 2. If not, wouldnt this decrease performance? (the thread would be > > > locked in a loop that does nothing.) > > > 3. Is there a better way to do the job? > > > > > > Thanks in advance!! > > > > > > F?bio > > > -------- > > > > > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > > 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 > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > > > > > -- > > > Atenciosamente, > > > F?bio Cristiano dos Anjos > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/5306c4b1/attachment-0025.html From nick.circelli at infrasafe.com Fri Nov 2 07:01:17 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Fri, 2 Nov 2007 08:01:17 -0500 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com><29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com><90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca><29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Message-ID: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> I'm pretty sure that not blocking has to do with you virtual ports. Cause it should block. Maybe you should try: while ((numBytes = in.available()) > 0) { If (numBytes > buffer.length) { numBytes = buffer.length; // in case you have buffer overflow } numBytes = in.read(buffer, 0 , numBytes)); String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } Also, just for optimization, I'd move that byte[] buffer = new byte[10]; out of the while since you don't need to reallocate it every iteration. ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of F?bio Cristiano dos Anjos Sent: Friday, November 02, 2007 8:35 AM To: RXTX Developers and Users Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream (); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas < ajmas at sympatico.ca > wrote: Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info ("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Atenciosamente, F?bio Cristiano dos Anjos -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/4de7f6a3/attachment-0025.html From fabioanjos at gmail.com Fri Nov 2 07:36:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 10:36:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> Message-ID: <29788b250711020636q1588c88fgaa5e27f5504164fb@mail.gmail.com> Hi Nick, Actually, it doesnt block for physical ports too. And, the method avaiable does not block either, so when there's nothing avaiable the loop ends and the thread stops lintening to the port. But I did some more test with serialEventListener, and now its working. I realy dont know what I've done to get it working. I just start woking as soon as I decided to test it again. It was said here that serialEventListener is not reliable for virtual serial ports. Is there another way to read it, without compromising performance? Tanks again!! F?bio ------- On 11/2/07, Nick Circelli wrote: > > I'm pretty sure that not blocking has to do with you virtual ports. > Cause it should block. > > Maybe you should try: > > > > while ((numBytes = in.available()) > 0) > > { > > If (numBytes > buffer.length) { > > numBytes = buffer.length; // in case you have buffer overflow > > } > > numBytes = in.read(buffer, 0 , numBytes)); > > String dataValue = new String(buffer,0,numBytes,"ASCII"); > > processInput(dataValue); > > } > > > > Also, just for optimization, I'd move that byte[] buffer = new > byte[10]; > > out of the while since you don't need to reallocate it every iteration. > > > ------------------------------ > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On Behalf > Of *F?bio Cristiano dos Anjos > *Sent:* Friday, November 02, 2007 8:35 AM > *To:* RXTX Developers and Users > *Subject:* Re: [Rxtx] serialEvent(SerialPortEvent event) never be > triggered > > > > Hi, > > I think i missunderstand something here. > The code you post here was meant to be used inside serialEvent method, > right? > > The think is, that i cannot user SerialEventListener to read serial ports, > because i need to read virual serial ports and id does not behaves well, as > said here before. serialEvent is never triggered. > > So what I quit using SerialEventListener and created a thread to listen to > the port: > > public void run(){ > try{ > in = port.getInputStream(); > out = port.getOutputStream (); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new > String(buffer,0,numBytes,"ASCII"); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ getReceptor().getPort() > ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > } > > > So, the problem is that in.read(buffer) always returns 0 when there is > nothing to read, instead of blocking the flow, and the thread becames locked > in the loop. > > I hope you can help me solve this. > > Thanks in advance! > > F?bio > -------- > > On 11/2/07, *F?bio Cristiano dos Anjos* wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > > > On 11/1/07, *Andre-John Mas* < ajmas at sympatico.ca> wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info ("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/571df6ea/attachment-0024.html From tjarvi at qbang.org Fri Nov 2 08:32:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Nov 2007 08:32:15 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: References: Message-ID: On Fri, 2 Nov 2007, Greg Johnson wrote: > Hi Trent, folks, > Having a single rxtx that is suitable for commercial uses and hobbyists both > would be a great idea? Perhaps it would be worth submitting rxtx as a > proposal to Codehaus - they not only provide excellent tools (Jira (bug > tracker), Confluence (wiki)) but also support build management ( > maestro, continuum, bamboo). Relying on your personal machine (btw, frii.com > / rxtx.org is down again?) seems like a burden you shouldn't have to shoulder > alone. Hi Greg, There may be a little confusion here. There is no need to have two seperate rxtx releases. What I'm trying to encourage is a discussion between some of the people responsible for making sure rxtx does not break their products each release. Usually these people are interested in testing a set of functionality their product depends upon. They do not work with rxtx code but rather traps to catch when rxtx developers break something. This goes on all the time in isolated labs. There are many services that offer to do various pieces of a project for you if you... Anyone is free to do the 'if you' portion with rxtx and see how it goes. I'm actually interested in doing less of that than more. The rxtx.org work I do just happens to overlap with other things I do for personal/family use. The reason I suggest the amazon solution is that anyone can take full control of the environment for a day and it costs less than a package of gum without causing harm to what anyone else is doing. I assume the down question was with respect to a mod_security setting that has been resolved. If not, please post a url to the problem. -- Trent Jarvi tjarvi at qbang.org From nsayer at kfu.com Sat Nov 3 20:17:49 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 19:17:49 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? Message-ID: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Has anyone got RXTX working with an app under Leopard? My app hangs on port open (it works fine with Tiger). The relevant thread looks like this in the activity monitor: 1536 JVM_InvokeMethod 1536 0x48ccd0 1536 0x46f8a0 1536 0x4c3ff4 1536 0x4c4284 1536 0x357d160 1536 0x357faac 1536 Java_gnu_io_RXTXPort_open 1536 open $NOCANCEL$UNIX2003 1536 open $NOCANCEL$UNIX2003 From ajmas at sympatico.ca Sat Nov 3 22:02:04 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 00:02:04 -0400 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> RXTX works for me with Leopard. I am currently using it communicate with a Bluetooth GPS. What computer and device are you trying to use? Is the driver for your serial device compatible with MacOS X 10.5? Andre On 3-Nov-07, at 22:17 , Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From nsayer at kfu.com Sat Nov 3 22:17:47 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 21:17:47 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> Message-ID: <1720F723-3643-438C-B3AB-E09A67536977@kfu.com> On Nov 3, 2007, at 9:02 PM, Andre-John Mas wrote: > RXTX works for me with Leopard. I am currently using it communicate > with a Bluetooth GPS. > > What computer and device are you trying to use? Is the driver for > your serial device compatible with MacOS X 10.5? An Intel mac mini The FTDI USB serial driver an XMPCR, which is just a fancy serial controlled radio and an FTDI usb-to-serial chip I've successfully used the FTDI driver with another FTDI device in another context. > > > Andre > > On 3-Nov-07, at 22:17 , Nick Sayer wrote: > >> Has anyone got RXTX working with an app under Leopard? >> >> My app hangs on port open (it works fine with Tiger). The relevant >> thread looks like this in the activity monitor: >> >> 1536 JVM_InvokeMethod >> 1536 0x48ccd0 >> 1536 0x46f8a0 >> 1536 0x4c3ff4 >> 1536 0x4c4284 >> 1536 0x357d160 >> 1536 0x357faac >> 1536 >> Java_gnu_io_RXTXPort_open >> 1536 open >> $NOCANCEL$UNIX2003 >> 1536 open >> $NOCANCEL$UNIX2003 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From racecar at gmail.com Sat Nov 3 22:25:53 2007 From: racecar at gmail.com (Kevin Mateo Lim) Date: Sat, 3 Nov 2007 21:25:53 -0700 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: Message-ID: I am alternating between two errors. After i run the macosx_setup.command, "everyone" is set to Read only in /var/lock. I notice in the terminal that the group for these perms is _uucp, not uucp. In that state, I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 check_group_uucp(): error testing lock file creation Error details:Permission deniedcheck_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException : Error inside Serial.() at processing.serial.Serial.errorMessage(Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.( Serial.java:102) at Temporary_829_3245.setup(Temporary_829_3245.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java :690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) Then, I hand edit the "everyone" permissions for /var/lock/ to Read and Write (note /var/spool/uucp is Read/Write in all cases, and doesn't change). I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX uucp_lock() /var/lock/LK.003.009.000 is there gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException: Error inside Serial.() at processing.serial.Serial.errorMessage (Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.(Serial.java:102) at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java:690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) See here: http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071103/f1a2c467/attachment-0023.html From greg.johnson at manchester.ac.uk Sun Nov 4 02:31:13 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sun, 4 Nov 2007 10:31:13 +0100 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <28B5E0A0-0802-4C74-AC21-87ED35F3B9A2@manchester.ac.uk> Hi Nick, I also had problems initially with Leopard, but it was resolved by reinstalling the serial USB driver (FTDI in my case). The symptoms were a non-detection of any ports (but I twigged when I tried ZTerm and it had the same problem). Good luck! Cheers, greg PS I did a "Archive and install" which may be the reason my FTDI driver had disappeared - I don't think the driver has changed for 10.5 ------------------------------------------------------------------------- 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 4 Nov 2007, at 03:17, Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Sun Nov 4 13:01:12 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 15:01:12 -0500 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: Message-ID: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Hi, You will need to get the 2.1-8 code from CVS. See the FAQ for more information: http://rxtx.qbang.org/wiki/index.php/FAQ Andre On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > I am alternating between two errors. > > After i run the macosx_setup.command, "everyone" is set to Read only > in /var/lock. I notice in the terminal that the group for these > perms is _uucp, not uucp. > > In that state, I get this error: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > check_group_uucp(): error testing lock file creation Error > details:Permission deniedcheck_lock_status: No permission to create > lock file. > please see: How can I use Lock Files with rxtx? in INSTALL > gnu.io.PortInUseException: Unknown Application > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > java.lang.RuntimeException : Error inside Serial.() > > at processing.serial.Serial.errorMessage(Serial.java:583) > > at processing.serial.Serial.(Serial.java:148) > > at processing.serial.Serial.( Serial.java:102) > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > at processing.core.PApplet.run(PApplet.java:1556) > > at java.lang.Thread.run(Thread.java:613) > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > and Write (note /var/spool/uucp is Read/Write in all cases, and > doesn't change). I get this error: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > gnu.io.PortInUseException: Unknown Application > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > java.lang.RuntimeException: Error inside Serial.() > > at processing.serial.Serial.errorMessage (Serial.java:583) > > at processing.serial.Serial.(Serial.java:148) > > at processing.serial.Serial.(Serial.java:102) > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > at processing.core.PApplet.run(PApplet.java:1556) > > at java.lang.Thread.run(Thread.java:613) > > See here: > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From netbeans at gatworks.com Sun Nov 4 14:33:35 2007 From: netbeans at gatworks.com (U. George) Date: Sun, 04 Nov 2007 16:33:35 -0500 Subject: [Rxtx] #ifndef TIOCSERGETLSR Message-ID: <472E3AAF.7050709@gatworks.com> For Linux, it seems that you need the code for both *having* a TIOCSERGETLSR, and *not having* a TIOCSERGETLSR. Maybe the ioctl exists system wide, but not necessarily for the device driver itself ( always returns -1 ) . Are there systems that have a *functioning* TIOCSERGETLSR for all their devices? Then this would be the case where the "#ifndef TIOCSERGETLSR" directive could be useful is eliminating the unnecessary code and tests. And for those systems that dont have a TIOCSERGETLSR, then the code for TIOCSERGETLSR can be eliminated. It would be a simple case to have, as a foundation, all the code to simulate the missing TIOCSERGETLSR ioctl. If the system does have the ioctl, then that code can be ifdef'd in, and co-exist with the functionality of the code that simulates the missing TIOCSERGETLSR ioctl. From racecar at gmail.com Sun Nov 4 17:30:19 2007 From: racecar at gmail.com (Kevin Mateo Lim) Date: Sun, 4 Nov 2007 17:30:19 -0700 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: the README.OSX reads: Put libSerial.jnilib in the directory of the application (the JavaVM will find it there). Add RXTXComm.jar to the application classpath or include the classes in the application jar. (Some applications already include the RXTX classes in their application jar, in which case only the file libSerial.jnilib is required). I can't find libSerial.jnilib I put librxtxSerial.jnilib into my Processing /libraries/serial/library/ directory. Yet it still sees the old version: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 On 11/4/07, Andre-John Mas wrote: > > Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > 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/20071104/c0a83f91/attachment-0022.html From ajmas at sympatico.ca Sun Nov 4 17:41:47 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 19:41:47 -0500 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> If you are wanting it to be available for all applications, - for all users: /Library/Java/Extensions - for your user: ~/Library/Java/Extensions Or just for your application, then it should be in the same directory from which yo are launching your application. If you are getting the 2.1-8 source, then the library built is called: librxtxSerial.jnilib despite what the docs say. Andre On 4-Nov-07, at 19:30 , Kevin Mateo Lim wrote: > > the README.OSX reads: > Put > libSerial.jnilib > in the directory of the application (the JavaVM will find it there). > Add > RXTXComm.jar > to the application classpath or include the classes in the > application jar. > (Some applications already include the RXTX classes in their > application jar, > in which case only the file libSerial.jnilib is required). > > > I can't find libSerial.jnilib > I put librxtxSerial.jnilib into my Processing /libraries/serial/ > library/ directory. > > Yet it still sees the old version: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > On 11/4/07, Andre-John Mas wrote: Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial .(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay (PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > From bschlining at gmail.com Sun Nov 4 19:46:23 2007 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 4 Nov 2007 18:46:23 -0800 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> Message-ID: > > Or just for your application, then it should be in the same directory > from which yo are launching your application. Just wanted to add one more way of specifying the native lib location... If you don't want to define it globally by putting it in /Library/Java/Extensions (and you don't, it's a very very bad practice) you can also specify the location of the native library when starting the JVM by specifying the 'java.library.path' property. For example: java -Djava.library.path=/Path/To/Directory/With/RXTX/Library YourMainClass -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071104/c5af6980/attachment-0022.html From greg.johnson at manchester.ac.uk Mon Nov 5 01:39:02 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Mon, 5 Nov 2007 09:39:02 +0100 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: The 2.1-8 code reports 2.1-7, hence your (and my) confusion. But as long as you've removed all traces of the old library, it really _is_ 2.1-8. And if you specify the library path to the VM, don't make my mistake (on OSX at least) - you need to respecify the entire library path it had by default, as the command line argument replaces the path, rather than appending to it. 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 5 Nov 2007, at 01:30, Kevin Mateo Lim wrote: > > the README.OSX reads: > Put > libSerial.jnilib > in the directory of the application (the JavaVM will find it there). > Add > RXTXComm.jar > to the application classpath or include the classes in the > application jar. > (Some applications already include the RXTX classes in their > application jar, > in which case only the file libSerial.jnilib is required). > > > I can't find libSerial.jnilib > I put librxtxSerial.jnilib into my Processing /libraries/serial/ > library/ directory. > > Yet it still sees the old version: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > On 11/4/07, Andre-John Mas wrote: > Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial .(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay (PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > 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 HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071105/7f50506d/attachment-0022.html From cyrille.dumont at tatexpress.fr Mon Nov 5 05:46:03 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 05 Nov 2007 13:46:03 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: References: <472727F1.1000704@tatexpress.fr> Message-ID: <472F108B.2090101@tatexpress.fr> Thanks a lot for your solution ... but I'm not a expert in JAVA ... (sorry) For the moment I've this function : """ public void serialEvent(SerialPortEvent e) { StringBuffer inputBuffer = new StringBuffer(); int newData = 0; switch (e.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } //-- Manag. Data from Scanner this.MngDataScanner(inputBuffer.toString()); break; case SerialPortEvent.BI:; //-- Break Received } } """ How can I do what you write ? ( maybe a simple ex ? ) PS : I don't know the PDF417 size (could be, for example, 338 char, or 500 ... ; what I know is that it can't be more than 800 char) Thanks in advance. Best regards. Trent Jarvi a ?crit : > 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 Martin.Oberhuber at windriver.com Mon Nov 5 08:47:50 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 5 Nov 2007 16:47:50 +0100 Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> Hi Trent, are the interestes of hobbyists really so different from commercial ones? Both should be interested in high quality and innovation the like. I haven't seen too many Open Source projects from the "inside" but those that I have seen did not have separate mailing lists for quality/testing/qa versus innovation/development. What I have seen with the Open Source projects that one would call "successful" is a good deal of process around automated builds, automated unit tests, predictable release dates and milestones, and policies around commiting/contributing/reviewing changes. I think that all of these benefit commercial users and hobbyists the like. If you were just asking about who's interested in discussing changes to foster more quality, count me in. I'm just not sure whether discussing these on a separate mailing list or other channel is the right thing to do. Cheers, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From toupsz at cs.tamu.edu Tue Nov 6 14:27:04 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 15:27:04 -0600 Subject: [Rxtx] reading TTL level signals from serial? Message-ID: Dear RXTX community- I've been using RXTX to handle communicating with several hardware devices in Java (a GPS and some custom audio circuitry for my dissertation work). I have a new, high-accuracy GPS which only communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there any way to communicate with this device using RXTX, perhaps by modding the native code for Windows? If so, does anyone have any tips on how to do it? Has it perhaps already been done? Another option is for me to invert / amplify the signal in hardware, but this is difficult for me to pull off due to the sensitivity of the electronics involved...I'll likely end up using a much less accurate piece of equipment rather than go that far! If anyone could help out, I'd really appreciate it! Thanks! -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/b6c59c2b/attachment-0020.html From netbeans at gatworks.com Tue Nov 6 14:55:22 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 06 Nov 2007 16:55:22 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: Message-ID: <4730E2CA.3090009@gatworks.com> This is really a hardware issue. Is there any device ( ie the serial port ) on your computer that will accept the voltage signals ( and load ) that your device produces? Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it happen safely ( ie u dont cook the GPS device ) I have a new, high-accuracy GPS which only > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there > any way to communicate with this device using RXTX, From toupsz at cs.tamu.edu Tue Nov 6 15:14:01 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 16:14:01 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4730E2CA.3090009@gatworks.com> References: <4730E2CA.3090009@gatworks.com> Message-ID: Actually, the device runs over USB, but shows up as a virtual serial port and is outputting these signals. The software that comes with the device (a u-blox ANTARIS 4 eval kit) is able to communicate. RXTX is able to detect and properly configure the port, but does not get any of the data from it. :-/ It seems like there must be some way to do it (obviously, ublox knows how)... -Zach On Nov 6, 2007 3:55 PM, U. George wrote: > This is really a hardware issue. > Is there any device ( ie the serial port ) on your computer that will > accept the voltage signals ( and load ) that your device produces? > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it > happen safely ( ie u dont cook the GPS device ) > > > I have a new, high-accuracy GPS which only > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there > > any way to communicate with this device using RXTX, > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/15ae7a0b/attachment-0020.html From keithvz at verizon.net Tue Nov 6 16:16:55 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 06 Nov 2007 18:16:55 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> Message-ID: <4730F5E7.1030704@verizon.net> Zach Toups wrote: > On Nov 6, 2007 3:55 PM, U. George > wrote: > > This is really a hardware issue. > Is there any device ( ie the serial port ) on your computer that will > accept the voltage signals ( and load ) that your device produces? > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it > happen safely ( ie u dont cook the GPS device ) > > > I have a new, high-accuracy GPS which only > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is > there > > any way to communicate with this device using RXTX, > _______________________________________________ As UGeorge intimated, it's a hardware issue. If your device outputs TTL level voltages, and your USB to serial converter is RS-232, then you've got a physical hardware differences. Inverted leads and voltage issues are mainly the problem. MAXIM makes a neat little chip called the MAX233 (better than the 232, no extern caps required) You can't solve this in software. Now, there are TTL level compatible USB to serial converters available, I happen to be using one right now. This unit below is from a UK company (there might be sources in the US) http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm Parallax makes one that does 3.3 and 5v http://www.parallax.com/detail.asp?product_id=32201 (but only supports RX, TX, GND, AND DTR towards device) (i've tested a variant of the unit above, and it works with RXTX) In both cases, you'll need some creative wiring depending on the interface on your GPS. Hope this helps Keith From toupsz at cs.tamu.edu Tue Nov 6 16:53:01 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 17:53:01 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4730F5E7.1030704@verizon.net> References: <4730E2CA.3090009@gatworks.com> <4730F5E7.1030704@verizon.net> Message-ID: Yeah...I used an FTDI chip to handle USB/serial conversion on the audio equipment I built. I'm leery of trying to build a board for this ublox GPS due to all the grounding/shielding issues around it. Anyway, I apreciate the help...just sad that I can't handle the problem in software! Ublox did send me the source code for their USB drivers...but as a Java programmer, it's a bit tough for me to sort out. ;) Thanks again! -Zach On Nov 6, 2007 5:16 PM, Keith Monahan wrote: > Zach Toups wrote: > > > On Nov 6, 2007 3:55 PM, U. George > > wrote: > > > > This is really a hardware issue. > > Is there any device ( ie the serial port ) on your computer that > will > > accept the voltage signals ( and load ) that your device produces? > > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make > it > > happen safely ( ie u dont cook the GPS device ) > > > > > > I have a new, high-accuracy GPS which only > > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is > > there > > > any way to communicate with this device using RXTX, > > _______________________________________________ > > As UGeorge intimated, it's a hardware issue. > > If your device outputs TTL level voltages, and your USB to serial > converter is RS-232, then you've got a physical hardware differences. > Inverted leads and voltage issues are mainly the problem. MAXIM makes a > neat little chip called the MAX233 (better than the 232, no extern caps > required) > > You can't solve this in software. > > Now, there are TTL level compatible USB to serial converters available, > I happen to be using one right now. > > This unit below is from a UK company (there might be sources in the US) > > http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm > > Parallax makes one that does 3.3 and 5v > > http://www.parallax.com/detail.asp?product_id=32201 > (but only supports RX, TX, GND, AND DTR towards device) > > (i've tested a variant of the unit above, and it works with RXTX) > > In both cases, you'll need some creative wiring depending on the > interface on your GPS. > > Hope this helps > > Keith > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/06e88ad4/attachment-0020.html From netbeans at gatworks.com Tue Nov 6 17:14:01 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 06 Nov 2007 19:14:01 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> <4730F5E7.1030704@verizon.net> Message-ID: <47310349.5000406@gatworks.com> what gps chipset do u have? > Ublox did send me the source code for their USB drivers...but as a Java > programmer, it's a bit tough for me to sort out. ;) From Steffen.DETTMER at ingenico.com Wed Nov 7 03:10:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 7 Nov 2007 11:10:01 +0100 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> Message-ID: <20071107101000.GN10978@elberon.bln.de.ingenico.com> * Zach Toups wrote on Tue, Nov 06, 2007 at 16:14 -0600: > Actually, the device runs over USB, but shows up as a virtual > serial port and is outputting these signals. Ahh, so what you want is to use rxtx on the serial port that is created by the driver and mapped maybe as some COM8 or whatever? I this case then IMHO it would be no hardware question but maybe a problem in your application, or some driver or indeed a rxtx issue. > The software that > comes with the device (a u-blox ANTARIS 4 eval kit) is able to > communicate. Is it sure that this software is really using the virtual serial port and only this port? oki, Steffen -- About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Wed Nov 7 04:59:10 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 06:59:10 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <20071107101000.GN10978@elberon.bln.de.ingenico.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> Message-ID: <4731A88E.6080705@gatworks.com> >> The software that >> comes with the device (a u-blox ANTARIS 4 eval kit) is able to >> communicate. > > Is it sure that this software is really using the virtual serial > port and only this port? > I have tried to read the docs. I have yet to find any explanation on a (windoz) device driver for this device ( the usb device ). That magic is not explained. For a developer thats important magic. Maybe a call to their support team is in order? From netbeans at gatworks.com Wed Nov 7 05:01:38 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 07:01:38 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <20071107101000.GN10978@elberon.bln.de.ingenico.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> Message-ID: <4731A922.7@gatworks.com> Steffen DETTMER wrote: > * Zach Toups wrote on Tue, Nov 06, 2007 at 16:14 -0600: >> Actually, the device runs over USB, but shows up as a virtual BTW: it seems that I am not getting all the Rxtx mail. Is there still a problem? From toupsz at cs.tamu.edu Wed Nov 7 07:36:20 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Wed, 7 Nov 2007 08:36:20 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4731A88E.6080705@gatworks.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> <4731A88E.6080705@gatworks.com> Message-ID: When I emailed them about this issue, they sent me their WinCE drivers, which are apparently based on this open source driver: http://www.yetanotherhomepage.com/j7xx/j7xx.html?/j7xx/software/util/usbdriver.html These include srcdll, and x86 subfolders, though it's not 100% clear to me that these are useful. The ublox communication suite appears to only communicate with serial ports...I've communicated with the ublox on two different comm ports (one with the serial adapter plugged into the serial port, one with the main USB connection), as well as a Garmin bluetooth GPS (which comes up as a bluetooth serial device). I'm not well versed in code this close to the hardware, but it seems to me that if you're running a virtual serial port, then you're virtually controlling the "voltages" that come in on this "port"...so why would they be "ttl level"? :-/ Shouldn't the USB driver be able to interpret the signals in whatever way it wants and just supply software with the binary interpretation? Thanks for all the help, guys, it's really appreciated! -Zach On Nov 7, 2007 5:59 AM, U. George wrote: > > >> The software that > >> comes with the device (a u-blox ANTARIS 4 eval kit) is able to > >> communicate. > > > > Is it sure that this software is really using the virtual serial > > port and only this port? > > > > I have tried to read the docs. I have yet to find any explanation on a > (windoz) device driver for this device ( the usb device ). That magic > is not explained. For a developer thats important magic. Maybe a call > to their support team is in order? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071107/18a13314/attachment-0019.html From netbeans at gatworks.com Wed Nov 7 08:55:55 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 10:55:55 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> <4731A88E.6080705@gatworks.com> Message-ID: <4731E00B.9030902@gatworks.com> There are 2 components to talking to hardware. There is the electrical specification, and then there is the software specification. there is the rs232 specification, parallel port specification, and the USB electrical specification. Generally these are used to plug in the various devices, and hook up electrically. Then there is the software side. There is the device driver, a software component that sits somewhere in the kernel that handles the USB ( in your case ) controller. The device driver generally does not care about the electrical component. There are various chips that handle USB signals, and these chips have I/O addresses so that signals and data can be properly routed. There is also the side that communicates to the user via the COM port device-name. The device driver that you mentioned is for the "Support PL2303 serial chip". This device driver, which hopefully works, handles the USB chip, and eventually recognzes the gps device, and hopefully creates an COM port so the user can open up and communicate. These are a lot of "HOPES". Since u have the web address of the device driver, and developer, I would think that the developer, and any docs, might be better able to help u to first determine if the GPS device is recognized, and the COM port ( maybe its called by another name ) is created, as per documentation. > > These include srcdll, and x86 subfolders, though it's not 100% clear to > me that these are useful. From tjarvi at qbang.org Sat Nov 10 17:46:13 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Nov 2007 17:46:13 -0700 (MST) Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 5 Nov 2007, Oberhuber, Martin wrote: > Hi Trent, > > are the interestes of hobbyists really so different > from commercial ones? Both should be interested in > high quality and innovation the like. > > I haven't seen too many Open Source projects from the > "inside" but those that I have seen did not have > separate mailing lists for quality/testing/qa > versus innovation/development. > > What I have seen with the Open Source projects that > one would call "successful" is a good deal of > process around automated builds, automated unit > tests, predictable release dates and milestones, > and policies around commiting/contributing/reviewing > changes. > > I think that all of these benefit commercial users > and hobbyists the like. > > If you were just asking about who's interested in > discussing changes to foster more quality, count > me in. I'm just not sure whether discussing these > on a separate mailing list or other channel is the > right thing to do. > Hi Martin, There are two issues I'm thinking about. The first is the generic unit testing and quality initiatives required to move rxtx forward. The second is the inevitable fact that rxtx connects to external hardware. The discussion deals with a different set of problems. Here is a simple example of what I'm getting at. We have the capability of setting custom baud rates in rxtx. We may be interested in seeing regressions in rxtx, the C library or the kernel. Some people may be doing some tests with loopback connections. These will always work even if the baud rate is not set to the expected value. Some people may use null modems between two ports. This may be able to catch the problem but not always. Will the build machines be able to test this? (no - for a few reasons) Will people be trying to catch these type of regressions? (yes) What type of coverage does the community have in the end? (?) We could include the discussions in the same list or another equally open list that may be of interest to some folks that deal with these types of problems on a regular basis. -- Trent Jarvi tjarvi at qbang.org From timlow84 at gmail.com Mon Nov 12 00:31:17 2007 From: timlow84 at gmail.com (Timothy Low) Date: Mon, 12 Nov 2007 15:31:17 +0800 Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> Message-ID: <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> ---------- Forwarded message ---------- From: Timothy Low Date: Nov 12, 2007 3:02 PM Subject: Building RXTX From Source To: taj at www.linux.org.uk Cc: ferdinand.tang at tangs.net, Timothy Low , chweehuat.ng at tangs.net Hi Trent, I tried building RXTX from source, and I got this error. I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm trying to get the necessary ".so" files to use for my serial port communication through java. My linux kernal information is: *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 x86_64 x86_64 x86_64 GNU/Linux* I'll most glad if you can provide me some direction on this. Thanks ! ---------------- [root at smsgateway rxtx-2.0-7pre1]# ./configure checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu configure: WARNING: Trying libtool. If the following fails install libtool checking for gcc... gcc checking for C compiler default output... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking for ld used by GCC... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking for a sed that does not truncate output... /bin/sed checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking command to parse /usr/bin/nm -B output... ok checking how to run the C preprocessor... gcc -E checking for egrep... grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for ranlib... ranlib checking for strip... strip checking for objdir... .libs checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.lo... yes checking if gcc supports -fno-rtti -fno-exceptions... yes checking whether the linker (/usr/bin/ld) supports shared libraries... yes checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking dynamic linker characteristics... GNU/Linux ld.so checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no checking whether -lc should be explicitly linked in... no creating libtool checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking for style of include used by make... GNU checking dependency style of gcc... none checking fcntl.h usability... yes checking fcntl.h presence... yes checking for fcntl.h... yes checking sys/fcntl.h usability... yes checking sys/fcntl.h presence... yes checking for sys/fcntl.h... yes checking sys/file.h usability... yes checking sys/file.h presence... yes checking for sys/file.h... yes checking sys/time.h usability... yes checking sys/time.h presence... yes checking for sys/time.h... yes checking sys/signal.h usability... yes checking sys/signal.h presence... yes checking for sys/signal.h... yes checking signal.h usability... yes checking signal.h presence... yes checking for signal.h.. . yes checking termios.h usability... yes checking termios.h presence... yes checking for termios.h... yes checking asm/termbits.h usability... yes checking asm/termbits.h presence... yes checking for asm/termbits.h... yes checking grp.h usability... yes checking grp.h presence... yes checking for grp.h... yes checking pwd.h usability... yes checking pwd.h presence... yes checking for pwd.h... yes checking whether gcc needs -traditional... no checking whether to enable maintainer-specific portions of Makefiles... no /usr/java/jdk1.5.0_13 configure: WARNING: using JAVA_HOME environmental variable adjusted java.home is /usr/java/jdk1.5.0_13 checking os.name Linux checking os.arch i386 checking java.vendor Sun Microsystems Inc. checking java.version 1.5.0_13 checking os.version 2.6.18-8.el5xen comm.jar appears to be installed already. conftest.c: In function 'main': conftest.c:6: warning: incompatible implicit declaration of built-in function 'printf' conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:6: error: (Each undeclared identifier is reported only once conftest.c:6: error: for each function it appears in.) conftest.c:6: error: expected ')' before string constant conftest.c:7: warning: incompatible implicit declaration of built-in function 'exit' ./configure: line 9649: ./conftest: No such file or directory ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected conftest.c: In function 'main': conftest.c:5: warning: incompatible implicit declaration of built-in function 'printf' conftest.c:10: warning: incompatible implicit declaration of built-in function 'exit' configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status : config.h is unchanged config.status: executing depfiles commands [root at smsgateway rxtx-2.0-7pre1]# make install /usr/java/jdk1.5.0_13/bin/javac -classpath .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d /home/jboss/sources/rxtx- 2.0-7pre1/ -O /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java /home/jboss/sources/rxtx-2.0-7pre1/./src/UnSupportedLoggerException.java /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o /home/jboss/sources/rxtx-2.0-7pre1/x86_64-unknown-linux-gnu/SerialImp.lo /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'init_threads': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: cast from pointer to integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_nativeDrain': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: cast to pointer from integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'read_byte_array': /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: cast to pointer from integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_readArray': /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: comparison is always false due to limited range of data type /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_readTerminatedArray': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: comparison is always false due to limited range of data type mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial- 2.0.7pre1.* gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so -o .libs/librxtxSerial-2.0.7pre1.so (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.0.7pre1.so librxtxSerial.so) creating librxtxSerial.la (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la librxtxSerial.la) gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/ParallelImp.lo /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function 'Java_javax_comm_LPRPort_readArray': /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: comparison is always false due to limited range of data type rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* .libs/librxtxParallel-2.0.7pre1.* gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so -o .libs/librxtxParallel- 2.0.7pre1.so (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.0.7pre1.so librxtxParallel.so) creating librxtxParallel.la (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la librxtxParallel.la) make all-am make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' libtool: install: `x86_64-unknown-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 ------------- Regards, Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071112/27758c3c/attachment-0015.html From tjarvi at qbang.org Mon Nov 12 01:02:09 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Nov 2007 01:02:09 -0700 (MST) Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> Message-ID: On Mon, 12 Nov 2007, Timothy Low wrote: > > Hi Trent, Hi Tim, Comments are inline. As I mentioned off the list, rxtx 2.0 is on the edge of deprecation. We can get it working but this is not the path of least resistance for future work. You will probably need to bounce another round of questions off the list. The following is intended to isolate the problem. > > I tried building RXTX from source, and I got this error. > > > I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm trying > to get the necessary ".so" files to use for my serial port communication > through java. > My linux kernal information is: > > *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 x86_64 > x86_64 x86_64 GNU/Linux* > > I'll most glad if you can provide me some direction on this. Thanks ! > > ---------------- > [root at smsgateway rxtx-2.0-7pre1]# ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > checking for C compiler default output... a.out > checking whether the C compiler works... yes > checking whether we are cross compiling... no > checking for suffix of executables... > checking for suffix of object files... o > checking whether we are using the GNU C compiler... yes > checking whether gcc accepts -g... yes > checking for gcc option to accept ANSI C... none needed > checking for ld used by GCC... /usr/bin/ld > checking if the linker (/usr/bin/ld) is GNU ld... yes > checking for /usr/bin/ld option to reload object files... -r > checking for BSD-compatible nm... /usr/bin/nm -B > checking for a sed that does not truncate output... /bin/sed > checking whether ln -s works... yes > checking how to recognise dependent libraries... pass_all > checking command to parse /usr/bin/nm -B output... ok > checking how to run the C preprocessor... gcc -E > checking for egrep... grep -E > checking for ANSI C header files... yes > checking for sys/types.h... yes > checking for sys/stat.h... yes > checking for stdlib.h... yes > checking for string.h... yes > checking for memory.h... yes > checking for strings.h... yes > checking for inttypes.h... yes > checking for stdint.h... yes > checking for unistd.h... yes > checking dlfcn.h usability... yes > checking dlfcn.h presence... yes > checking for dlfcn.h... yes > checking for ranlib... ranlib > checking for strip... strip > checking for objdir... .libs > checking for gcc option to produce PIC... -fPIC > checking if gcc PIC flag -fPIC works... yes > checking if gcc static flag -static works... yes > checking if gcc supports -c -o file.o... yes > checking if gcc supports -c -o file.lo... yes > checking if gcc supports -fno-rtti -fno-exceptions... yes > checking whether the linker (/usr/bin/ld) supports shared libraries... yes > checking how to hardcode library paths into programs... immediate > checking whether stripping libraries is possible... yes > checking dynamic linker characteristics... GNU/Linux ld.so > checking if libtool supports shared libraries... yes > checking whether to build shared libraries... yes > checking whether to build static libraries... no > checking whether -lc should be explicitly linked in... no > creating libtool > checking for a BSD-compatible install... /usr/bin/install -c > checking whether build environment is sane... yes > checking for gawk... gawk > checking whether make sets $(MAKE)... yes > checking for style of include used by make... GNU > checking dependency style of gcc... none > checking fcntl.h usability... yes > checking fcntl.h presence... yes > checking for fcntl.h... yes > checking sys/fcntl.h usability... yes > checking sys/fcntl.h presence... yes > checking for sys/fcntl.h... yes > checking sys/file.h usability... yes > checking sys/file.h presence... yes > checking for sys/file.h... yes > checking sys/time.h usability... yes > checking sys/time.h presence... yes > checking for sys/time.h... yes > checking sys/signal.h usability... yes > checking sys/signal.h presence... yes > checking for sys/signal.h... yes > checking signal.h usability... yes > checking signal.h presence... yes > checking for signal.h.. . yes > checking termios.h usability... yes > checking termios.h presence... yes > checking for termios.h... yes > checking asm/termbits.h usability... yes > checking asm/termbits.h presence... yes > checking for asm/termbits.h... yes > checking grp.h usability... yes > checking grp.h presence... yes > checking for grp.h... yes > checking pwd.h usability... yes > checking pwd.h presence... yes > checking for pwd.h... yes > checking whether gcc needs -traditional... no > checking whether to enable maintainer-specific portions of Makefiles... no > /usr/java/jdk1.5.0_13 > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /usr/java/jdk1.5.0_13 > checking os.name Linux > checking os.arch i386 > checking java.vendor Sun Microsystems Inc. > checking java.version 1.5.0_13 > checking os.version 2.6.18-8.el5xen > comm.jar appears to be installed already. > conftest.c: In function 'main': > conftest.c:6: warning: incompatible implicit declaration of built-in > function 'printf' > conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:6: error: (Each undeclared identifier is reported only once > conftest.c:6: error: for each function it appears in.) > conftest.c:6: error: expected ')' before string constant This is an outdated kernel version check for when headers and kernels could cause problems for rxtx. If we made it past this, then you are OK. > conftest.c:7: warning: incompatible implicit declaration of built-in > function 'exit' > ./configure: line 9649: ./conftest: No such file or directory > ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected It blew up but continues.. > conftest.c: In function 'main': > conftest.c:5: warning: incompatible implicit declaration of built-in > function 'printf' > conftest.c:10: warning: incompatible implicit declaration of built-in > function 'exit' > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status : config.h is unchanged > config.status: executing depfiles commands > [root at smsgateway rxtx-2.0-7pre1]# make install > /usr/java/jdk1.5.0_13/bin/javac -classpath > .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d > /home/jboss/sources/rxtx- 2.0-7pre1/ -O > /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java > /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/UnSupportedLoggerException.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java > Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or > overrides a deprecated API. > Note: Recompile with -Xlint:deprecation for details. > /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* The java jar should be fine now. You may need to change the source files as mentioned below. > gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. > -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g > -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o > /home/jboss/sources/rxtx-2.0-7pre1/x86_64-unknown-linux-gnu/SerialImp.lo > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'init_threads': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: cast > from pointer to integer of different size > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_nativeDrain': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: cast to > pointer from integer of different size > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'read_byte_array': > /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: cast to > pointer from integer of different size As I recall, this was caused by pointers (now 64 bit rather than 32 bit) being stored in java ints (jints). I would look at the diff between the CVS 2.1 SerialImp.c and RXTXPort.java files against 2.0. We did fix those issues. You have a .so file but the different pointer sizes will cause runtime errors. > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_readArray': > /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: > comparison is always false due to limited range of data type > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_readTerminatedArray': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: > comparison is always false due to limited range of data type > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial- > 2.0.7pre1.* > gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so -o > .libs/librxtxSerial-2.0.7pre1.so > (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.0.7pre1.so > librxtxSerial.so) > creating librxtxSerial.la > (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la > librxtxSerial.la) > gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. > -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g > -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o > /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/ParallelImp.lo > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function > 'Java_javax_comm_LPRPort_readArray': > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: > comparison is always false due to limited range of data type > rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* > .libs/librxtxParallel-2.0.7pre1.* > gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so -o > .libs/librxtxParallel- 2.0.7pre1.so > (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.0.7pre1.so > librxtxParallel.so) > creating librxtxParallel.la > (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la > librxtxParallel.la) > make all-am > make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' > make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' > libtool: install: `x86_64-unknown-linux-gnu' must be an absolute directory > name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 A libtool change? Assuming you ran configure && make install in /home/jboss/sources/rxtx- 2.0-7pre1, libtool is looking for /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/.libs/librxtxSerial-2.0.7pre1.so. I think you have this? The file is just being copied to ~JAVA/jre/lib/$(JAVA_ARCH). -- Trent Jarvi tjarvi at qbang.org From sarah_662005 at yahoo.com Mon Nov 12 16:10:28 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Mon, 12 Nov 2007 15:10:28 -0800 (PST) Subject: [Rxtx] [urgent] device's power off detection Message-ID: <766782.10076.qm@web55803.mail.re3.yahoo.com> Hello all, I have a small application built on top of rxtx api. This application can retrieve the incoming data from a device through a port. The device can be powered off after the port get closed from the application. I have been trying a couple of hours to find a way to detect the power switching from device. If anyone knows how to handle it through rxtx, could you please give me a help? Thank you very much. r, Sara ____________________________________________________________________________________ Get easy, one-click access to your favorites. Make Yahoo! your homepage. http://www.yahoo.com/r/hs -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071112/4599f3ec/attachment-0014.html From netbeans at gatworks.com Mon Nov 12 17:52:22 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 12 Nov 2007 19:52:22 -0500 Subject: [Rxtx] [urgent] device's power off detection In-Reply-To: <766782.10076.qm@web55803.mail.re3.yahoo.com> References: <766782.10076.qm@web55803.mail.re3.yahoo.com> Message-ID: <4738F546.5010101@gatworks.com> Not sure what u are asking for. Are u asking for a way to detect if the device is OFF? Are u asking how to power off the device - via software ? Is it a Serial device? is it a parallel device? is it a usb device? Sara Hugh wrote: > Hello all, > I have a small application built on top of rxtx api. This application > can retrieve the incoming data from a device through a port. The device > can be powered off after the port get closed from the application. I > have been trying a couple of hours to find a way to detect the power > switching from device. If anyone knows how to handle it through rxtx, > could you please give me a help? Thank you very much. From tjarvi at qbang.org Mon Nov 12 22:48:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Nov 2007 22:48:11 -0700 (MST) Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711120225x562db8cbxb750767ade3b0d73@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> <900c6ba90711120031p66edc001ted76f7ba24e34b98@mail.gmail.com> <900c6ba90711120225x562db8cbxb750767ade3b0d73@mail.gmail.com> Message-ID: Hi Tim, The gnu.io namespace looks just like the javax.comm 2.0 namespace. There are additional (discouraged) undocumented methods in gnu.io that you need not use. We just used the different namespace to avoid poluting Sun's by mistake and to make sure we stayed off any potential licensing related radar. Usuaully, you just change your imports and make sure you do not use the javax.comm namespace for anything like exception handling. As I mentioned off the list, there are no issues with rxtx going through the JSR process to be more Sun friendly other than time. rxtx has no hidden intentions there; anything that does not work like CommAPI 2.0 documented is a bug. The reason we do not support CommAPI 2.1 is technical in nature and is in the list archives as well as the front page of www.rxtx.org. On Mon, 12 Nov 2007, Timothy Low wrote: > Hi Trent, > > I'll move to use a JDK1.5 64-bit version... but do I need to make any source > code changes to use the package (gnu.io) in the RTXTcomm.jar instead of the > ones from the javacomm api ? > > > Regards, > Tim > > On Nov 12, 2007 5:22 PM, Trent Jarvi wrote: > >> >> Hi Tim, >> >> I see a couple things here. >> >> First your jdk is for i686 yet the library is compiled on a x86_64 >> machine. You may try passing configure the --target=i686-unknown-linux to >> try using the i686 backend to gcc if it is available. Or move to the 64 >> bit jdk. >> >> The other error I see is again the moved UTF_RELEASE define that we need >> to fix. You can probably get around that with: >> >> make -DUTF_RELEASE=`uname -r` >> >> even more simple would be to just specify the serial library which should >> be in configure --help. >> >> You can remove the UTF_RELEASE check from configure by editing >> configure.in, searching for the simple C program check and deleting it. >> Running autoconf after that will regenerate a new configure without the >> check. >> >> Note that you should remove the previous native libraries >> (librxtxSerial.so) when moving from rxtx 2.0 to 2.1. These are compiled >> for different namespaces (javax.comm/gnu.io). >> >> On Mon, 12 Nov 2007, Timothy Low wrote: >> >>> *Hi Trent, >>> >>> I moved on to rxtx 2.1.7r2, and updated my jre to 1.6.0 (64-bit)... I >> tried >>> the following 2 methods: >>> >>> (1) using the rxtx 2.1.7 binaries from the RXTX website* >>> *Are these binaries suitable for a 64-bit OS ? There mentioning of the >>> gnu.io that you've talked about previously...* >>> ------ >>> [root at smsgateway sources]# java -Djava.library.path=/usr/lib PortLister >>> Experimental: JNI_OnLoad called. >>> >>> java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion >>> ()Ljava/lang/String; >>> at gnu.io.RXTXCommDriver.nativeGetVersion(Native Method) >>> at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:85) >>> at java.lang.Class.forName0(Native Method) >>> at java.lang.Class.forName(Unknown Source) >>> at javax.comm.CommPortIdentifier.loadDriver( >> CommPortIdentifier.java >>> :237) >>> at javax.comm.CommPortIdentifier.(CommPortIdentifier.java >>> :109) >>> at PortLister.(PortLister.java:6) >>> at PortLister.main(PortLister.java:25) >>> Exception in thread "main" java.lang.UnsatisfiedLinkError: >>> com.sun.comm.SunrayInfo.isSessionActive()Z >>> at com.sun.comm.SunrayInfo.isSessionActive(Native Method) >>> at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java >> :155) >>> at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java >>> :100) >>> at javax.comm.CommPortIdentifier.(CommPortIdentifier.java >>> :138) >>> at PortLister.(PortLister.java:6) >>> at PortLister.main(PortLister.java:25) >>> >>> ------ >>> >>> (2) compiling the rxtx 2.1.7 from source >>> *but i got the following error while running ./configure and make all* >>> >>> ------ >>> [root at smsgateway rxtx-2.1-7r2]# ./configure >>> checking build system type... x86_64-unknown-linux-gnu >>> checking host system type... x86_64-unknown-linux-gnu >>> checking target system type... x86_64-unknown-linux-gnu >>> configure: WARNING: Trying libtool. If the following fails install >> libtool >>> checking for gcc... gcc >>> checking for C compiler default output file name... a.out >>> checking whether the C compiler works... yes >>> checking whether we are cross compiling... no >>> checking for suffix of executables... >>> checking for suffix of object files... o >>> checking whether we are using the GNU C compiler... yes >>> checking whether gcc accepts -g... yes >>> checking for gcc option to accept ANSI C... none needed >>> checking for a sed that does not truncate output... /bin/sed >>> checking for egrep... grep -E >>> checking for ld used by gcc... /usr/bin/ld >>> checking if the linker (/usr/bin/ld) is GNU ld... yes >>> checking for /usr/bin/ld option to reload object files... -r >>> checking for BSD-compatible nm... /usr/bin/nm -B >>> checking whether ln -s works... yes >>> checking how to recognise dependent libraries... pass_all >>> checking how to run the C preprocessor... gcc -E >>> checking for ANSI C header files... yes >>> checking for sys/types.h... yes >>> checking for sys/stat.h... yes >>> checking for stdlib.h... yes >>> checking for string.h... yes >>> checking for memory.h... yes >>> checking for strings.h... yes >>> checking for inttypes.h... yes >>> checking for stdint.h... yes >>> checking for unistd.h... yes >>> checking dlfcn.h usability... yes >>> checking dlfcn.h presence... yes >>> checking for dlfcn.h... yes >>> checking for g++... g++ >>> checking whether we are using the GNU C++ compiler... yes >>> checking whether g++ accepts -g... yes >>> checking how to run the C++ preprocessor... g++ -E >>> checking for g77... no >>> checking for f77... no >>> checking for xlf... no >>> checking for frt... no >>> checking for pgf77... no >>> checking for fort77... no >>> checking for fl32... no >>> checking for af77... no >>> checking for f90... no >>> checking for xlf90... no >>> checking for pgf90... no >>> checking for epcf90... no >>> checking for f95... f95 >>> checking whether we are using the GNU Fortran 77 compiler... yes >>> checking whether f95 accepts -g... yes >>> checking the maximum length of command line arguments... 32768 >>> checking command to parse /usr/bin/nm -B output from gcc object... ok >>> checking for objdir... .libs >>> checking for ar... ar >>> checking for ranlib... ranlib >>> checking for strip... strip >>> checking if gcc static flag works... yes >>> checking if gcc supports -fno-rtti -fno-exceptions... no >>> checking for gcc option to produce PIC... -fPIC >>> checking if gcc PIC flag -fPIC works... yes >>> checking if gcc supports -c -o file.o... yes >>> checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking whether -lc should be explicitly linked in... no >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> checking if libtool supports shared libraries... yes >>> checking whether to build shared libraries... yes >>> checking whether to build static libraries... no >>> configure: creating libtool >>> appending configuration tag "CXX" to libtool >>> checking for ld used by g++... /usr/bin/ld -m elf_x86_64 >>> checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes >>> checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking for g++ option to produce PIC... -fPIC >>> checking if g++ PIC flag -fPIC works... yes >>> checking if g++ supports -c -o file.o... yes >>> checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> appending configuration tag "F77" to libtool >>> checking if libtool supports shared libraries... yes >>> checking whether to build shared libraries... yes >>> checking whether to build static libraries... no >>> checking for f95 option to produce PIC... -fPIC >>> checking if f95 PIC flag -fPIC works... yes >>> checking if f95 supports -c -o file.o... yes >>> checking whether the f95 linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> checking for a BSD-compatible install... /usr/bin/install -c >>> checking whether build environment is sane... yes >>> checking for gawk... gawk >>> checking whether make sets $(MAKE)... yes >>> checking for style of include used by make... GNU >>> checking dependency style of gcc... none >>> checking dependency style of g++... none >>> checking fcntl.h usability... yes >>> checking fcntl.h presence... yes >>> checking for fcntl.h... yes >>> checking sys/fcntl.h usability... yes >>> checking sys/fcntl.h presence... yes >>> checking for sys/fcntl.h... yes >>> checking sys/file.h usability... yes >>> checking sys/file.h presence... yes >>> checking for sys/file.h... yes >>> checking sys/time.h usability... yes >>> checking sys/time.h presence... yes >>> checking for sys/time.h... yes >>> checking sys/signal.h usability... yes >>> checking sys/signal.h presence... yes >>> checking for sys/signal.h... yes >>> checking signal.h usability... yes >>> checking signal.h presence... yes >>> checking for signal.h... yes >>> checking termios.h usability... yes >>> checking termios.h presence... yes >>> checking for termios.h... yes >>> checking grp.h usability... yes >>> checking grp.h presence... yes >>> checking for grp.h... yes >>> checking pwd.h usability... yes >>> checking pwd.h presence... yes >>> checking for pwd.h... yes >>> checking whether gcc needs -traditional... no >>> checking whether to enable maintainer-specific portions of Makefiles... >> no >>> /usr/java/jdk1.5.0_13 >>> configure: WARNING: using JAVA_HOME environmental variable >>> adjusted java.home is /usr/java/jdk1.5.0_13 >>> checking os.name Linux >>> checking os.arch i386 >>> checking java.vendor Sun Microsystems Inc. >>> checking java.version 1.5.0_13 >>> checking os.version 2.6.18-8.el5xen >>> conftest.c: In function 'main': >>> conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this >> function) >>> conftest.c:8: error: (Each undeclared identifier is reported only once >>> conftest.c:8: error: for each function it appears in.) >>> conftest.c:8: error: expected ')' before string constant >>> ./configure: line 21462: ./conftest: No such file or directory >>> ./configure: line 21462: test: 2.6.18-8.el5xen: unary operator expected >>> configure: creating ./config.status >>> config.status: creating Makefile >>> config.status: creating config.h >>> config.status: executing depfiles commands >>> [root at smsgateway rxtx-2.1-7r2]# make install >>> /usr/java/jdk1.5.0_13/bin/javac -classpath .:/home/jboss/sources/rxtx- >>> >> 2.1-7r2:/home/jboss/sources/rxtx-2.1-7r2/src:/usr/java/jdk1.5.0_13/jre/lib/ext/RXTXcomm.jar-d >>> /home/jboss/sources/rxtx- >>> 2.1-7r2/ -O -source 1.3 -target 1.3 >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommDriver.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortEnumerator.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortIdentifier.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortOwnershipListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Configure.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2C.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/I2CPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/LPRPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/NoSuchPortException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/PortInUseException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Raw.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/RawPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RawPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RawPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/RS485PortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485PortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485Port.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXCommDriver.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXVersion.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPort.java >>> /home/jboss/sources/rxtx-2.1-7r2 >> /./src/UnsupportedCommOperationException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/UnSupportedLoggerException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Zystem.java >>> /usr/java/jdk1.5.0_13/bin/javah -classpath .:/home/jboss/sources/rxtx- >>> >> 2.1-7r2:/home/jboss/sources/rxtx-2.1-7r2/src:/usr/java/jdk1.5.0_13/jre/lib/ext/RXTXcomm.jar-d >>> x86_64-unknown-linux-gnu -jni `(for i in CommDriver CommPortEnumerator >>> CommPortIdentifier CommPort CommPortOwnershipListener Configure I2C >>> I2CPortEvent I2CPortEventListener I2CPort LPRPort NoSuchPortException >>> ParallelPortEvent ParallelPortEventListener ParallelPort >> PortInUseException >>> Raw RawPortEvent RawPortEventListener RawPort RS485 RS485PortEvent >>> RS485PortEventListener RS485Port RXTXCommDriver RXTXPort RXTXVersion >>> SerialPortEvent SerialPortEventListener SerialPort >>> UnsupportedCommOperationException UnSupportedLoggerException Zystem;do \ >>> if grep > /dev/null native.*\( /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/$i.java; then \ >>> echo gnu.io.$i; \ >>> fi; \ >>> done)` >>> /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialImp.c -o >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo; >>> \ >>> if [ "Serial" = "Serial" ]; >>> then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxSerial.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxSerial.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo; >> \ >>> fi; \ >>> ) >>> mkdir /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/.libs >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/SerialImp.o >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/fuserImp.o >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c: In function >> 'show_user': >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c:238: warning: cast >> from >>> pointer to integer of different size >>> gcc -shared /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/SerialImp.o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/fuserImp.o >>> -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7.so -o >> .libs/librxtxSerial- >>> 2.1-7.so >>> (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.1-7.so >>> librxtxSerial.so) >>> creating librxtxSerial.la >>> (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la >>> librxtxSerial.la) >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelImp.c -o >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/ParallelImp.lo; >>> \ >>> if [ "Parallel" = "Serial" ]; >>> then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxParallel.la -rpath >>> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/ParallelImp.lo >>> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxParallel.la -rpath >>> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/ParallelImp.lo; >>> \ >>> fi; \ >>> ) >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >>> /x86_64-unknown-linux-gnu/.libs/ParallelImp.o >>> gcc -shared /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/ParallelImp.o >>> -lpthread -Wl,-soname -Wl,librxtxParallel-2.1-7.so -o >>> .libs/librxtxParallel-2.1-7.so >>> (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.1-7.so >>> librxtxParallel.so) >>> creating librxtxParallel.la >>> (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la >>> librxtxParallel.la) >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo; >>> \ >>> if [ "I2C" = "Serial" ]; then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxI2C.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo >>> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxI2C.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo; >>> \ >>> fi; \ >>> ) >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/.libs/I2CImp.o >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c: In function >>> 'Java_gnu_io_I2CPort_Initialize': >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: 'UTS_RELEASE' >>> undeclared (first use in this function) >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: (Each >> undeclared >>> identifier is reported only once >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: for each >> function >>> it appears in.) >>> libtool: link: `/home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/I2CImp.lo' >>> is not a valid libtool object >>> make: *** [x86_64-unknown-linux-gnu/librxtxI2C.la] Error 1 >>> >>> ------ >>> >>> >>> >>> On Nov 12, 2007 4:02 PM, Trent Jarvi wrote: >>> >>>> On Mon, 12 Nov 2007, Timothy Low wrote: >>>>> >>>>> Hi Trent, >>>> >>>> Hi Tim, >>>> >>>> Comments are inline. As I mentioned off the list, rxtx 2.0 is on the >> edge >>>> of deprecation. We can get it working but this is not the path of >> least >>>> resistance for future work. >>>> >>>> You will probably need to bounce another round of questions off the >> list. >>>> The following is intended to isolate the problem. >>>> >>>>> >>>>> I tried building RXTX from source, and I got this error. >>>>> >>>>> >>>>> I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm >>>> trying >>>>> to get the necessary ".so" files to use for my serial port >> communication >>>>> through java. >>>>> My linux kernal information is: >>>>> >>>>> *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 >>>> x86_64 >>>>> x86_64 x86_64 GNU/Linux* >>>>> >>>>> I'll most glad if you can provide me some direction on this. Thanks ! >>>>> >>>>> ---------------- >>>>> [root at smsgateway rxtx-2.0-7pre1]# ./configure >>>>> checking build system type... x86_64-unknown-linux-gnu >>>>> checking host system type... x86_64-unknown-linux-gnu >>>>> checking target system type... x86_64-unknown-linux-gnu >>>>> configure: WARNING: Trying libtool. If the following fails install >>>> libtool >>>>> checking for gcc... gcc >>>>> checking for C compiler default output... a.out >>>>> checking whether the C compiler works... yes >>>>> checking whether we are cross compiling... no >>>>> checking for suffix of executables... >>>>> checking for suffix of object files... o >>>>> checking whether we are using the GNU C compiler... yes >>>>> checking whether gcc accepts -g... yes >>>>> checking for gcc option to accept ANSI C... none needed >>>>> checking for ld used by GCC... /usr/bin/ld >>>>> checking if the linker (/usr/bin/ld) is GNU ld... yes >>>>> checking for /usr/bin/ld option to reload object files... -r >>>>> checking for BSD-compatible nm... /usr/bin/nm -B >>>>> checking for a sed that does not truncate output... /bin/sed >>>>> checking whether ln -s works... yes >>>>> checking how to recognise dependent libraries... pass_all >>>>> checking command to parse /usr/bin/nm -B output... ok >>>>> checking how to run the C preprocessor... gcc -E >>>>> checking for egrep... grep -E >>>>> checking for ANSI C header files... yes >>>>> checking for sys/types.h... yes >>>>> checking for sys/stat.h... yes >>>>> checking for stdlib.h... yes >>>>> checking for string.h... yes >>>>> checking for memory.h... yes >>>>> checking for strings.h... yes >>>>> checking for inttypes.h... yes >>>>> checking for stdint.h... yes >>>>> checking for unistd.h... yes >>>>> checking dlfcn.h usability... yes >>>>> checking dlfcn.h presence... yes >>>>> checking for dlfcn.h... yes >>>>> checking for ranlib... ranlib >>>>> checking for strip... strip >>>>> checking for objdir... .libs >>>>> checking for gcc option to produce PIC... -fPIC >>>>> checking if gcc PIC flag -fPIC works... yes >>>>> checking if gcc static flag -static works... yes >>>>> checking if gcc supports -c -o file.o... yes >>>>> checking if gcc supports -c -o file.lo... yes >>>>> checking if gcc supports -fno-rtti -fno-exceptions... yes >>>>> checking whether the linker (/usr/bin/ld) supports shared libraries... >>>> yes >>>>> checking how to hardcode library paths into programs... immediate >>>>> checking whether stripping libraries is possible... yes >>>>> checking dynamic linker characteristics... GNU/Linux ld.so >>>>> checking if libtool supports shared libraries... yes >>>>> checking whether to build shared libraries... yes >>>>> checking whether to build static libraries... no >>>>> checking whether -lc should be explicitly linked in... no >>>>> creating libtool >>>>> checking for a BSD-compatible install... /usr/bin/install -c >>>>> checking whether build environment is sane... yes >>>>> checking for gawk... gawk >>>>> checking whether make sets $(MAKE)... yes >>>>> checking for style of include used by make... GNU >>>>> checking dependency style of gcc... none >>>>> checking fcntl.h usability... yes >>>>> checking fcntl.h presence... yes >>>>> checking for fcntl.h... yes >>>>> checking sys/fcntl.h usability... yes >>>>> checking sys/fcntl.h presence... yes >>>>> checking for sys/fcntl.h... yes >>>>> checking sys/file.h usability... yes >>>>> checking sys/file.h presence... yes >>>>> checking for sys/file.h... yes >>>>> checking sys/time.h usability... yes >>>>> checking sys/time.h presence... yes >>>>> checking for sys/time.h... yes >>>>> checking sys/signal.h usability... yes >>>>> checking sys/signal.h presence... yes >>>>> checking for sys/signal.h... yes >>>>> checking signal.h usability... yes >>>>> checking signal.h presence... yes >>>>> checking for signal.h.. . yes >>>>> checking termios.h usability... yes >>>>> checking termios.h presence... yes >>>>> checking for termios.h... yes >>>>> checking asm/termbits.h usability... yes >>>>> checking asm/termbits.h presence... yes >>>>> checking for asm/termbits.h... yes >>>>> checking grp.h usability... yes >>>>> checking grp.h presence... yes >>>>> checking for grp.h... yes >>>>> checking pwd.h usability... yes >>>>> checking pwd.h presence... yes >>>>> checking for pwd.h... yes >>>>> checking whether gcc needs -traditional... no >>>>> checking whether to enable maintainer-specific portions of >> Makefiles... >>>> no >>>>> /usr/java/jdk1.5.0_13 >>>>> configure: WARNING: using JAVA_HOME environmental variable >>>>> adjusted java.home is /usr/java/jdk1.5.0_13 >>>>> checking os.name Linux >>>>> checking os.arch i386 >>>>> checking java.vendor Sun Microsystems Inc. >>>>> checking java.version 1.5.0_13 >>>>> checking os.version 2.6.18-8.el5xen >>>>> comm.jar appears to be installed already. >>>>> conftest.c: In function 'main': >>>>> conftest.c:6: warning: incompatible implicit declaration of built-in >>>>> function 'printf' >>>>> conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this >>>> function) >>>>> conftest.c:6: error: (Each undeclared identifier is reported only once >>>>> conftest.c:6: error: for each function it appears in.) >>>>> conftest.c:6: error: expected ')' before string constant >>>> >>>> >>>> This is an outdated kernel version check for when headers and kernels >>>> could cause problems for rxtx. If we made it past this, then you are >> OK. >>>> >>>> >>>>> conftest.c:7: warning: incompatible implicit declaration of built-in >>>>> function 'exit' >>>>> ./configure: line 9649: ./conftest: No such file or directory >>>>> ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected >>>> >>>> It blew up but continues.. >>>> >>>>> conftest.c: In function 'main': >>>>> conftest.c:5: warning: incompatible implicit declaration of built-in >>>>> function 'printf' >>>>> conftest.c:10: warning: incompatible implicit declaration of built-in >>>>> function 'exit' >>>>> configure: creating ./config.status >>>>> config.status: creating Makefile >>>>> config.status: creating config.h >>>>> config.status : config.h is unchanged >>>>> config.status: executing depfiles commands >>>>> [root at smsgateway rxtx-2.0-7pre1]# make install >>>>> /usr/java/jdk1.5.0_13/bin/javac -classpath >>>>> .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/ -O >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1 >> /./src/UnSupportedLoggerException.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java >>>>> Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or >>>>> overrides a deprecated API. >>>>> Note: Recompile with -Xlint:deprecation for details. >>>>> /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* >>>> >>>> >>>> The java jar should be fine now. You may need to change the source >> files >>>> as mentioned below. >>>> >>>>> gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu >> -I. >>>>> -I/usr/java/jdk1.5.0_13/include >> -I/usr/java/jdk1.5.0_13/include/./linux/ >>>> -g >>>>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o >>>>> /home/jboss/sources/rxtx-2.0-7pre1 >> /x86_64-unknown-linux-gnu/SerialImp.lo >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'init_threads': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: >>>> cast >>>>> from pointer to integer of different size >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_nativeDrain': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: >>>> cast to >>>>> pointer from integer of different size >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'read_byte_array': >>>>> /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: >>>> cast to >>>>> pointer from integer of different size >>>> >>>> >>>> As I recall, this was caused by pointers (now 64 bit rather than 32 >> bit) >>>> being stored in java ints (jints). I would look at the diff between >> the >>>> CVS 2.1 SerialImp.c and RXTXPort.java files against 2.0. We >>>> did fix those issues. >>>> >>>> You have a .so file but the different pointer sizes will cause runtime >>>> errors. >>>> >>>> >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_readArray': >>>>> /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: >>>>> comparison is always false due to limited range of data type >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_readTerminatedArray': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: >>>>> comparison is always false due to limited range of data type >>>>> mkdir .libs >>>>> rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* >> .libs/librxtxSerial- >>>>> 2.0.7pre1.* >>>>> gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so-o >>>>> .libs/librxtxSerial-2.0.7pre1.so >>>>> (cd .libs && rm -f librxtxSerial.so && ln -s >> librxtxSerial-2.0.7pre1.so >>>>> librxtxSerial.so) >>>>> creating librxtxSerial.la >>>>> (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la >>>>> librxtxSerial.la) >>>>> gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu >> -I. >>>>> -I/usr/java/jdk1.5.0_13/include >> -I/usr/java/jdk1.5.0_13/include/./linux/ >>>> -g >>>>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o >>>>> /home/jboss/sources/rxtx- 2.0-7pre1 >>>> /x86_64-unknown-linux-gnu/ParallelImp.lo >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function >>>>> 'Java_javax_comm_LPRPort_readArray': >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: >>>>> comparison is always false due to limited range of data type >>>>> rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* >>>>> .libs/librxtxParallel-2.0.7pre1.* >>>>> gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so-o >>>>> .libs/librxtxParallel- 2.0.7pre1.so >>>>> (cd .libs && rm -f librxtxParallel.so && ln -s >>>> librxtxParallel-2.0.7pre1.so >>>>> librxtxParallel.so) >>>>> creating librxtxParallel.la >>>>> (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la >>>>> librxtxParallel.la) >>>>> make all-am >>>>> make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' >>>>> make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' >>>>> libtool: install: `x86_64-unknown-linux-gnu' must be an absolute >>>> directory >>>>> name >>>>> Try `libtool --help --mode=install' for more information. >>>>> make: *** [install] Error 1 >>>> >>>> A libtool change? Assuming you ran configure && make install in >>>> /home/jboss/sources/rxtx- 2.0-7pre1, libtool is looking for >>>> /home/jboss/sources/rxtx- >>>> 2.0-7pre1/x86_64-unknown-linux-gnu/.libs/librxtxSerial-2.0.7pre1.so. >>>> >>>> I think you have this? The file is just being copied to >>>> ~JAVA/jre/lib/$(JAVA_ARCH). >>>> >>>> -- >>>> Trent Jarvi >>>> tjarvi at qbang.org >>>> >>> >> > From guido.vogt at celsi.ch Tue Nov 13 00:28:01 2007 From: guido.vogt at celsi.ch (Guido Vogt) Date: Tue, 13 Nov 2007 08:28:01 +0100 Subject: [Rxtx] RTS Line can't be set Message-ID: <47395201.1050400@celsi.ch> I'm working on an Windows XP /SP2 System. Version of RXTX: 2.1.7. The serial line is connected to a modem. As I can see, the RTS-Line of the serial Port is inactive, when the port is opened (flowcontrol=none). Obviously, no data is coming from the modem. If I use the setRTS(true) command after open, the comport does not send out my data any more. This behaviour is regardless of flowcontrol. Anybody has an idea what do do? Thanks for help. From Martin.Oberhuber at windriver.com Tue Nov 13 08:58:23 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 13 Nov 2007 16:58:23 +0100 Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803880918@ism-mail03.corp.ad.wrs.com> Hi Trent, as said before, I like the idea of discussing such quality engineering issues, but why hide these away from the rest of the public? Anyways, if you do want to create a new mailing list for these kinds of things I'll happily subscribe. 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: Sunday, November 11, 2007 1:46 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: RE: [Rxtx] Quality Engineering with rxtx > > On Mon, 5 Nov 2007, Oberhuber, Martin wrote: > > > Hi Trent, > > > > are the interestes of hobbyists really so different > > from commercial ones? Both should be interested in > > high quality and innovation the like. > > > > I haven't seen too many Open Source projects from the > > "inside" but those that I have seen did not have > > separate mailing lists for quality/testing/qa > > versus innovation/development. > > > > What I have seen with the Open Source projects that > > one would call "successful" is a good deal of > > process around automated builds, automated unit > > tests, predictable release dates and milestones, > > and policies around commiting/contributing/reviewing > > changes. > > > > I think that all of these benefit commercial users > > and hobbyists the like. > > > > If you were just asking about who's interested in > > discussing changes to foster more quality, count > > me in. I'm just not sure whether discussing these > > on a separate mailing list or other channel is the > > right thing to do. > > > > Hi Martin, > > There are two issues I'm thinking about. The first is the > generic unit > testing and quality initiatives required to move rxtx > forward. The second > is the inevitable fact that rxtx connects to external hardware. The > discussion deals with a different set of problems. > > Here is a simple example of what I'm getting at. > > We have the capability of setting custom baud rates in rxtx. > We may be > interested in seeing regressions in rxtx, the C library or > the kernel. > Some people may be doing some tests with loopback > connections. These will > always work even if the baud rate is not set to the expected > value. Some > people may use null modems between two ports. This may be > able to catch > the problem but not always. > > Will the build machines be able to test this? (no - for a few reasons) > Will people be trying to catch these type of regressions? (yes) > What type of coverage does the community have in the end? (?) > > We could include the discussions in the same list or another > equally open > list that may be of interest to some folks that deal with > these types of > problems on a regular basis. > > -- > Trent Jarvi > tjarvi at qbang.org > From toupsz at cs.tamu.edu Tue Nov 13 10:33:03 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 13 Nov 2007 11:33:03 -0600 Subject: [Rxtx] [urgent] device's power off detection In-Reply-To: <4738F546.5010101@gatworks.com> References: <766782.10076.qm@web55803.mail.re3.yahoo.com> <4738F546.5010101@gatworks.com> Message-ID: Lacking any other specification on it...but can you set up the device to notify your software when it turns off? Send a message or somesuch? Maybe it can signal using RTS or DTR? -Zach On Nov 12, 2007 6:52 PM, U. George wrote: > Not sure what u are asking for. Are u asking for a way to detect if the > device is OFF? Are u asking how to power off the device - via software ? > Is it a Serial device? > is it a parallel device? > is it a usb device? > > Sara Hugh wrote: > > Hello all, > > I have a small application built on top of rxtx api. This application > > can retrieve the incoming data from a device through a port. The device > > can be powered off after the port get closed from the application. I > > have been trying a couple of hours to find a way to detect the power > > switching from device. If anyone knows how to handle it through rxtx, > > could you please give me a help? Thank you very much. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071113/e5859e4d/attachment-0013.html From tjarvi at qbang.org Tue Nov 13 20:02:03 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 13 Nov 2007 20:02:03 -0700 (MST) Subject: [Rxtx] #ifndef TIOCSERGETLSR In-Reply-To: <472E3AAF.7050709@gatworks.com> References: <472E3AAF.7050709@gatworks.com> Message-ID: On Sun, 4 Nov 2007, U. George wrote: > For Linux, it seems that you need the code for both *having* a > TIOCSERGETLSR, and *not having* a TIOCSERGETLSR. Maybe the ioctl exists > system wide, but not necessarily for the device driver itself ( always > returns -1 ) . > > Are there systems that have a *functioning* TIOCSERGETLSR for all their > devices? Then this would be the case where the "#ifndef TIOCSERGETLSR" > directive could be useful is eliminating the unnecessary code and tests. > > And for those systems that dont have a TIOCSERGETLSR, then the code for > TIOCSERGETLSR can be eliminated. > > It would be a simple case to have, as a foundation, all the code to > simulate the missing TIOCSERGETLSR ioctl. If the system does have the > ioctl, then that code can be ifdef'd in, and co-exist with the > functionality of the code that simulates the missing TIOCSERGETLSR ioctl. > Ah, there is the post. Sorry I was on vacation. Hi George, Yes there are systems that have functioning TIOCSERGETLSR for all of their devices. These are machines that just use traditional UARTs. If you mean operating systems, then probably not. Let me explain a bit about the history of those #ifdefs to help clear up a mess. RXTX aims to follow POSIX. TIOCSERGETLSR turns out to not be POSIX at all as I understand. It isn't in BSD, Solaris, AIX or HP-UX. It certainly provides access to important information. I assumed it was standard when I coded rxtx on a Linux system. Ya, laugh. Then I looked at Win32.. Oh you are still laughing? ..I could not navigate msft's web site at the time [still can't really find anything today]. So google pointed me to someones 'reverse documentation' of the w32 API and an example msft put together back in the win3.0 days. It was enough but maybe not 100% correct. They covered overlapped IO which was important for events in rxtx. Looking at Win32 and Linux, it made sense to implement TIOCSERGETLSR for win32 with the way rxtx works. That was how things matched up. But when I got feedback about other systems, it didn't match up. When people used multiport cards with money saving designs in Linux, it didn't match up. And today, there are drivers for unusual serial ports that don't match up. Now we have some ugly logic that mostly works for most serial ports. It isn't right though. The important aspect of TIOSERGETLSR is knowing when the output is really gone. But POSIX tcdrain tells us the same thing. So there is logic in the ifdefs to match that up as you suggest. Perhaps a more formal solution along those lines would be worth looking into. I would suggest the roles should be switched though. We should use POSIX calls on all systems and hide things that don't work on everything like we have with other undocumented calls. TIOSERGETLSR is nice and would be great if it was standard. It isn't as far as I can tell. In the end, many people write Java code because they want portability. The TIOSERGETLSR does not really fit. In someways, this is limiting to the least common denominator which is Solaris if you have seen it's serial kernel driver code. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 15 09:10:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 15 Nov 2007 17:10:59 +0100 Subject: [Rxtx] RXTX blocking on unconnected virtual port Message-ID: <460801A4097E3D4CA04CC64EE648584803919080@ism-mail03.corp.ad.wrs.com> Hello, we came across the following issue: * Set up a virtual serial port, e.g. with com0com: http://com0com.sourceforge.net/ * Connect RXTX to one end, e.g. cnc1a * Do not connect the other end, e.g. cnc1b * Have RXTX write data to the port --> Since the data is not being read, RXTX blocks - RXTXPort.SerialOutputStream.write increases the RXTXPort.IOLocked variable - it then calls the native writeByte or writeArray method (which blocks) closing the RXTXPort hangs for ever too: - RXTXPort.close() has a while( IOLocked > 0 ) {..Thread.sleep(500);...} which spins for ever ==> once the communication hangs, it cannot recover. Has anybody else seen such a problem before, or even got an idea how to solve it? When I connect Hyperterminal to the same half-open port, and type a character, it hangs for about 3 seconds but then times out and is available again. I guess that's what I'd like to see in RXTX as well, with a (configurable) timeout. Our big problem with the current situation is that once RXTX gets stuck, there is nothing at all we can do to make it go live again - that's why our original workaround of writing to the port in a background thread is not good enough. For more background information, the issue is being tracked in https://bugs.eclipse.org/bugs/show_bug.cgi?id=208185 Thanks for any hints or ideas, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Sun Nov 18 09:43:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 09:43:26 -0700 (MST) Subject: [Rxtx] PortInUseException - Cannot close and reopen serial port In-Reply-To: <460801A4097E3D4CA04CC64EE64858480351C711@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858480351C711@ism-mail03.corp.ad.wrs.com> Message-ID: These have been submitted to CVS and the bugzilla entries have been changed to reflect the changes. ChangeLog: find ports which were added after program startup on Mac OS X. Martin Oberhuber http://bugzilla.qbang.org/show_bug.cgi?id=48 Clean up CommPort Ownership code, avoid possible deadlocks, fix lost commport ownership events. http://bugzilla.qbang.org/show_bug.cgi?id=83 Martin Oberhuber On Wed, 24 Oct 2007, Oberhuber, Martin wrote: > 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) > > > > > > > > > > > > > > > From tjarvi at qbang.org Sun Nov 18 09:45:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 09:45:39 -0700 (MST) Subject: [Rxtx] PortInUseException - Cannot close and reopen serial port In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848020CAF26@ism-mail03.corp.ad.wrs.com> Message-ID: The current CVS code should have all the entries. With version information, I usually do not change the version until we tag and release a zip file. Any feedback would be appreciated. On Wed, 27 Jun 2007, Greg Johnson wrote: > 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) >> >> >> >> >> > From tjarvi at qbang.org Sun Nov 18 13:51:27 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 13:51:27 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs Message-ID: The following bugs have been closed and CVS updated as needed: CommPortIdentifier.getPortIdentifier throws NoSuchPortException http://bugzilla.qbang.org/show_bug.cgi?id=48 CommPortOwnership events not sent http://bugzilla.qbang.org/show_bug.cgi?id=83 JVM 1.6 builds http://bugzilla.qbang.org/show_bug.cgi?id=84 I'd like to give Martin Oberhuber CVS write access. He has been doing a great job of pushing safe patches into rxtx. I'll be preparing seperate patches for the changes I have and submitting them to the list. I'll need to work with George to do a couple things: 1) break the patch into smaller pieces to isolate issues for discussion. 2) work through the Line Status Register changes so it does not cause problems on other systems. George: If you could do the first one, it would be greatly appreciated. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Nov 18 15:33:36 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 15:33:36 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: Message-ID: I'm not running any tests at this point, I'm trying to apply the small safe patches and make sure everything is compiling. As mentioned at the bottom, there are 3 patches + the USB fix posted here that need more review before accepting. The following bugs have been closed and CVS updated as needed. Most of these are already in CVS. The diff will be small. configure script failed at line UTS_RELEASE megov http://bugzilla.qbang.org/show_bug.cgi?id=80 code cleanup patch (extra ';' creates bug for if statements + new String() calls removed) Xavier Le Vourch http://bugzilla.qbang.org/show_bug.cgi?id=77 Wont compile on linux ppc with glibc 2.5 - no sys/io.h Brian Johnson http://bugzilla.qbang.org/show_bug.cgi?id=72 rxtx overwrites System properties Andrew Gillett Nektarios K. Papadopoulos Neboj??a http://bugzilla.qbang.org/show_bug.cgi?id=64 Solaris ACM port support Dave Cleal http://bugzilla.qbang.org/show_bug.cgi?id=59 Setting of non-standard baud rate fails. Andrew Prunicki http://bugzilla.qbang.org/show_bug.cgi?id=58 RXTX uses lockfiles on MacOS X (instead of ioctl TIOCEXCL) Joachim Buechse http://bugzilla.qbang.org/show_bug.cgi?id=50 JavaDoc fixes Joachim Buechse http://bugzilla.qbang.org/show_bug.cgi?id=49 I need to further review the following: http://bugzilla.qbang.org/show_bug.cgi?id=53 http://bugzilla.qbang.org/show_bug.cgi?id=46 http://bugzilla.qbang.org/show_bug.cgi?id=41 On Sun, 18 Nov 2007, Trent Jarvi wrote: > > The following bugs have been closed and CVS updated as needed: > > CommPortIdentifier.getPortIdentifier throws NoSuchPortException > http://bugzilla.qbang.org/show_bug.cgi?id=48 > CommPortOwnership events not sent > http://bugzilla.qbang.org/show_bug.cgi?id=83 > JVM 1.6 builds > http://bugzilla.qbang.org/show_bug.cgi?id=84 > > I'd like to give Martin Oberhuber CVS write access. He has been doing a > great job of pushing safe patches into rxtx. > > I'll be preparing seperate patches for the changes I have and submitting > them to the list. > > I'll need to work with George to do a couple things: > > 1) break the patch into smaller pieces to isolate issues for discussion. > 2) work through the Line Status Register changes so it does not cause > problems on other systems. > > George: If you could do the first one, it would be greatly appreciated. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From netbeans at gatworks.com Sun Nov 18 16:20:02 2007 From: netbeans at gatworks.com (U. George) Date: Sun, 18 Nov 2007 18:20:02 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: Message-ID: <4740C8A2.6030908@gatworks.com> > I'll need to work with George to do a couple things: > > 1) break the patch into smaller pieces to isolate issues for discussion. > 2) work through the Line Status Register changes so it does not cause > problems on other systems. > > George: If you could do the first one, it would be greatly appreciated. there are ( probably ) 3 pieces: 1) the select() failure when the USB-serial device is unceremoniously unplugged ( causes rxtx to spin ) 2) TIOCSERGETLSR, need to have the simulation of it available for all os's . If the system has the capability, don't simulate for devices that have the capability. For devices that dont have the capability, but the OS still defines TIOCSERGETLSR, fall back to simulation. 3) I rearranged DEBUG ifdef's. This is probably the bulk of the patches. From tjarvi at qbang.org Sun Nov 18 18:26:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 18:26:26 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <4740C8A2.6030908@gatworks.com> References: <4740C8A2.6030908@gatworks.com> Message-ID: On Sun, 18 Nov 2007, U. George wrote: > >> I'll need to work with George to do a couple things: >> >> 1) break the patch into smaller pieces to isolate issues for discussion. >> 2) work through the Line Status Register changes so it does not cause >> problems on other systems. >> >> George: If you could do the first one, it would be greatly appreciated. > > there are ( probably ) 3 pieces: > 1) the select() failure when the USB-serial device is unceremoniously > unplugged ( causes rxtx to spin ) > 2) TIOCSERGETLSR, need to have the simulation of it available for all os's . > If the system has the capability, don't simulate for devices that have the > capability. For devices that dont have the capability, but the OS still > defines TIOCSERGETLSR, fall back to simulation. > 3) I rearranged DEBUG ifdef's. This is probably the bulk of the patches. > Hi George, I suspect if you do cvs update, there will be very few conflicts if any. While the list of fixes is fairly long, the changes are small. -- Trent Jarvi tjarvi at qbang.org From EdwardRF at xtremax.com Mon Nov 19 03:32:29 2007 From: EdwardRF at xtremax.com (Edward) Date: Mon, 19 Nov 2007 18:32:29 +0800 Subject: [Rxtx] Cannot Read under Windows XP Message-ID: <4741663D.4070200@xtremax.com> Hi Guys, I have a iTegno 3000 usb GSM modem, it is an usb-serial device. I am trying to use RXTX with it under Windows XP. The problem is it seems RXTX cannot read any data from it, but writing to it seems successful. I blindly issue a series of command to send off a SMS, it is successfully delivered, but neither the echo from the modem nor the "OK" response was received. I tried to connect to the modem directly using hyper terminal, there was no problem reading or writing. So can i assume it is not the driver problem? Then i turned to Serial Port Monitor for help, when I use hyper terminal, monitor shows both way traffic, and nothing abnormal, but when I connect using RXTX, only the data I sent to the modem is being detected, no input was detected. Does anyone else experience similar problem? Best Regards Edward From tjarvi at qbang.org Mon Nov 19 03:38:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Nov 2007 03:38:02 -0700 (MST) Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: <4741663D.4070200@xtremax.com> References: <4741663D.4070200@xtremax.com> Message-ID: On Mon, 19 Nov 2007, Edward wrote: > Hi Guys, > > I have a iTegno 3000 usb GSM modem, it is an usb-serial device. I am > trying to use RXTX with it under Windows XP. > The problem is it seems RXTX cannot read any data from it, but writing > to it seems successful. I blindly issue a series of command to send off > a SMS, it is successfully delivered, but neither the echo from the modem > nor the "OK" response was received. > > I tried to connect to the modem directly using hyper terminal, there was > no problem reading or writing. So can i assume it is not the driver problem? > > Then i turned to Serial Port Monitor for help, when I use hyper > terminal, monitor shows both way traffic, and nothing abnormal, but when > I connect using RXTX, only the data I sent to the modem is being > detected, no input was detected. > > Does anyone else experience similar problem? > Hi Edward, A common mistake is to send Strings to the modem which are i18n. You want to send the bytes. Examples of doing this are in the contrib directory with the sourcecode. ie SimpleSnuV1.java -- Trent Jarvi tjarvi at qbang.org From EdwardRF at xtremax.com Mon Nov 19 04:42:16 2007 From: EdwardRF at xtremax.com (Edward) Date: Mon, 19 Nov 2007 19:42:16 +0800 Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: References: <4741663D.4070200@xtremax.com> Message-ID: <47417698.3060705@xtremax.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071119/b0f08ba9/attachment-0008.html From netbeans at gatworks.com Mon Nov 19 06:31:30 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 19 Nov 2007 08:31:30 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: <4740C8A2.6030908@gatworks.com> Message-ID: <47419032.8080406@gatworks.com> Did the "make install". The install does not want to go to or use Makefiles's prefix = /usr/local/rxtx-devel Not terribly happy that it installed in /home/gat/JAVA/JDK14/j2sdk1.4.2_08/jre/lib/i386 Trent Jarvi wrote: > > I suspect if you do cvs update, there will be very few conflicts if any. > While the list of fixes is fairly long, the changes are small. > > -- > Trent Jarvi > tjarvi at qbang.org > > From Martin.Oberhuber at windriver.com Mon Nov 19 07:00:48 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 19 Nov 2007 15:00:48 +0100 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE6485848039986E6@ism-mail03.corp.ad.wrs.com> It's great to see things progressing - thanks Trent! I checked CVS, and it seems that most of the patch authors are yet missing from the AUTHORS file, is this intentional? The issues areound RXTXPort.close() are interesting for us in the context of Eclipse as well: https://bugs.eclipse.org/bugs/show_bug.cgi?id=208185#c3 I did a quick review and found some issues / comments: http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 http://bugzilla.qbang.org/show_bug.cgi?id=53#c9 Thanks for proposing CVS write access for me. I promise to use these thoughtfully, and discuss potential fixes openly (on bugzilla) before applying them [unless it's really trivial issues only like obvious Javadoc syntax or spelling errors]. Cheers, -- 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 Mon Nov 19 07:24:16 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 19 Nov 2007 15:24:16 +0100 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803998711@ism-mail03.corp.ad.wrs.com> Hi all, I think I've got a better version for RXTXCommDriver.checkSolaris(): http://bugzilla.qbang.org/show_bug.cgi?id=77#c3 Cheers, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From netbeans at gatworks.com Mon Nov 19 09:01:22 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 19 Nov 2007 11:01:22 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <47419032.8080406@gatworks.com> References: <4740C8A2.6030908@gatworks.com> <47419032.8080406@gatworks.com> Message-ID: <4741B352.8070205@gatworks.com> U. George wrote: > Did the "make install". The install does not want to go to or use > Makefiles's prefix = /usr/local/rxtx-devel > > Not terribly happy that it installed in > /home/gat/JAVA/JDK14/j2sdk1.4.2_08/jre/lib/i386 > Put libs and jar in MY preferential places. Ran application. And it loves to spin. Deja gnu all over again. :-/ It did find the avail /dev/ttyUSB0 port connected to LINUX usbserial/pl2303 device driver. Now to find the spin. and apply simpler set of patches From tjarvi at qbang.org Mon Nov 19 10:14:38 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Nov 2007 10:14:38 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <4741B352.8070205@gatworks.com> References: <4740C8A2.6030908@gatworks.com> <47419032.8080406@gatworks.com> <4741B352.8070205@gatworks.com> Message-ID: On Mon, 19 Nov 2007, U. George wrote: > U. George wrote: >> Did the "make install". The install does not want to go to or use >> Makefiles's prefix = /usr/local/rxtx-devel >> >> Not terribly happy that it installed in >> /home/gat/JAVA/JDK14/j2sdk1.4.2_08/jre/lib/i386 >> > Put libs and jar in MY preferential places. Ran application. And it loves to > spin. Deja gnu all over again. :-/ > > It did find the avail /dev/ttyUSB0 port connected to LINUX usbserial/pl2303 > device driver. > > Now to find the spin. and apply simpler set of patches > Hi George, When the prefix code was stomped on and the library was installed in the jre, It wasnt clear how the layout would end up looking. I'm still not sure. My usual attack was to dump a jdk onto the filesystem, set JAVA_HOME and install. When I was done, I would nuke the jdk. Obviously that may not be what people want but I'm not sure a prefix is enough to let us know what they do want. For a shared library prefix /usr/local means the library goes in /usr/local/lib. What would it mean for the jar and shared library in Java? -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Nov 19 10:24:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Nov 2007 10:24:08 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <460801A4097E3D4CA04CC64EE6485848039986E6@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848039986E6@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 19 Nov 2007, Oberhuber, Martin wrote: > > I checked CVS, and it seems that most of the patch > authors are yet missing from the AUTHORS file, > is this intentional? > There isn't a hard rule covering who goes into AUTHORS. If I recognize a person from previous patches, I try to make sure they are in. Everyone contributing (authors) is in the ChangeLog with what they did going all the way back to the first release. AUTHORS is more of a summary of what they did after a few submissions. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Nov 19 11:39:51 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 19 Nov 2007 13:39:51 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: <4740C8A2.6030908@gatworks.com> <47419032.8080406@gatworks.com> <4741B352.8070205@gatworks.com> Message-ID: <4741D877.80203@gatworks.com> For me, the makefile/prefix = /usr/local sorta suggest thats where the libs/bins/jars/... should eventually wind up. If a user does not like /usr/local, then a quick change would put it somewhere else. At this moment I dont care where the jar winds up ( in lib, or a jar directory ). So I like to keep the jre/sdk directory protected from meddling, and changes. But if a user has a penchant to use 'java -jar', then the RXTXcomm.jar file should be stuffed with the other jre/sdk jar files. From ajmas at sympatico.ca Mon Nov 19 11:54:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 19 Nov 2007 13:54:29 -0500 Subject: [Rxtx] CVS updates and closed bugs Message-ID: <20071119185429.SPYK18413.tomts22-srv.bellnexxia.net@smtp1.sympatico.ca> On this day in November "U. George" wrote: > > For me, the makefile/prefix = /usr/local sorta suggest thats where the > libs/bins/jars/... should eventually wind up. > If a user does not like /usr/local, then a quick change would put it > somewhere else. At this moment I dont care where the jar winds up ( in > lib, or a jar directory ). > So I like to keep the jre/sdk directory protected from meddling, and > changes. > But if a user has a penchant to use 'java -jar', then the RXTXcomm.jar > file should be stuffed with the other jre/sdk jar files. It should be noted that some platforms, such as MacOS X might have different conventions. In the case of MacOS X there are two 'correct' places for Java libraries that aren't part of an application: - /Library/Java/Extensions/ - ~/Library/Java/Extensions/ Andre From ajmas at sympatico.ca Mon Nov 19 18:15:37 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 19 Nov 2007 20:15:37 -0500 Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: <47417698.3060705@xtremax.com> References: <4741663D.4070200@xtremax.com> <47417698.3060705@xtremax.com> Message-ID: <3D24B671-06CA-4709-AE3C-BCDB542F427F@sympatico.ca> On 19-Nov-07, at 06:42 , Edward wrote: > Hi Trent, > > First of all, I did sent them as bytes, eg, > > output.write("at\r\n".getBytes()); > > And if writing is every the problem, it wouldn't be able to explain > why i could send out a sms successfully using RXTX. > If you have the section of code that does the communicating, could you share it with us? This should help us tell whether it is a coding issue or something more fundamental with RXTX. Andre From EdwardRF at xtremax.com Mon Nov 19 19:39:36 2007 From: EdwardRF at xtremax.com (EdwardRF) Date: Tue, 20 Nov 2007 10:39:36 +0800 Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: <3D24B671-06CA-4709-AE3C-BCDB542F427F@sympatico.ca> References: <4741663D.4070200@xtremax.com> <47417698.3060705@xtremax.com> <3D24B671-06CA-4709-AE3C-BCDB542F427F@sympatico.ca> Message-ID: <474248E8.7070002@xtremax.com> Hi Guys, Thanks for the help, i've finally found out the problem. It was a flow control issue, i did not set the flow control properly. Btw, what is the default flow control behavior for rxtx2.1.7? was it the same as 2.0? Because i remember i did not need to set the flow control when I use rxtx 2.0 2 years back. Best Regards Edward Andre-John Mas wrote: > > On 19-Nov-07, at 06:42 , Edward wrote: > >> Hi Trent, >> >> First of all, I did sent them as bytes, eg, >> >> output.write("at\r\n".getBytes()); >> >> And if writing is every the problem, it wouldn't be able to explain >> why i could send out a sms successfully using RXTX. >> > > If you have the section of code that does the communicating, could you > share it with us? This should help us tell whether it is a coding > issue or something more fundamental with RXTX. > > Andre > From netbeans at gatworks.com Tue Nov 20 06:23:26 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 20 Nov 2007 08:23:26 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: <4740C8A2.6030908@gatworks.com> Message-ID: <4742DFCE.5070504@gatworks.com> Here is the small subset of diffs just for TIOCSERGETLSR :) Next I'll pull out the usb device, and see if that also causes rxtx to spin. >> 2) TIOCSERGETLSR, need to have the simulation of it available for all >> os's . If the system has the capability, don't simulate for devices >> that have the capability. For devices that dont have the capability, >> but the OS still defines TIOCSERGETLSR, fall back to simulation. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: a Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20071120/2c5c8ee7/attachment-0005.pl From tjarvi at qbang.org Tue Nov 20 08:20:21 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Nov 2007 08:20:21 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <4742DFCE.5070504@gatworks.com> References: <4740C8A2.6030908@gatworks.com> <4742DFCE.5070504@gatworks.com> Message-ID: On Tue, 20 Nov 2007, U. George wrote: > Here is the small subset of diffs just for TIOCSERGETLSR :) > > Next I'll pull out the usb device, and see if that also causes rxtx to spin. > >>> 2) TIOCSERGETLSR, need to have the simulation of it available for all os's >>> . If the system has the capability, don't simulate for devices that have >>> the capability. For devices that dont have the capability, but the OS >>> still defines TIOCSERGETLSR, fall back to simulation. > Hi George, I'll be looking through this patch in detail tonight. I just wanted to make sure you are aware of this line in win32termios.h. The ifdef logic is messy as you noticed. That is combined with the later addition of support for it to windows. #define TIOCSERGETLSR 0x5459 (this is by far the strangest code in rxtx in retrospect) I'll be able to do extensive automated testing once we get to that point. I'm confident we can get something in that has a low probability of causing regressions. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Tue Nov 20 08:42:08 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 20 Nov 2007 10:42:08 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: <4740C8A2.6030908@gatworks.com> <4742DFCE.5070504@gatworks.com> Message-ID: <47430050.1010203@gatworks.com> It is of no difference. 1) If the define does not exist, then it should be as before. 2) If it does exist, then it should also be as before. 3) If it does exist, but the ioctl fails, then it will fallback as if it did not exist in the first place. Trent Jarvi wrote: > On Tue, 20 Nov 2007, U. George wrote: > >> Here is the small subset of diffs just for TIOCSERGETLSR :) >> >> Next I'll pull out the usb device, and see if that also causes rxtx to >> spin. >> >>>> 2) TIOCSERGETLSR, need to have the simulation of it available for >>>> all os's . If the system has the capability, don't simulate for >>>> devices that have the capability. For devices that dont have the >>>> capability, but the OS still defines TIOCSERGETLSR, fall back to >>>> simulation. >> > > Hi George, > > I'll be looking through this patch in detail tonight. I just wanted to > make sure you are aware of this line in win32termios.h. The ifdef logic > is messy as you noticed. That is combined with the later addition of > support for it to windows. > > #define TIOCSERGETLSR 0x5459 > > (this is by far the strangest code in rxtx in retrospect) > > I'll be able to do extensive automated testing once we get to that > point. I'm confident we can get something in that has a low probability > of causing regressions. > > -- > Trent Jarvi > tjarvi at qbang.org > > From netbeans at gatworks.com Tue Nov 20 08:36:56 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 20 Nov 2007 10:36:56 -0500 Subject: [Rxtx] Unplugged Opened USB devices In-Reply-To: <4742DFCE.5070504@gatworks.com> References: <4740C8A2.6030908@gatworks.com> <4742DFCE.5070504@gatworks.com> Message-ID: <4742FF18.3050005@gatworks.com> > Next I'll pull out the usb device, and see if that also causes rxtx to > spin. This is the error on a read. The select() should have failed, as well as the read(). java.io.IOException: Input/output error in nativeavailable at gnu.io.RXTXPort.nativeavailable(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1420) at jGPS.GpsData.DeviceDrivers.SerialPort.SerialPort_NMEA_GNU.serialEvent (SerialPort_NMEA_GNU.java:449) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:771) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1622) But for java program, it sees( when USB device is unplugged ) : 1) event: SerialPortEvent.DATA_AVAILABLE 2) read (non-existant) data. I think that its bad form to say DATA_AVAILABLE, when there is no data to be obtained. There does not seem to be an I/O error event. So basically, I think, and IMHO, that no events should be sent. Rather a thread timeout ( ie no data in X seconds ) AND recovery from user code should be instantiated. From manujnaman at yahoo.com Wed Nov 21 12:35:46 2007 From: manujnaman at yahoo.com (manuj naman) Date: Wed, 21 Nov 2007 11:35:46 -0800 (PST) Subject: [Rxtx] Problem reading 1-wire device using RXTX on Linux Message-ID: <371969.66249.qm@web37911.mail.mud.yahoo.com> Hello, I am trying to use the RXTX library on Ubuntu (Debian) linux to read iButtons. It works perfectly on Windows. However on my linux machines it gives the following errors. I am using DS9490 (USB port adapter) to read the iButtons. I have followed your instructions on the Wiki. I recompiled the rxtx library to produce the .so and .jar files. But still it gives me this: manujnaman at sensor:~/iButton/onewireviewer$ java -cp $CLASSPATH:./OneWireAPI.jar:./OneWireViewer.jar OneWireViewer Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Warning: serial communications API not setup properly, no ports in enumeration Pure-Java DS9097U adapter will not work, not added to adapter enum Standard drivers for 1-Wire are not found. Please download the latest drivers from http://www.ibutton.com Or install RXTX Serial Communications API from http://www.rxtx.org Do you know how to solve the "Serial communications API not setup properly, no ports in enumeration" problem? Also, how to detect which what /dev/* is the port to be used? On Windows this is simply USB1, on linux this is a bit unclear. Many thanks for your advice, Manuj Naman Dallas, TX, US manujnaman at yahoo.com --------------------------------- Be a better pen pal. Text or chat with friends inside Yahoo! Mail. See how. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071121/2760f691/attachment-0004.html From Martin.Oberhuber at windriver.com Wed Nov 21 13:55:25 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 21 Nov 2007 21:55:25 +0100 Subject: [Rxtx] Should RXTX Lixense link to LGPL-2.1 be changed? In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803A21160@ism-mail03.corp.ad.wrs.com> Hi Trent and all, In all the RXTX source files as well as http://users.frii.com/jarvi/rxtx/license.html there is the following lines: | A copy of the LGPL v 2.1 may be found at | http://www.gnu.org/licenses/lgpl.txt on March 4th 2007. A copy is | here for your convenience. But, as of today, at the link provided there is only a copy of the LGPL v3.0. I think there should be a link to the LGPL v2.1, e.g. http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html What do you think? Cheers, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Nov 21 20:46:18 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Nov 2007 20:46:18 -0700 (MST) Subject: [Rxtx] Problem reading 1-wire device using RXTX on Linux In-Reply-To: <371969.66249.qm@web37911.mail.mud.yahoo.com> References: <371969.66249.qm@web37911.mail.mud.yahoo.com> Message-ID: On Wed, 21 Nov 2007, manuj naman wrote: > Hello, > > I am trying to use the RXTX library on Ubuntu (Debian) linux to read iButtons. It works perfectly on Windows. However on my linux machines it gives the following errors. I am using DS9490 (USB port adapter) to read the iButtons. > > I have followed your instructions on the Wiki. I recompiled the rxtx library to produce the .so and .jar files. But still it gives me this: > > manujnaman at sensor:~/iButton/onewireviewer$ java -cp $CLASSPATH:./OneWireAPI.jar:./OneWireViewer.jar OneWireViewer > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > Warning: serial communications API not setup properly, no ports in enumeration > Pure-Java DS9097U adapter will not work, not added to adapter enum > > Standard drivers for 1-Wire are not found. > Please download the latest drivers from http://www.ibutton.com > Or install RXTX Serial Communications API from http://www.rxtx.org > > Do you know how to solve the "Serial communications API not setup properly, no ports in enumeration" problem? > > Also, how to detect which what /dev/* is the port to be used? On Windows this is simply USB1, on linux this is a bit unclear. Hi Manuj What is the output of the following? dmesg |grep tty touch /var/lock/test.lock && rm -f /var/lock/test.lock If you see something like /dev/ttyUSB0 in the dmesg output, what happens if you do something like tail -f /dev/ttyUSB0? These test each of the usual suspects. We are looking for missing USB drivers, no permission to create a lockfile and no read permission for the device. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Nov 21 21:05:23 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Nov 2007 21:05:23 -0700 (MST) Subject: [Rxtx] Should RXTX Lixense link to LGPL-2.1 be changed? In-Reply-To: <460801A4097E3D4CA04CC64EE648584803A21160@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803A21160@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 21 Nov 2007, Oberhuber, Martin wrote: > Hi Trent and all, > > In all the RXTX source files as well as > http://users.frii.com/jarvi/rxtx/license.html > there is the following lines: > > | A copy of the LGPL v 2.1 may be found at > | http://www.gnu.org/licenses/lgpl.txt on March 4th 2007. A copy is > | here for your convenience. > > But, as of today, at the link provided there is only > a copy of the LGPL v3.0. I think there should be a link > to the LGPL v2.1, e.g. > http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html > > What do you think? > Hi Martin, Thanks. I updated the link. Changing licences is a heavy process for me as a free software developer and an employee so I'd rather stay with 2.1 unless the current license becomes a show stopper. I figured that would happen someday so I put the date in to be clear. -- Trent Jarvi tjarvi at qbang.org From beat.arnet at gmail.com Thu Nov 22 08:45:45 2007 From: beat.arnet at gmail.com (Beat Arnet) Date: Thu, 22 Nov 2007 10:45:45 -0500 Subject: [Rxtx] Dual Core Problem Message-ID: <4745A429.9060604@gmail.com> Dear All, I am struggling with an application that uses RXTX 2.1.7 and has been working reliably in the past. When this program runs on a dual-core DELL (Intel T2500), strange things happen with the RS232 communication. The application is missing incoming characters and also often freezes when trying to close the serial port. I highly suspect a threading problem and was wondering if a) anybody had run into a similar problem with dual core processors and b) if there is a list of does and dont's when it comes to RXTX and threads. Regards, Beat From tjarvi at qbang.org Thu Nov 22 13:22:43 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 22 Nov 2007 13:22:43 -0700 (MST) Subject: [Rxtx] Dual Core Problem In-Reply-To: <4745A429.9060604@gmail.com> References: <4745A429.9060604@gmail.com> Message-ID: On Thu, 22 Nov 2007, Beat Arnet wrote: > Dear All, > I am struggling with an application that uses RXTX 2.1.7 and has been > working reliably in the past. When this program runs on a dual-core DELL > (Intel T2500), strange things happen with the RS232 communication. The > application is missing incoming characters and also often freezes when > trying to close the serial port. I highly suspect a threading problem > and was wondering if a) anybody had run into a similar problem with dual > core processors and b) if there is a list of does and dont's when it > comes to RXTX and threads. > I've used rxtx with SMP systems but have not experimented very much with threading and rxtx. One red flag rxtx raises is it stores pointers to java objects in SerialImp.c. If the JVM decides to move things around, rxtx becomes confused. Missing incomming characters is usually caused by someone running two applications. They then fight over the incomming data. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Fri Nov 23 03:12:28 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 23 Nov 2007 11:12:28 +0100 Subject: [Rxtx] Dual Core Problem In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803A84C59@ism-mail03.corp.ad.wrs.com> > Missing incomming characters is usually caused by someone running two > applications. They then fight over the incomming data. I've seen exactly this scenario on Linux with Lockfiles disabled. Usually, port locking (through Lockfiles or Ioctl method) should avoid exactly this problem. I know that on Mac, port locking through Kernel/Ioctl method has been added for the upcoming RXTX 2.1-8. What's the status of this feature for Linux and other Unixes? Cheers, Martin From chris.paton at red61.com Fri Nov 23 05:26:10 2007 From: chris.paton at red61.com (Chris Paton) Date: Fri, 23 Nov 2007 12:26:10 +0000 Subject: [Rxtx] RXTX parallel port issues Message-ID: <4746C6E2.3000304@red61.com> Hi there, I've been happily using RXTX to communicate with a serial based point-of-sale printer for a several months. I've recently received a parallel based printer and have been trying to get RXTX to talk to this too. I've encountered a few problems along the way and just wanted to check if I'm doing anything wrong, or if I've found any bugs. Writing ------- Writing to the parallel port using ParallelPort.getOutputStream works well, except when I use OutputStream.write(byte[]) to write a multiple of 8 bytes (!). Doing this causes the JVM to crash with an EXCEPTION_PRIV_INSTRUCTION on Windows. I worked around this in my application by adding an additional byte if bytesToWrite % 8 == 0. I guess I could also have called write(byte) repeatedly. This also generated a SIGSEGV on Linux but I was unable to reproduce it today using the CVS version of RXTX and a recent kernel. Reading status pins ------------------- On Linux, I've found that ParallelPort.isPaperOut and ParallelPort.isPrinterSelected appear to be inverted; i.e. when the paper is out ParallelPort.isPaperOut returns false, and when there is paper ParallelPort.isPaperOut returns true! I've tested this in both Sun JDK5 and JDK6 on machines running Linux 2.6.21 and 2.6.23. Fortunately it's easy to use a conditional based on System.getProperty("os.name") to hack around this. Reading from InputStream ------------------------ I've had more serious issues trying to read from ParallelPort.getInputStream. On Windows, readByte seems to return -1 (end of stream) any time data isn't available. On Linux, I got a kernel oops, even with a recent 2.6.23.1 kernel. I was able to stop this using a kernel patch that I found via Google. Although this stopped the oops, I still get frequent IOExceptions when calling InputStream.readByte. It appears that instead of blocking, readByte throws an IOException with message "Resource temporarily unavailable in readByte" any time it is called when no data is available. Occasionally, I get an exception instead of the data I was expecting to read, e.g when asking my printer for a version string I get "VER: S3306 * 06.03* 10/*6/06" where the *s indicate that an exception occurred and data was missed. Any advice that anyone can offer would be much appreciated. If you need any more details or debugging information about any of these problems then let me know. Cheers -- Chris Paton Technical Developer Red61 -- Transaction Marketing Software http://www.red61.com -------------- next part -------------- A non-text attachment was scrubbed... Name: chris.paton.vcf Type: text/x-vcard Size: 230 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20071123/00a747b6/attachment-0006.vcf From chris.paton at red61.com Fri Nov 23 05:26:10 2007 From: chris.paton at red61.com (Chris Paton) Date: Fri, 23 Nov 2007 12:26:10 +0000 Subject: [Rxtx] RXTX parallel port issues Message-ID: <4746C6E2.3000304@red61.com> Hi there, I've been happily using RXTX to communicate with a serial based point-of-sale printer for a several months. I've recently received a parallel based printer and have been trying to get RXTX to talk to this too. I've encountered a few problems along the way and just wanted to check if I'm doing anything wrong, or if I've found any bugs. Writing ------- Writing to the parallel port using ParallelPort.getOutputStream works well, except when I use OutputStream.write(byte[]) to write a multiple of 8 bytes (!). Doing this causes the JVM to crash with an EXCEPTION_PRIV_INSTRUCTION on Windows. I worked around this in my application by adding an additional byte if bytesToWrite % 8 == 0. I guess I could also have called write(byte) repeatedly. This also generated a SIGSEGV on Linux but I was unable to reproduce it today using the CVS version of RXTX and a recent kernel. Reading status pins ------------------- On Linux, I've found that ParallelPort.isPaperOut and ParallelPort.isPrinterSelected appear to be inverted; i.e. when the paper is out ParallelPort.isPaperOut returns false, and when there is paper ParallelPort.isPaperOut returns true! I've tested this in both Sun JDK5 and JDK6 on machines running Linux 2.6.21 and 2.6.23. Fortunately it's easy to use a conditional based on System.getProperty("os.name") to hack around this. Reading from InputStream ------------------------ I've had more serious issues trying to read from ParallelPort.getInputStream. On Windows, readByte seems to return -1 (end of stream) any time data isn't available. On Linux, I got a kernel oops, even with a recent 2.6.23.1 kernel. I was able to stop this using a kernel patch that I found via Google. Although this stopped the oops, I still get frequent IOExceptions when calling InputStream.readByte. It appears that instead of blocking, readByte throws an IOException with message "Resource temporarily unavailable in readByte" any time it is called when no data is available. Occasionally, I get an exception instead of the data I was expecting to read, e.g when asking my printer for a version string I get "VER: S3306 * 06.03* 10/*6/06" where the *s indicate that an exception occurred and data was missed. Any advice that anyone can offer would be much appreciated. If you need any more details or debugging information about any of these problems then let me know. Cheers -- Chris Paton Technical Developer Red61 -- Transaction Marketing Software http://www.red61.com -------------- next part -------------- A non-text attachment was scrubbed... Name: chris.paton.vcf Type: text/x-vcard Size: 230 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20071123/00a747b6/attachment-0007.vcf From hho at bibliotheca.dk Fri Nov 23 06:45:36 2007 From: hho at bibliotheca.dk (Hans Hvelplund Odborg) Date: Fri, 23 Nov 2007 14:45:36 +0100 Subject: [Rxtx] RXTX parallel port issues In-Reply-To: <4746C6E2.3000304@red61.com> References: <4746C6E2.3000304@red61.com> Message-ID: <001201c82dd7$21c6e2c0$6a37a8c0@HANSLAPTOP> I've experienced similar crashes in JVM when writing to the parallel port in windows (with rxtx). Unfortunately I did not save the data sent to the parallel port so cannot say anything about the length. Furthermore, I recall having problems with .write(byte) (would never exit if I recall correctly), but I do not recall if this was with serial or parallel or both. In the end, we ended printing through Java's support of the windows driver. Unfortunately I currently don?t have the time to investigate these issues further. I just wanted to let you know that currently there are bugs in rxtx. Med venlig hilsen / Best regards / Med v?nliga h?lsningar Hans Hvelplund Odborg BIBLIOTHECA A/S Vallensb?kvej 20B ? 2605 Br?ndby ? Denmark Tel.: +45 70271008 Fax: +45 70271009 hho at bibliotheca.dk www.bibliotheca.dk -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Chris Paton Sent: 23. november 2007 13:26 To: rxtx at qbang.org Subject: [Rxtx] RXTX parallel port issues Hi there, I've been happily using RXTX to communicate with a serial based point-of-sale printer for a several months. I've recently received a parallel based printer and have been trying to get RXTX to talk to this too. I've encountered a few problems along the way and just wanted to check if I'm doing anything wrong, or if I've found any bugs. Writing ------- Writing to the parallel port using ParallelPort.getOutputStream works well, except when I use OutputStream.write(byte[]) to write a multiple of 8 bytes (!). Doing this causes the JVM to crash with an EXCEPTION_PRIV_INSTRUCTION on Windows. I worked around this in my application by adding an additional byte if bytesToWrite % 8 == 0. I guess I could also have called write(byte) repeatedly. This also generated a SIGSEGV on Linux but I was unable to reproduce it today using the CVS version of RXTX and a recent kernel. Reading status pins ------------------- On Linux, I've found that ParallelPort.isPaperOut and ParallelPort.isPrinterSelected appear to be inverted; i.e. when the paper is out ParallelPort.isPaperOut returns false, and when there is paper ParallelPort.isPaperOut returns true! I've tested this in both Sun JDK5 and JDK6 on machines running Linux 2.6.21 and 2.6.23. Fortunately it's easy to use a conditional based on System.getProperty("os.name") to hack around this. Reading from InputStream ------------------------ I've had more serious issues trying to read from ParallelPort.getInputStream. On Windows, readByte seems to return -1 (end of stream) any time data isn't available. On Linux, I got a kernel oops, even with a recent 2.6.23.1 kernel. I was able to stop this using a kernel patch that I found via Google. Although this stopped the oops, I still get frequent IOExceptions when calling InputStream.readByte. It appears that instead of blocking, readByte throws an IOException with message "Resource temporarily unavailable in readByte" any time it is called when no data is available. Occasionally, I get an exception instead of the data I was expecting to read, e.g when asking my printer for a version string I get "VER: S3306 * 06.03* 10/*6/06" where the *s indicate that an exception occurred and data was missed. Any advice that anyone can offer would be much appreciated. If you need any more details or debugging information about any of these problems then let me know. Cheers -- Chris Paton Technical Developer Red61 -- Transaction Marketing Software http://www.red61.com From tjarvi at qbang.org Fri Nov 23 16:28:23 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 23 Nov 2007 16:28:23 -0700 (MST) Subject: [Rxtx] RXTX parallel port issues In-Reply-To: <001201c82dd7$21c6e2c0$6a37a8c0@HANSLAPTOP> References: <4746C6E2.3000304@red61.com> <001201c82dd7$21c6e2c0$6a37a8c0@HANSLAPTOP> Message-ID: It would be good to create a bug report for this so others can either look into it or find the report to confirm their suspicions. Currently, there is only one parallel port bug report. http://bugzilla.qbang.org/show_bug.cgi?id=40 As we do update the reports when bugs are fixed, it gives people a chance to put themselves on the CC list and get notification of fixes they are interested in. On Fri, 23 Nov 2007, Hans Hvelplund Odborg wrote: > > I've experienced similar crashes in JVM when writing to the parallel port in > windows (with rxtx). > > Unfortunately I did not save the data sent to the parallel port so cannot > say anything about the length. > > Furthermore, I recall having problems with .write(byte) (would never exit if > I recall correctly), but I do not recall if this was with serial or parallel > or both. > > In the end, we ended printing through Java's support of the windows driver. > > Unfortunately I currently don?t have the time to investigate these issues > further. I just wanted to let you know that currently there are bugs in > rxtx. > > > Med venlig hilsen / Best regards / Med v?nliga h?lsningar > Hans Hvelplund Odborg > > BIBLIOTHECA A/S > Vallensb?kvej 20B ? 2605 Br?ndby ? Denmark > Tel.: +45 70271008 > Fax: +45 70271009 > hho at bibliotheca.dk > www.bibliotheca.dk > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Chris Paton > Sent: 23. november 2007 13:26 > To: rxtx at qbang.org > Subject: [Rxtx] RXTX parallel port issues > > Hi there, > > I've been happily using RXTX to communicate with a serial based > point-of-sale printer for a several months. I've recently received a > parallel based printer and have been trying to get RXTX to talk to this > too. I've encountered a few problems along the way and just wanted to > check if I'm doing anything wrong, or if I've found any bugs. > > Writing > ------- > Writing to the parallel port using ParallelPort.getOutputStream works > well, except when I use OutputStream.write(byte[]) to write a multiple > of 8 bytes (!). Doing this causes the JVM to crash with an > EXCEPTION_PRIV_INSTRUCTION on Windows. I worked around this in my > application by adding an additional byte if bytesToWrite % 8 == 0. I > guess I could also have called write(byte) repeatedly. > > This also generated a SIGSEGV on Linux but I was unable to reproduce it > today using the CVS version of RXTX and a recent kernel. > > Reading status pins > ------------------- > On Linux, I've found that ParallelPort.isPaperOut and > ParallelPort.isPrinterSelected appear to be inverted; i.e. when the > paper is out ParallelPort.isPaperOut returns false, and when there is > paper ParallelPort.isPaperOut returns true! I've tested this in both Sun > JDK5 and JDK6 on machines running Linux 2.6.21 and 2.6.23. Fortunately > it's easy to use a conditional based on System.getProperty("os.name") to > hack around this. > > Reading from InputStream > ------------------------ > > I've had more serious issues trying to read from > ParallelPort.getInputStream. On Windows, readByte seems to return -1 > (end of stream) any time data isn't available. > > On Linux, I got a kernel oops, even with a recent 2.6.23.1 > kernel. I was able to stop this using a kernel patch > > that I found via Google. Although this stopped the oops, I still get > frequent IOExceptions when calling InputStream.readByte. It appears that > instead of blocking, readByte throws an IOException with message > "Resource temporarily unavailable in readByte" any time it is called > when no data is available. Occasionally, I get an exception instead of > the data I was expecting to read, e.g when asking my printer for a > version string I get "VER: S3306 * 06.03* 10/*6/06" where the *s > indicate that an exception occurred and data was missed. > > > Any advice that anyone can offer would be much appreciated. If you need > any more details or debugging information about any of these problems > then let me know. > > Cheers > From keithvz at verizon.net Thu Nov 1 08:08:58 2007 From: keithvz at verizon.net (Keith) Date: Thu, 01 Nov 2007 10:08:58 -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: <4729DDFA.7080206@verizon.net> Trent Jarvi wrote: > 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? Well, I honestly don't know how all this fits together. I think it's just a matter of enabling the right flow control option within the standard serial framework to tell the device driver, "HEY START USING DTR/DSR FOR FLOW CONTROL." If what UGeorge said,(about that type of nitty-gritty lead control being done within the device driver), is true, then this confirms my suspicion. I tried narrowing down within the Linux drivers what you are looking for, but I can't entirely tell wth I'm looking at. (virtual com port drivers -- they are included compiled by default with Ubuntu, source included) http://www.ftdichip.com/Drivers/VCP/Linux/ftdi_sio.tar.gz Hahahaa, they make a reference to DTR flow control being supported but say (UGH) in parenthesis. You can also use their direct device driver library on Ubuntu -- libftd2xx.so.0.4.13. No source code. http://www.ftdichip.com/Drivers/D2XX/Linux/libftd2xx0.4.13.tar.gz In that case, you make a call to their FT_SetFlowControl() function. FT_STATUS FT_SetFlowControl (FT_HANDLE ftHandle, USHORT usFlowControl, UCHAR uXon,UCHAR uXoff) Parameters ftHandle Handle of the device. usFlowControl Must be one of FT_FLOW_NONE, FT_FLOW_RTS_CTS, ****FT_FLOW_DTR_DSR**** or FT_FLOW_XON_XOFF. uXon Character used to signal Xon. Only used if flow control is FT_FLOW_XON_XOFF. uXoff Character used to signal Xoff. Only used if flow control is FT_FLOW_XON_XOFF. This is from their programming guide http://www.ftdichip.com/Documents/ProgramGuides/D2XXPG34.pdf I actually want to take this a step further and say that I think the flow control is actually handled right on the device itself in hardware/firmware. It's enabled through the device driver, but I think the maintaining of buffers, asserting/deasserting of leads, etc is handled by the device. For the time being, I've switched to jd2xx, https://jd2xx.dev.java.net/ and http://bleyer.org/jd2xx/ These are Java wrappers for the device driver libraries. It allows almost direct access to the well-documented device drivers from Java. I hope this helps Keith From tjarvi at qbang.org Thu Nov 1 11:09:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:09:51 -0600 (MDT) 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: Hi Martin, What I usually have done is allow changes that do not impact working software including changes to methods not documented in CommAPI (which remain undocumented in rxtx) and fixes to known problems in the documented portions. That way if you use the documented API, the releases should only become better with time. If you use the undocumented portions, the behavior is not as predictable but open for improvement. On Wed, 31 Oct 2007, 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 >> > From tjarvi at qbang.org Thu Nov 1 11:15:52 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:15:52 -0600 (MDT) 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: I too use rxtx in commercial products. The problem I've been trying to address while bringing the server back was how to make it possible for hobby folks to build the same software as companies so we can move rxtx along a little faster. Exposing internal tools is not an option at this time, the public rxtx builds have been done on my home machine which has drives hanging out of it all over the place dying one at a time. This isn't maintainable. I'm currently looking at the possibility of making an S3 image available on Amazon's EC. These are machines you can rent for ~10 cents an hour which is more than enough to build rxtx. The S3 image is not changed when people use it so everyone has the same starting point. With this, we could all build rxtx for ~20 platforms for a small price and eliminate tool issues. On Wed, 31 Oct 2007, Greg Johnson wrote: > 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 tjarvi at qbang.org Thu Nov 1 11:19:55 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:19:55 -0600 (MDT) 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: On Wed, 31 Oct 2007, 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. I was helping Dmitry do the Mac OS X port without access to a machine when we put that in. In the archives there is information (easily found with google on Apple's site) that describes how their API (and others) can determine if a port is used and ignore it. I think these changes are in CVS but need to confirm. The bottom line is that rxtx should not have used lock files on Mac. It was just ignorance of the system on my part. -- Trent Jarvi tjarvi at qbang.org From fabioanjos at gmail.com Thu Nov 1 12:35:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Thu, 1 Nov 2007 15:35:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Hi, I was using SerialEventListener in my project. But, as was said here, id doesnt work very well with virtual serial ports. So, I changed the strategy using the code posted here in this thread: try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > 0) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } The thing is that in my tests I could notice that in.read(buffer) never blocks. Even when there's nothing to read. Instead of blocking when there's nothing to read it returns 0. So, my questions are: 1. Am I doing something wrong? 2. If not, wouldnt this decrease performance? (the thread would be locked in a loop that does nothing.) 3. Is there a better way to do the job? Thanks in advance!! F?bio -------- On 10/31/07, Andre-John Mas wrote: > > > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/0aee59d0/attachment-0026.html From ajmas at sympatico.ca Thu Nov 1 16:07:55 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Nov 2007 18:07:55 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Message-ID: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From sarah_662005 at yahoo.com Thu Nov 1 17:10:05 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Thu, 1 Nov 2007 16:10:05 -0700 (PDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Message-ID: <351433.37166.qm@web55814.mail.re3.yahoo.com> Thank you very much for your help. Now the application works fine. the serialEvent gets triggered. Rxtx is cool! ----- Original Message ---- From: Andre-John Mas To: Sara Hugh ; RXTX Developers and Users Sent: Wednesday, October 31, 2007 9:55:45 AM Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered 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 __________________________________________________ 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/20071101/4a86bea6/attachment-0026.html From tjarvi at qbang.org Thu Nov 1 17:58:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 17:58:02 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx Message-ID: The rxtx.org site is primarily interested in the hobby aspects of rxtx. Obviously, there are some companies following the work too. These interests bring larger workflows and concerns about details hobby folks may not care about. They also bring many more users. I know the company I work for has a quality engineering effort going on which includes rxtx. While the server was down, I was contacted by another company that was missing the binaries for their testing. Several people have mentioned concerns about a stable release for like reasons. Would there be interest on the quality side of the coin to get together? It could be just sharing email's with each other or a seperate list for QE/QA. I can not say for sure, but we may be able to share some of our efforts/results that could help keep rxtx releases stable. -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Fri Nov 2 01:42:55 2007 From: scldad at sdc.com.au (Stephen Davies) Date: Fri, 2 Nov 2007 18:12:55 +1030 Subject: [Rxtx] Multiple modems Message-ID: <200711021812.56047.scldad@sdc.com.au> This may or may not be related to the Multiple Ports thread. I have an application which uses rxtx on Linux (via cron jobs) to connect multiple modems to remote sensing devices. The application works fine most of the time but occasionally fails to connect if two (or more) connection attempts happen at about the same time. When it fails, it looks as if it may get confused as to which port it is talking to. The app has a "base" component that looks for an available port, opens it and then creates an input thread and an output thread for the connection and data transfer. The "base" component uses this code: // loop round all known ports until one is available. Give up after three minutes Counter ptimeout = new Counter(); while(!portFound && ptimeout.elapsed() < 180000) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // special case. ttyS0 is not available to us on this server. if (!portId.isCurrentlyOwned() && !portId.getName().equals("/dev/ttyS0")) { gLog.debug(lognm + ": Found port " + portId.getName()); try { serialPort = (RXTXPort) portId.open("AguaModem", 10000); } catch (Exception e) { gLog.error(lognm + ": Port " + portId.getName() + " will not open."); gLog.error(e.getMessage()); continue; } AguaModem aguamodem = new AguaModem(); portFound = true; break; } gLog.debug(lognm + ": Port " + portId.getName() + " is busy"); } } } I am wondering about the isCurrentlyOwned method. Does this actually tell me whether a port is currently being used by another process? TIA, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From fabioanjos at gmail.com Fri Nov 2 04:59:58 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 07:59:58 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Message-ID: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/9009eb1d/attachment-0026.html From netbeans at gatworks.com Fri Nov 2 06:28:13 2007 From: netbeans at gatworks.com (U. George) Date: Fri, 02 Nov 2007 08:28:13 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <472B17DD.1050508@gatworks.com> It should normally block ( unless eof / event ) . so its a :{ whats the device ( to recreate if possible ) and how do u open. > My question is, is there a way to make in.read block the thead until > there's something to read? > From fabioanjos at gmail.com Fri Nov 2 06:34:46 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 09:34:46 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > On 11/1/07, Andre-John Mas wrote: > > > > Fabio, > > > > Turns out there was a small error in my example. The test should be: > > > > (numBytes = in.read(buffer)) > -1 > > > > This is because -1 indicates an end of file (end of data stream) > > > > Andre > > > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > > > Hi, > > > > > > I was using SerialEventListener in my project. But, as was said > > > here, id doesnt work very well with virtual serial ports. > > > So, I changed the strategy using the code posted here in this thread: > > > > > > try{ > > > in = port.getInputStream(); > > > out = port.getOutputStream(); > > > int numBytes = 0; > > > while(active){ > > > > > > byte[] buffer = new byte[10]; > > > > > > while ( (numBytes = in.read(buffer)) > 0) > > > { > > > String dataValue = new String(buffer,0,numBytes); > > > processInput(dataValue); > > > } > > > > > > if(numBytes==-1){ > > > break; > > > } > > > > > > Thread.sleep(50); > > > } > > > > > > }catch(IOException e){ > > > logger.info("falha de comunicacao "+ > > > getReceptor().getPort() ); > > > > > > }catch(InterruptedException e){ > > > logger.info ("Interrompendo leitura da porta "+ > > > getReceptor().getPort() ); > > > } > > > > > > The thing is that in my tests I could notice that in.read(buffer) > > > never blocks. Even when there's nothing to read. Instead of blocking > > > when there's nothing to read it returns 0. > > > > > > So, my questions are: > > > > > > 1. Am I doing something wrong? > > > 2. If not, wouldnt this decrease performance? (the thread would be > > > locked in a loop that does nothing.) > > > 3. Is there a better way to do the job? > > > > > > Thanks in advance!! > > > > > > F?bio > > > -------- > > > > > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > > 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 > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > > > > > -- > > > Atenciosamente, > > > F?bio Cristiano dos Anjos > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/5306c4b1/attachment-0026.html From nick.circelli at infrasafe.com Fri Nov 2 07:01:17 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Fri, 2 Nov 2007 08:01:17 -0500 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com><29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com><90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca><29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Message-ID: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> I'm pretty sure that not blocking has to do with you virtual ports. Cause it should block. Maybe you should try: while ((numBytes = in.available()) > 0) { If (numBytes > buffer.length) { numBytes = buffer.length; // in case you have buffer overflow } numBytes = in.read(buffer, 0 , numBytes)); String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } Also, just for optimization, I'd move that byte[] buffer = new byte[10]; out of the while since you don't need to reallocate it every iteration. ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of F?bio Cristiano dos Anjos Sent: Friday, November 02, 2007 8:35 AM To: RXTX Developers and Users Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream (); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas < ajmas at sympatico.ca > wrote: Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info ("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Atenciosamente, F?bio Cristiano dos Anjos -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/4de7f6a3/attachment-0026.html From fabioanjos at gmail.com Fri Nov 2 07:36:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 10:36:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> Message-ID: <29788b250711020636q1588c88fgaa5e27f5504164fb@mail.gmail.com> Hi Nick, Actually, it doesnt block for physical ports too. And, the method avaiable does not block either, so when there's nothing avaiable the loop ends and the thread stops lintening to the port. But I did some more test with serialEventListener, and now its working. I realy dont know what I've done to get it working. I just start woking as soon as I decided to test it again. It was said here that serialEventListener is not reliable for virtual serial ports. Is there another way to read it, without compromising performance? Tanks again!! F?bio ------- On 11/2/07, Nick Circelli wrote: > > I'm pretty sure that not blocking has to do with you virtual ports. > Cause it should block. > > Maybe you should try: > > > > while ((numBytes = in.available()) > 0) > > { > > If (numBytes > buffer.length) { > > numBytes = buffer.length; // in case you have buffer overflow > > } > > numBytes = in.read(buffer, 0 , numBytes)); > > String dataValue = new String(buffer,0,numBytes,"ASCII"); > > processInput(dataValue); > > } > > > > Also, just for optimization, I'd move that byte[] buffer = new > byte[10]; > > out of the while since you don't need to reallocate it every iteration. > > > ------------------------------ > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On Behalf > Of *F?bio Cristiano dos Anjos > *Sent:* Friday, November 02, 2007 8:35 AM > *To:* RXTX Developers and Users > *Subject:* Re: [Rxtx] serialEvent(SerialPortEvent event) never be > triggered > > > > Hi, > > I think i missunderstand something here. > The code you post here was meant to be used inside serialEvent method, > right? > > The think is, that i cannot user SerialEventListener to read serial ports, > because i need to read virual serial ports and id does not behaves well, as > said here before. serialEvent is never triggered. > > So what I quit using SerialEventListener and created a thread to listen to > the port: > > public void run(){ > try{ > in = port.getInputStream(); > out = port.getOutputStream (); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new > String(buffer,0,numBytes,"ASCII"); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ getReceptor().getPort() > ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > } > > > So, the problem is that in.read(buffer) always returns 0 when there is > nothing to read, instead of blocking the flow, and the thread becames locked > in the loop. > > I hope you can help me solve this. > > Thanks in advance! > > F?bio > -------- > > On 11/2/07, *F?bio Cristiano dos Anjos* wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > > > On 11/1/07, *Andre-John Mas* < ajmas at sympatico.ca> wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info ("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/571df6ea/attachment-0025.html From tjarvi at qbang.org Fri Nov 2 08:32:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Nov 2007 08:32:15 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: References: Message-ID: On Fri, 2 Nov 2007, Greg Johnson wrote: > Hi Trent, folks, > Having a single rxtx that is suitable for commercial uses and hobbyists both > would be a great idea? Perhaps it would be worth submitting rxtx as a > proposal to Codehaus - they not only provide excellent tools (Jira (bug > tracker), Confluence (wiki)) but also support build management ( > maestro, continuum, bamboo). Relying on your personal machine (btw, frii.com > / rxtx.org is down again?) seems like a burden you shouldn't have to shoulder > alone. Hi Greg, There may be a little confusion here. There is no need to have two seperate rxtx releases. What I'm trying to encourage is a discussion between some of the people responsible for making sure rxtx does not break their products each release. Usually these people are interested in testing a set of functionality their product depends upon. They do not work with rxtx code but rather traps to catch when rxtx developers break something. This goes on all the time in isolated labs. There are many services that offer to do various pieces of a project for you if you... Anyone is free to do the 'if you' portion with rxtx and see how it goes. I'm actually interested in doing less of that than more. The rxtx.org work I do just happens to overlap with other things I do for personal/family use. The reason I suggest the amazon solution is that anyone can take full control of the environment for a day and it costs less than a package of gum without causing harm to what anyone else is doing. I assume the down question was with respect to a mod_security setting that has been resolved. If not, please post a url to the problem. -- Trent Jarvi tjarvi at qbang.org From nsayer at kfu.com Sat Nov 3 20:17:49 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 19:17:49 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? Message-ID: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Has anyone got RXTX working with an app under Leopard? My app hangs on port open (it works fine with Tiger). The relevant thread looks like this in the activity monitor: 1536 JVM_InvokeMethod 1536 0x48ccd0 1536 0x46f8a0 1536 0x4c3ff4 1536 0x4c4284 1536 0x357d160 1536 0x357faac 1536 Java_gnu_io_RXTXPort_open 1536 open $NOCANCEL$UNIX2003 1536 open $NOCANCEL$UNIX2003 From ajmas at sympatico.ca Sat Nov 3 22:02:04 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 00:02:04 -0400 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> RXTX works for me with Leopard. I am currently using it communicate with a Bluetooth GPS. What computer and device are you trying to use? Is the driver for your serial device compatible with MacOS X 10.5? Andre On 3-Nov-07, at 22:17 , Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From nsayer at kfu.com Sat Nov 3 22:17:47 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 21:17:47 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> Message-ID: <1720F723-3643-438C-B3AB-E09A67536977@kfu.com> On Nov 3, 2007, at 9:02 PM, Andre-John Mas wrote: > RXTX works for me with Leopard. I am currently using it communicate > with a Bluetooth GPS. > > What computer and device are you trying to use? Is the driver for > your serial device compatible with MacOS X 10.5? An Intel mac mini The FTDI USB serial driver an XMPCR, which is just a fancy serial controlled radio and an FTDI usb-to-serial chip I've successfully used the FTDI driver with another FTDI device in another context. > > > Andre > > On 3-Nov-07, at 22:17 , Nick Sayer wrote: > >> Has anyone got RXTX working with an app under Leopard? >> >> My app hangs on port open (it works fine with Tiger). The relevant >> thread looks like this in the activity monitor: >> >> 1536 JVM_InvokeMethod >> 1536 0x48ccd0 >> 1536 0x46f8a0 >> 1536 0x4c3ff4 >> 1536 0x4c4284 >> 1536 0x357d160 >> 1536 0x357faac >> 1536 >> Java_gnu_io_RXTXPort_open >> 1536 open >> $NOCANCEL$UNIX2003 >> 1536 open >> $NOCANCEL$UNIX2003 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From racecar at gmail.com Sat Nov 3 22:25:53 2007 From: racecar at gmail.com (Kevin Mateo Lim) Date: Sat, 3 Nov 2007 21:25:53 -0700 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: Message-ID: I am alternating between two errors. After i run the macosx_setup.command, "everyone" is set to Read only in /var/lock. I notice in the terminal that the group for these perms is _uucp, not uucp. In that state, I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 check_group_uucp(): error testing lock file creation Error details:Permission deniedcheck_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException : Error inside Serial.() at processing.serial.Serial.errorMessage(Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.( Serial.java:102) at Temporary_829_3245.setup(Temporary_829_3245.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java :690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) Then, I hand edit the "everyone" permissions for /var/lock/ to Read and Write (note /var/spool/uucp is Read/Write in all cases, and doesn't change). I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX uucp_lock() /var/lock/LK.003.009.000 is there gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException: Error inside Serial.() at processing.serial.Serial.errorMessage (Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.(Serial.java:102) at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java:690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) See here: http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071103/f1a2c467/attachment-0024.html From greg.johnson at manchester.ac.uk Sun Nov 4 02:31:13 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sun, 4 Nov 2007 10:31:13 +0100 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <28B5E0A0-0802-4C74-AC21-87ED35F3B9A2@manchester.ac.uk> Hi Nick, I also had problems initially with Leopard, but it was resolved by reinstalling the serial USB driver (FTDI in my case). The symptoms were a non-detection of any ports (but I twigged when I tried ZTerm and it had the same problem). Good luck! Cheers, greg PS I did a "Archive and install" which may be the reason my FTDI driver had disappeared - I don't think the driver has changed for 10.5 ------------------------------------------------------------------------- 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 4 Nov 2007, at 03:17, Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Sun Nov 4 13:01:12 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 15:01:12 -0500 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: Message-ID: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Hi, You will need to get the 2.1-8 code from CVS. See the FAQ for more information: http://rxtx.qbang.org/wiki/index.php/FAQ Andre On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > I am alternating between two errors. > > After i run the macosx_setup.command, "everyone" is set to Read only > in /var/lock. I notice in the terminal that the group for these > perms is _uucp, not uucp. > > In that state, I get this error: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > check_group_uucp(): error testing lock file creation Error > details:Permission deniedcheck_lock_status: No permission to create > lock file. > please see: How can I use Lock Files with rxtx? in INSTALL > gnu.io.PortInUseException: Unknown Application > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > java.lang.RuntimeException : Error inside Serial.() > > at processing.serial.Serial.errorMessage(Serial.java:583) > > at processing.serial.Serial.(Serial.java:148) > > at processing.serial.Serial.( Serial.java:102) > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > at processing.core.PApplet.run(PApplet.java:1556) > > at java.lang.Thread.run(Thread.java:613) > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > and Write (note /var/spool/uucp is Read/Write in all cases, and > doesn't change). I get this error: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > gnu.io.PortInUseException: Unknown Application > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > java.lang.RuntimeException: Error inside Serial.() > > at processing.serial.Serial.errorMessage (Serial.java:583) > > at processing.serial.Serial.(Serial.java:148) > > at processing.serial.Serial.(Serial.java:102) > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > at processing.core.PApplet.run(PApplet.java:1556) > > at java.lang.Thread.run(Thread.java:613) > > See here: > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From netbeans at gatworks.com Sun Nov 4 14:33:35 2007 From: netbeans at gatworks.com (U. George) Date: Sun, 04 Nov 2007 16:33:35 -0500 Subject: [Rxtx] #ifndef TIOCSERGETLSR Message-ID: <472E3AAF.7050709@gatworks.com> For Linux, it seems that you need the code for both *having* a TIOCSERGETLSR, and *not having* a TIOCSERGETLSR. Maybe the ioctl exists system wide, but not necessarily for the device driver itself ( always returns -1 ) . Are there systems that have a *functioning* TIOCSERGETLSR for all their devices? Then this would be the case where the "#ifndef TIOCSERGETLSR" directive could be useful is eliminating the unnecessary code and tests. And for those systems that dont have a TIOCSERGETLSR, then the code for TIOCSERGETLSR can be eliminated. It would be a simple case to have, as a foundation, all the code to simulate the missing TIOCSERGETLSR ioctl. If the system does have the ioctl, then that code can be ifdef'd in, and co-exist with the functionality of the code that simulates the missing TIOCSERGETLSR ioctl. From racecar at gmail.com Sun Nov 4 17:30:19 2007 From: racecar at gmail.com (Kevin Mateo Lim) Date: Sun, 4 Nov 2007 17:30:19 -0700 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: the README.OSX reads: Put libSerial.jnilib in the directory of the application (the JavaVM will find it there). Add RXTXComm.jar to the application classpath or include the classes in the application jar. (Some applications already include the RXTX classes in their application jar, in which case only the file libSerial.jnilib is required). I can't find libSerial.jnilib I put librxtxSerial.jnilib into my Processing /libraries/serial/library/ directory. Yet it still sees the old version: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 On 11/4/07, Andre-John Mas wrote: > > Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > 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/20071104/c0a83f91/attachment-0023.html From ajmas at sympatico.ca Sun Nov 4 17:41:47 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 19:41:47 -0500 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> If you are wanting it to be available for all applications, - for all users: /Library/Java/Extensions - for your user: ~/Library/Java/Extensions Or just for your application, then it should be in the same directory from which yo are launching your application. If you are getting the 2.1-8 source, then the library built is called: librxtxSerial.jnilib despite what the docs say. Andre On 4-Nov-07, at 19:30 , Kevin Mateo Lim wrote: > > the README.OSX reads: > Put > libSerial.jnilib > in the directory of the application (the JavaVM will find it there). > Add > RXTXComm.jar > to the application classpath or include the classes in the > application jar. > (Some applications already include the RXTX classes in their > application jar, > in which case only the file libSerial.jnilib is required). > > > I can't find libSerial.jnilib > I put librxtxSerial.jnilib into my Processing /libraries/serial/ > library/ directory. > > Yet it still sees the old version: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > On 11/4/07, Andre-John Mas wrote: Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial .(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay (PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > From bschlining at gmail.com Sun Nov 4 19:46:23 2007 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 4 Nov 2007 18:46:23 -0800 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> Message-ID: > > Or just for your application, then it should be in the same directory > from which yo are launching your application. Just wanted to add one more way of specifying the native lib location... If you don't want to define it globally by putting it in /Library/Java/Extensions (and you don't, it's a very very bad practice) you can also specify the location of the native library when starting the JVM by specifying the 'java.library.path' property. For example: java -Djava.library.path=/Path/To/Directory/With/RXTX/Library YourMainClass -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071104/c5af6980/attachment-0023.html From greg.johnson at manchester.ac.uk Mon Nov 5 01:39:02 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Mon, 5 Nov 2007 09:39:02 +0100 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: The 2.1-8 code reports 2.1-7, hence your (and my) confusion. But as long as you've removed all traces of the old library, it really _is_ 2.1-8. And if you specify the library path to the VM, don't make my mistake (on OSX at least) - you need to respecify the entire library path it had by default, as the command line argument replaces the path, rather than appending to it. 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 5 Nov 2007, at 01:30, Kevin Mateo Lim wrote: > > the README.OSX reads: > Put > libSerial.jnilib > in the directory of the application (the JavaVM will find it there). > Add > RXTXComm.jar > to the application classpath or include the classes in the > application jar. > (Some applications already include the RXTX classes in their > application jar, > in which case only the file libSerial.jnilib is required). > > > I can't find libSerial.jnilib > I put librxtxSerial.jnilib into my Processing /libraries/serial/ > library/ directory. > > Yet it still sees the old version: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > On 11/4/07, Andre-John Mas wrote: > Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial .(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay (PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > 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 HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071105/7f50506d/attachment-0023.html From cyrille.dumont at tatexpress.fr Mon Nov 5 05:46:03 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 05 Nov 2007 13:46:03 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: References: <472727F1.1000704@tatexpress.fr> Message-ID: <472F108B.2090101@tatexpress.fr> Thanks a lot for your solution ... but I'm not a expert in JAVA ... (sorry) For the moment I've this function : """ public void serialEvent(SerialPortEvent e) { StringBuffer inputBuffer = new StringBuffer(); int newData = 0; switch (e.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } //-- Manag. Data from Scanner this.MngDataScanner(inputBuffer.toString()); break; case SerialPortEvent.BI:; //-- Break Received } } """ How can I do what you write ? ( maybe a simple ex ? ) PS : I don't know the PDF417 size (could be, for example, 338 char, or 500 ... ; what I know is that it can't be more than 800 char) Thanks in advance. Best regards. Trent Jarvi a ?crit : > 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 Martin.Oberhuber at windriver.com Mon Nov 5 08:47:50 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 5 Nov 2007 16:47:50 +0100 Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> Hi Trent, are the interestes of hobbyists really so different from commercial ones? Both should be interested in high quality and innovation the like. I haven't seen too many Open Source projects from the "inside" but those that I have seen did not have separate mailing lists for quality/testing/qa versus innovation/development. What I have seen with the Open Source projects that one would call "successful" is a good deal of process around automated builds, automated unit tests, predictable release dates and milestones, and policies around commiting/contributing/reviewing changes. I think that all of these benefit commercial users and hobbyists the like. If you were just asking about who's interested in discussing changes to foster more quality, count me in. I'm just not sure whether discussing these on a separate mailing list or other channel is the right thing to do. Cheers, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From toupsz at cs.tamu.edu Tue Nov 6 14:27:04 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 15:27:04 -0600 Subject: [Rxtx] reading TTL level signals from serial? Message-ID: Dear RXTX community- I've been using RXTX to handle communicating with several hardware devices in Java (a GPS and some custom audio circuitry for my dissertation work). I have a new, high-accuracy GPS which only communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there any way to communicate with this device using RXTX, perhaps by modding the native code for Windows? If so, does anyone have any tips on how to do it? Has it perhaps already been done? Another option is for me to invert / amplify the signal in hardware, but this is difficult for me to pull off due to the sensitivity of the electronics involved...I'll likely end up using a much less accurate piece of equipment rather than go that far! If anyone could help out, I'd really appreciate it! Thanks! -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/b6c59c2b/attachment-0021.html From netbeans at gatworks.com Tue Nov 6 14:55:22 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 06 Nov 2007 16:55:22 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: Message-ID: <4730E2CA.3090009@gatworks.com> This is really a hardware issue. Is there any device ( ie the serial port ) on your computer that will accept the voltage signals ( and load ) that your device produces? Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it happen safely ( ie u dont cook the GPS device ) I have a new, high-accuracy GPS which only > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there > any way to communicate with this device using RXTX, From toupsz at cs.tamu.edu Tue Nov 6 15:14:01 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 16:14:01 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4730E2CA.3090009@gatworks.com> References: <4730E2CA.3090009@gatworks.com> Message-ID: Actually, the device runs over USB, but shows up as a virtual serial port and is outputting these signals. The software that comes with the device (a u-blox ANTARIS 4 eval kit) is able to communicate. RXTX is able to detect and properly configure the port, but does not get any of the data from it. :-/ It seems like there must be some way to do it (obviously, ublox knows how)... -Zach On Nov 6, 2007 3:55 PM, U. George wrote: > This is really a hardware issue. > Is there any device ( ie the serial port ) on your computer that will > accept the voltage signals ( and load ) that your device produces? > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it > happen safely ( ie u dont cook the GPS device ) > > > I have a new, high-accuracy GPS which only > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there > > any way to communicate with this device using RXTX, > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/15ae7a0b/attachment-0021.html From keithvz at verizon.net Tue Nov 6 16:16:55 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 06 Nov 2007 18:16:55 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> Message-ID: <4730F5E7.1030704@verizon.net> Zach Toups wrote: > On Nov 6, 2007 3:55 PM, U. George > wrote: > > This is really a hardware issue. > Is there any device ( ie the serial port ) on your computer that will > accept the voltage signals ( and load ) that your device produces? > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it > happen safely ( ie u dont cook the GPS device ) > > > I have a new, high-accuracy GPS which only > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is > there > > any way to communicate with this device using RXTX, > _______________________________________________ As UGeorge intimated, it's a hardware issue. If your device outputs TTL level voltages, and your USB to serial converter is RS-232, then you've got a physical hardware differences. Inverted leads and voltage issues are mainly the problem. MAXIM makes a neat little chip called the MAX233 (better than the 232, no extern caps required) You can't solve this in software. Now, there are TTL level compatible USB to serial converters available, I happen to be using one right now. This unit below is from a UK company (there might be sources in the US) http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm Parallax makes one that does 3.3 and 5v http://www.parallax.com/detail.asp?product_id=32201 (but only supports RX, TX, GND, AND DTR towards device) (i've tested a variant of the unit above, and it works with RXTX) In both cases, you'll need some creative wiring depending on the interface on your GPS. Hope this helps Keith From toupsz at cs.tamu.edu Tue Nov 6 16:53:01 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 17:53:01 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4730F5E7.1030704@verizon.net> References: <4730E2CA.3090009@gatworks.com> <4730F5E7.1030704@verizon.net> Message-ID: Yeah...I used an FTDI chip to handle USB/serial conversion on the audio equipment I built. I'm leery of trying to build a board for this ublox GPS due to all the grounding/shielding issues around it. Anyway, I apreciate the help...just sad that I can't handle the problem in software! Ublox did send me the source code for their USB drivers...but as a Java programmer, it's a bit tough for me to sort out. ;) Thanks again! -Zach On Nov 6, 2007 5:16 PM, Keith Monahan wrote: > Zach Toups wrote: > > > On Nov 6, 2007 3:55 PM, U. George > > wrote: > > > > This is really a hardware issue. > > Is there any device ( ie the serial port ) on your computer that > will > > accept the voltage signals ( and load ) that your device produces? > > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make > it > > happen safely ( ie u dont cook the GPS device ) > > > > > > I have a new, high-accuracy GPS which only > > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is > > there > > > any way to communicate with this device using RXTX, > > _______________________________________________ > > As UGeorge intimated, it's a hardware issue. > > If your device outputs TTL level voltages, and your USB to serial > converter is RS-232, then you've got a physical hardware differences. > Inverted leads and voltage issues are mainly the problem. MAXIM makes a > neat little chip called the MAX233 (better than the 232, no extern caps > required) > > You can't solve this in software. > > Now, there are TTL level compatible USB to serial converters available, > I happen to be using one right now. > > This unit below is from a UK company (there might be sources in the US) > > http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm > > Parallax makes one that does 3.3 and 5v > > http://www.parallax.com/detail.asp?product_id=32201 > (but only supports RX, TX, GND, AND DTR towards device) > > (i've tested a variant of the unit above, and it works with RXTX) > > In both cases, you'll need some creative wiring depending on the > interface on your GPS. > > Hope this helps > > Keith > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/06e88ad4/attachment-0021.html From netbeans at gatworks.com Tue Nov 6 17:14:01 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 06 Nov 2007 19:14:01 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> <4730F5E7.1030704@verizon.net> Message-ID: <47310349.5000406@gatworks.com> what gps chipset do u have? > Ublox did send me the source code for their USB drivers...but as a Java > programmer, it's a bit tough for me to sort out. ;) From Steffen.DETTMER at ingenico.com Wed Nov 7 03:10:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 7 Nov 2007 11:10:01 +0100 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> Message-ID: <20071107101000.GN10978@elberon.bln.de.ingenico.com> * Zach Toups wrote on Tue, Nov 06, 2007 at 16:14 -0600: > Actually, the device runs over USB, but shows up as a virtual > serial port and is outputting these signals. Ahh, so what you want is to use rxtx on the serial port that is created by the driver and mapped maybe as some COM8 or whatever? I this case then IMHO it would be no hardware question but maybe a problem in your application, or some driver or indeed a rxtx issue. > The software that > comes with the device (a u-blox ANTARIS 4 eval kit) is able to > communicate. Is it sure that this software is really using the virtual serial port and only this port? oki, Steffen -- About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Wed Nov 7 04:59:10 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 06:59:10 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <20071107101000.GN10978@elberon.bln.de.ingenico.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> Message-ID: <4731A88E.6080705@gatworks.com> >> The software that >> comes with the device (a u-blox ANTARIS 4 eval kit) is able to >> communicate. > > Is it sure that this software is really using the virtual serial > port and only this port? > I have tried to read the docs. I have yet to find any explanation on a (windoz) device driver for this device ( the usb device ). That magic is not explained. For a developer thats important magic. Maybe a call to their support team is in order? From netbeans at gatworks.com Wed Nov 7 05:01:38 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 07:01:38 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <20071107101000.GN10978@elberon.bln.de.ingenico.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> Message-ID: <4731A922.7@gatworks.com> Steffen DETTMER wrote: > * Zach Toups wrote on Tue, Nov 06, 2007 at 16:14 -0600: >> Actually, the device runs over USB, but shows up as a virtual BTW: it seems that I am not getting all the Rxtx mail. Is there still a problem? From toupsz at cs.tamu.edu Wed Nov 7 07:36:20 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Wed, 7 Nov 2007 08:36:20 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4731A88E.6080705@gatworks.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> <4731A88E.6080705@gatworks.com> Message-ID: When I emailed them about this issue, they sent me their WinCE drivers, which are apparently based on this open source driver: http://www.yetanotherhomepage.com/j7xx/j7xx.html?/j7xx/software/util/usbdriver.html These include srcdll, and x86 subfolders, though it's not 100% clear to me that these are useful. The ublox communication suite appears to only communicate with serial ports...I've communicated with the ublox on two different comm ports (one with the serial adapter plugged into the serial port, one with the main USB connection), as well as a Garmin bluetooth GPS (which comes up as a bluetooth serial device). I'm not well versed in code this close to the hardware, but it seems to me that if you're running a virtual serial port, then you're virtually controlling the "voltages" that come in on this "port"...so why would they be "ttl level"? :-/ Shouldn't the USB driver be able to interpret the signals in whatever way it wants and just supply software with the binary interpretation? Thanks for all the help, guys, it's really appreciated! -Zach On Nov 7, 2007 5:59 AM, U. George wrote: > > >> The software that > >> comes with the device (a u-blox ANTARIS 4 eval kit) is able to > >> communicate. > > > > Is it sure that this software is really using the virtual serial > > port and only this port? > > > > I have tried to read the docs. I have yet to find any explanation on a > (windoz) device driver for this device ( the usb device ). That magic > is not explained. For a developer thats important magic. Maybe a call > to their support team is in order? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071107/18a13314/attachment-0020.html From netbeans at gatworks.com Wed Nov 7 08:55:55 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 10:55:55 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> <4731A88E.6080705@gatworks.com> Message-ID: <4731E00B.9030902@gatworks.com> There are 2 components to talking to hardware. There is the electrical specification, and then there is the software specification. there is the rs232 specification, parallel port specification, and the USB electrical specification. Generally these are used to plug in the various devices, and hook up electrically. Then there is the software side. There is the device driver, a software component that sits somewhere in the kernel that handles the USB ( in your case ) controller. The device driver generally does not care about the electrical component. There are various chips that handle USB signals, and these chips have I/O addresses so that signals and data can be properly routed. There is also the side that communicates to the user via the COM port device-name. The device driver that you mentioned is for the "Support PL2303 serial chip". This device driver, which hopefully works, handles the USB chip, and eventually recognzes the gps device, and hopefully creates an COM port so the user can open up and communicate. These are a lot of "HOPES". Since u have the web address of the device driver, and developer, I would think that the developer, and any docs, might be better able to help u to first determine if the GPS device is recognized, and the COM port ( maybe its called by another name ) is created, as per documentation. > > These include srcdll, and x86 subfolders, though it's not 100% clear to > me that these are useful. From tjarvi at qbang.org Sat Nov 10 17:46:13 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Nov 2007 17:46:13 -0700 (MST) Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 5 Nov 2007, Oberhuber, Martin wrote: > Hi Trent, > > are the interestes of hobbyists really so different > from commercial ones? Both should be interested in > high quality and innovation the like. > > I haven't seen too many Open Source projects from the > "inside" but those that I have seen did not have > separate mailing lists for quality/testing/qa > versus innovation/development. > > What I have seen with the Open Source projects that > one would call "successful" is a good deal of > process around automated builds, automated unit > tests, predictable release dates and milestones, > and policies around commiting/contributing/reviewing > changes. > > I think that all of these benefit commercial users > and hobbyists the like. > > If you were just asking about who's interested in > discussing changes to foster more quality, count > me in. I'm just not sure whether discussing these > on a separate mailing list or other channel is the > right thing to do. > Hi Martin, There are two issues I'm thinking about. The first is the generic unit testing and quality initiatives required to move rxtx forward. The second is the inevitable fact that rxtx connects to external hardware. The discussion deals with a different set of problems. Here is a simple example of what I'm getting at. We have the capability of setting custom baud rates in rxtx. We may be interested in seeing regressions in rxtx, the C library or the kernel. Some people may be doing some tests with loopback connections. These will always work even if the baud rate is not set to the expected value. Some people may use null modems between two ports. This may be able to catch the problem but not always. Will the build machines be able to test this? (no - for a few reasons) Will people be trying to catch these type of regressions? (yes) What type of coverage does the community have in the end? (?) We could include the discussions in the same list or another equally open list that may be of interest to some folks that deal with these types of problems on a regular basis. -- Trent Jarvi tjarvi at qbang.org From timlow84 at gmail.com Mon Nov 12 00:31:17 2007 From: timlow84 at gmail.com (Timothy Low) Date: Mon, 12 Nov 2007 15:31:17 +0800 Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> Message-ID: <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> ---------- Forwarded message ---------- From: Timothy Low Date: Nov 12, 2007 3:02 PM Subject: Building RXTX From Source To: taj at www.linux.org.uk Cc: ferdinand.tang at tangs.net, Timothy Low , chweehuat.ng at tangs.net Hi Trent, I tried building RXTX from source, and I got this error. I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm trying to get the necessary ".so" files to use for my serial port communication through java. My linux kernal information is: *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 x86_64 x86_64 x86_64 GNU/Linux* I'll most glad if you can provide me some direction on this. Thanks ! ---------------- [root at smsgateway rxtx-2.0-7pre1]# ./configure checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu configure: WARNING: Trying libtool. If the following fails install libtool checking for gcc... gcc checking for C compiler default output... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking for ld used by GCC... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking for a sed that does not truncate output... /bin/sed checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking command to parse /usr/bin/nm -B output... ok checking how to run the C preprocessor... gcc -E checking for egrep... grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for ranlib... ranlib checking for strip... strip checking for objdir... .libs checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.lo... yes checking if gcc supports -fno-rtti -fno-exceptions... yes checking whether the linker (/usr/bin/ld) supports shared libraries... yes checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking dynamic linker characteristics... GNU/Linux ld.so checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no checking whether -lc should be explicitly linked in... no creating libtool checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking for style of include used by make... GNU checking dependency style of gcc... none checking fcntl.h usability... yes checking fcntl.h presence... yes checking for fcntl.h... yes checking sys/fcntl.h usability... yes checking sys/fcntl.h presence... yes checking for sys/fcntl.h... yes checking sys/file.h usability... yes checking sys/file.h presence... yes checking for sys/file.h... yes checking sys/time.h usability... yes checking sys/time.h presence... yes checking for sys/time.h... yes checking sys/signal.h usability... yes checking sys/signal.h presence... yes checking for sys/signal.h... yes checking signal.h usability... yes checking signal.h presence... yes checking for signal.h.. . yes checking termios.h usability... yes checking termios.h presence... yes checking for termios.h... yes checking asm/termbits.h usability... yes checking asm/termbits.h presence... yes checking for asm/termbits.h... yes checking grp.h usability... yes checking grp.h presence... yes checking for grp.h... yes checking pwd.h usability... yes checking pwd.h presence... yes checking for pwd.h... yes checking whether gcc needs -traditional... no checking whether to enable maintainer-specific portions of Makefiles... no /usr/java/jdk1.5.0_13 configure: WARNING: using JAVA_HOME environmental variable adjusted java.home is /usr/java/jdk1.5.0_13 checking os.name Linux checking os.arch i386 checking java.vendor Sun Microsystems Inc. checking java.version 1.5.0_13 checking os.version 2.6.18-8.el5xen comm.jar appears to be installed already. conftest.c: In function 'main': conftest.c:6: warning: incompatible implicit declaration of built-in function 'printf' conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:6: error: (Each undeclared identifier is reported only once conftest.c:6: error: for each function it appears in.) conftest.c:6: error: expected ')' before string constant conftest.c:7: warning: incompatible implicit declaration of built-in function 'exit' ./configure: line 9649: ./conftest: No such file or directory ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected conftest.c: In function 'main': conftest.c:5: warning: incompatible implicit declaration of built-in function 'printf' conftest.c:10: warning: incompatible implicit declaration of built-in function 'exit' configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status : config.h is unchanged config.status: executing depfiles commands [root at smsgateway rxtx-2.0-7pre1]# make install /usr/java/jdk1.5.0_13/bin/javac -classpath .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d /home/jboss/sources/rxtx- 2.0-7pre1/ -O /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java /home/jboss/sources/rxtx-2.0-7pre1/./src/UnSupportedLoggerException.java /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o /home/jboss/sources/rxtx-2.0-7pre1/x86_64-unknown-linux-gnu/SerialImp.lo /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'init_threads': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: cast from pointer to integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_nativeDrain': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: cast to pointer from integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'read_byte_array': /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: cast to pointer from integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_readArray': /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: comparison is always false due to limited range of data type /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_readTerminatedArray': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: comparison is always false due to limited range of data type mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial- 2.0.7pre1.* gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so -o .libs/librxtxSerial-2.0.7pre1.so (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.0.7pre1.so librxtxSerial.so) creating librxtxSerial.la (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la librxtxSerial.la) gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/ParallelImp.lo /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function 'Java_javax_comm_LPRPort_readArray': /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: comparison is always false due to limited range of data type rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* .libs/librxtxParallel-2.0.7pre1.* gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so -o .libs/librxtxParallel- 2.0.7pre1.so (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.0.7pre1.so librxtxParallel.so) creating librxtxParallel.la (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la librxtxParallel.la) make all-am make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' libtool: install: `x86_64-unknown-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 ------------- Regards, Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071112/27758c3c/attachment-0016.html From tjarvi at qbang.org Mon Nov 12 01:02:09 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Nov 2007 01:02:09 -0700 (MST) Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> Message-ID: On Mon, 12 Nov 2007, Timothy Low wrote: > > Hi Trent, Hi Tim, Comments are inline. As I mentioned off the list, rxtx 2.0 is on the edge of deprecation. We can get it working but this is not the path of least resistance for future work. You will probably need to bounce another round of questions off the list. The following is intended to isolate the problem. > > I tried building RXTX from source, and I got this error. > > > I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm trying > to get the necessary ".so" files to use for my serial port communication > through java. > My linux kernal information is: > > *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 x86_64 > x86_64 x86_64 GNU/Linux* > > I'll most glad if you can provide me some direction on this. Thanks ! > > ---------------- > [root at smsgateway rxtx-2.0-7pre1]# ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > checking for C compiler default output... a.out > checking whether the C compiler works... yes > checking whether we are cross compiling... no > checking for suffix of executables... > checking for suffix of object files... o > checking whether we are using the GNU C compiler... yes > checking whether gcc accepts -g... yes > checking for gcc option to accept ANSI C... none needed > checking for ld used by GCC... /usr/bin/ld > checking if the linker (/usr/bin/ld) is GNU ld... yes > checking for /usr/bin/ld option to reload object files... -r > checking for BSD-compatible nm... /usr/bin/nm -B > checking for a sed that does not truncate output... /bin/sed > checking whether ln -s works... yes > checking how to recognise dependent libraries... pass_all > checking command to parse /usr/bin/nm -B output... ok > checking how to run the C preprocessor... gcc -E > checking for egrep... grep -E > checking for ANSI C header files... yes > checking for sys/types.h... yes > checking for sys/stat.h... yes > checking for stdlib.h... yes > checking for string.h... yes > checking for memory.h... yes > checking for strings.h... yes > checking for inttypes.h... yes > checking for stdint.h... yes > checking for unistd.h... yes > checking dlfcn.h usability... yes > checking dlfcn.h presence... yes > checking for dlfcn.h... yes > checking for ranlib... ranlib > checking for strip... strip > checking for objdir... .libs > checking for gcc option to produce PIC... -fPIC > checking if gcc PIC flag -fPIC works... yes > checking if gcc static flag -static works... yes > checking if gcc supports -c -o file.o... yes > checking if gcc supports -c -o file.lo... yes > checking if gcc supports -fno-rtti -fno-exceptions... yes > checking whether the linker (/usr/bin/ld) supports shared libraries... yes > checking how to hardcode library paths into programs... immediate > checking whether stripping libraries is possible... yes > checking dynamic linker characteristics... GNU/Linux ld.so > checking if libtool supports shared libraries... yes > checking whether to build shared libraries... yes > checking whether to build static libraries... no > checking whether -lc should be explicitly linked in... no > creating libtool > checking for a BSD-compatible install... /usr/bin/install -c > checking whether build environment is sane... yes > checking for gawk... gawk > checking whether make sets $(MAKE)... yes > checking for style of include used by make... GNU > checking dependency style of gcc... none > checking fcntl.h usability... yes > checking fcntl.h presence... yes > checking for fcntl.h... yes > checking sys/fcntl.h usability... yes > checking sys/fcntl.h presence... yes > checking for sys/fcntl.h... yes > checking sys/file.h usability... yes > checking sys/file.h presence... yes > checking for sys/file.h... yes > checking sys/time.h usability... yes > checking sys/time.h presence... yes > checking for sys/time.h... yes > checking sys/signal.h usability... yes > checking sys/signal.h presence... yes > checking for sys/signal.h... yes > checking signal.h usability... yes > checking signal.h presence... yes > checking for signal.h.. . yes > checking termios.h usability... yes > checking termios.h presence... yes > checking for termios.h... yes > checking asm/termbits.h usability... yes > checking asm/termbits.h presence... yes > checking for asm/termbits.h... yes > checking grp.h usability... yes > checking grp.h presence... yes > checking for grp.h... yes > checking pwd.h usability... yes > checking pwd.h presence... yes > checking for pwd.h... yes > checking whether gcc needs -traditional... no > checking whether to enable maintainer-specific portions of Makefiles... no > /usr/java/jdk1.5.0_13 > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /usr/java/jdk1.5.0_13 > checking os.name Linux > checking os.arch i386 > checking java.vendor Sun Microsystems Inc. > checking java.version 1.5.0_13 > checking os.version 2.6.18-8.el5xen > comm.jar appears to be installed already. > conftest.c: In function 'main': > conftest.c:6: warning: incompatible implicit declaration of built-in > function 'printf' > conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:6: error: (Each undeclared identifier is reported only once > conftest.c:6: error: for each function it appears in.) > conftest.c:6: error: expected ')' before string constant This is an outdated kernel version check for when headers and kernels could cause problems for rxtx. If we made it past this, then you are OK. > conftest.c:7: warning: incompatible implicit declaration of built-in > function 'exit' > ./configure: line 9649: ./conftest: No such file or directory > ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected It blew up but continues.. > conftest.c: In function 'main': > conftest.c:5: warning: incompatible implicit declaration of built-in > function 'printf' > conftest.c:10: warning: incompatible implicit declaration of built-in > function 'exit' > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status : config.h is unchanged > config.status: executing depfiles commands > [root at smsgateway rxtx-2.0-7pre1]# make install > /usr/java/jdk1.5.0_13/bin/javac -classpath > .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d > /home/jboss/sources/rxtx- 2.0-7pre1/ -O > /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java > /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/UnSupportedLoggerException.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java > Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or > overrides a deprecated API. > Note: Recompile with -Xlint:deprecation for details. > /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* The java jar should be fine now. You may need to change the source files as mentioned below. > gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. > -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g > -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o > /home/jboss/sources/rxtx-2.0-7pre1/x86_64-unknown-linux-gnu/SerialImp.lo > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'init_threads': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: cast > from pointer to integer of different size > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_nativeDrain': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: cast to > pointer from integer of different size > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'read_byte_array': > /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: cast to > pointer from integer of different size As I recall, this was caused by pointers (now 64 bit rather than 32 bit) being stored in java ints (jints). I would look at the diff between the CVS 2.1 SerialImp.c and RXTXPort.java files against 2.0. We did fix those issues. You have a .so file but the different pointer sizes will cause runtime errors. > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_readArray': > /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: > comparison is always false due to limited range of data type > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_readTerminatedArray': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: > comparison is always false due to limited range of data type > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial- > 2.0.7pre1.* > gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so -o > .libs/librxtxSerial-2.0.7pre1.so > (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.0.7pre1.so > librxtxSerial.so) > creating librxtxSerial.la > (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la > librxtxSerial.la) > gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. > -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g > -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o > /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/ParallelImp.lo > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function > 'Java_javax_comm_LPRPort_readArray': > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: > comparison is always false due to limited range of data type > rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* > .libs/librxtxParallel-2.0.7pre1.* > gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so -o > .libs/librxtxParallel- 2.0.7pre1.so > (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.0.7pre1.so > librxtxParallel.so) > creating librxtxParallel.la > (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la > librxtxParallel.la) > make all-am > make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' > make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' > libtool: install: `x86_64-unknown-linux-gnu' must be an absolute directory > name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 A libtool change? Assuming you ran configure && make install in /home/jboss/sources/rxtx- 2.0-7pre1, libtool is looking for /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/.libs/librxtxSerial-2.0.7pre1.so. I think you have this? The file is just being copied to ~JAVA/jre/lib/$(JAVA_ARCH). -- Trent Jarvi tjarvi at qbang.org From sarah_662005 at yahoo.com Mon Nov 12 16:10:28 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Mon, 12 Nov 2007 15:10:28 -0800 (PST) Subject: [Rxtx] [urgent] device's power off detection Message-ID: <766782.10076.qm@web55803.mail.re3.yahoo.com> Hello all, I have a small application built on top of rxtx api. This application can retrieve the incoming data from a device through a port. The device can be powered off after the port get closed from the application. I have been trying a couple of hours to find a way to detect the power switching from device. If anyone knows how to handle it through rxtx, could you please give me a help? Thank you very much. r, Sara ____________________________________________________________________________________ Get easy, one-click access to your favorites. Make Yahoo! your homepage. http://www.yahoo.com/r/hs -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071112/4599f3ec/attachment-0015.html From netbeans at gatworks.com Mon Nov 12 17:52:22 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 12 Nov 2007 19:52:22 -0500 Subject: [Rxtx] [urgent] device's power off detection In-Reply-To: <766782.10076.qm@web55803.mail.re3.yahoo.com> References: <766782.10076.qm@web55803.mail.re3.yahoo.com> Message-ID: <4738F546.5010101@gatworks.com> Not sure what u are asking for. Are u asking for a way to detect if the device is OFF? Are u asking how to power off the device - via software ? Is it a Serial device? is it a parallel device? is it a usb device? Sara Hugh wrote: > Hello all, > I have a small application built on top of rxtx api. This application > can retrieve the incoming data from a device through a port. The device > can be powered off after the port get closed from the application. I > have been trying a couple of hours to find a way to detect the power > switching from device. If anyone knows how to handle it through rxtx, > could you please give me a help? Thank you very much. From tjarvi at qbang.org Mon Nov 12 22:48:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Nov 2007 22:48:11 -0700 (MST) Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711120225x562db8cbxb750767ade3b0d73@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> <900c6ba90711120031p66edc001ted76f7ba24e34b98@mail.gmail.com> <900c6ba90711120225x562db8cbxb750767ade3b0d73@mail.gmail.com> Message-ID: Hi Tim, The gnu.io namespace looks just like the javax.comm 2.0 namespace. There are additional (discouraged) undocumented methods in gnu.io that you need not use. We just used the different namespace to avoid poluting Sun's by mistake and to make sure we stayed off any potential licensing related radar. Usuaully, you just change your imports and make sure you do not use the javax.comm namespace for anything like exception handling. As I mentioned off the list, there are no issues with rxtx going through the JSR process to be more Sun friendly other than time. rxtx has no hidden intentions there; anything that does not work like CommAPI 2.0 documented is a bug. The reason we do not support CommAPI 2.1 is technical in nature and is in the list archives as well as the front page of www.rxtx.org. On Mon, 12 Nov 2007, Timothy Low wrote: > Hi Trent, > > I'll move to use a JDK1.5 64-bit version... but do I need to make any source > code changes to use the package (gnu.io) in the RTXTcomm.jar instead of the > ones from the javacomm api ? > > > Regards, > Tim > > On Nov 12, 2007 5:22 PM, Trent Jarvi wrote: > >> >> Hi Tim, >> >> I see a couple things here. >> >> First your jdk is for i686 yet the library is compiled on a x86_64 >> machine. You may try passing configure the --target=i686-unknown-linux to >> try using the i686 backend to gcc if it is available. Or move to the 64 >> bit jdk. >> >> The other error I see is again the moved UTF_RELEASE define that we need >> to fix. You can probably get around that with: >> >> make -DUTF_RELEASE=`uname -r` >> >> even more simple would be to just specify the serial library which should >> be in configure --help. >> >> You can remove the UTF_RELEASE check from configure by editing >> configure.in, searching for the simple C program check and deleting it. >> Running autoconf after that will regenerate a new configure without the >> check. >> >> Note that you should remove the previous native libraries >> (librxtxSerial.so) when moving from rxtx 2.0 to 2.1. These are compiled >> for different namespaces (javax.comm/gnu.io). >> >> On Mon, 12 Nov 2007, Timothy Low wrote: >> >>> *Hi Trent, >>> >>> I moved on to rxtx 2.1.7r2, and updated my jre to 1.6.0 (64-bit)... I >> tried >>> the following 2 methods: >>> >>> (1) using the rxtx 2.1.7 binaries from the RXTX website* >>> *Are these binaries suitable for a 64-bit OS ? There mentioning of the >>> gnu.io that you've talked about previously...* >>> ------ >>> [root at smsgateway sources]# java -Djava.library.path=/usr/lib PortLister >>> Experimental: JNI_OnLoad called. >>> >>> java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion >>> ()Ljava/lang/String; >>> at gnu.io.RXTXCommDriver.nativeGetVersion(Native Method) >>> at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:85) >>> at java.lang.Class.forName0(Native Method) >>> at java.lang.Class.forName(Unknown Source) >>> at javax.comm.CommPortIdentifier.loadDriver( >> CommPortIdentifier.java >>> :237) >>> at javax.comm.CommPortIdentifier.(CommPortIdentifier.java >>> :109) >>> at PortLister.(PortLister.java:6) >>> at PortLister.main(PortLister.java:25) >>> Exception in thread "main" java.lang.UnsatisfiedLinkError: >>> com.sun.comm.SunrayInfo.isSessionActive()Z >>> at com.sun.comm.SunrayInfo.isSessionActive(Native Method) >>> at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java >> :155) >>> at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java >>> :100) >>> at javax.comm.CommPortIdentifier.(CommPortIdentifier.java >>> :138) >>> at PortLister.(PortLister.java:6) >>> at PortLister.main(PortLister.java:25) >>> >>> ------ >>> >>> (2) compiling the rxtx 2.1.7 from source >>> *but i got the following error while running ./configure and make all* >>> >>> ------ >>> [root at smsgateway rxtx-2.1-7r2]# ./configure >>> checking build system type... x86_64-unknown-linux-gnu >>> checking host system type... x86_64-unknown-linux-gnu >>> checking target system type... x86_64-unknown-linux-gnu >>> configure: WARNING: Trying libtool. If the following fails install >> libtool >>> checking for gcc... gcc >>> checking for C compiler default output file name... a.out >>> checking whether the C compiler works... yes >>> checking whether we are cross compiling... no >>> checking for suffix of executables... >>> checking for suffix of object files... o >>> checking whether we are using the GNU C compiler... yes >>> checking whether gcc accepts -g... yes >>> checking for gcc option to accept ANSI C... none needed >>> checking for a sed that does not truncate output... /bin/sed >>> checking for egrep... grep -E >>> checking for ld used by gcc... /usr/bin/ld >>> checking if the linker (/usr/bin/ld) is GNU ld... yes >>> checking for /usr/bin/ld option to reload object files... -r >>> checking for BSD-compatible nm... /usr/bin/nm -B >>> checking whether ln -s works... yes >>> checking how to recognise dependent libraries... pass_all >>> checking how to run the C preprocessor... gcc -E >>> checking for ANSI C header files... yes >>> checking for sys/types.h... yes >>> checking for sys/stat.h... yes >>> checking for stdlib.h... yes >>> checking for string.h... yes >>> checking for memory.h... yes >>> checking for strings.h... yes >>> checking for inttypes.h... yes >>> checking for stdint.h... yes >>> checking for unistd.h... yes >>> checking dlfcn.h usability... yes >>> checking dlfcn.h presence... yes >>> checking for dlfcn.h... yes >>> checking for g++... g++ >>> checking whether we are using the GNU C++ compiler... yes >>> checking whether g++ accepts -g... yes >>> checking how to run the C++ preprocessor... g++ -E >>> checking for g77... no >>> checking for f77... no >>> checking for xlf... no >>> checking for frt... no >>> checking for pgf77... no >>> checking for fort77... no >>> checking for fl32... no >>> checking for af77... no >>> checking for f90... no >>> checking for xlf90... no >>> checking for pgf90... no >>> checking for epcf90... no >>> checking for f95... f95 >>> checking whether we are using the GNU Fortran 77 compiler... yes >>> checking whether f95 accepts -g... yes >>> checking the maximum length of command line arguments... 32768 >>> checking command to parse /usr/bin/nm -B output from gcc object... ok >>> checking for objdir... .libs >>> checking for ar... ar >>> checking for ranlib... ranlib >>> checking for strip... strip >>> checking if gcc static flag works... yes >>> checking if gcc supports -fno-rtti -fno-exceptions... no >>> checking for gcc option to produce PIC... -fPIC >>> checking if gcc PIC flag -fPIC works... yes >>> checking if gcc supports -c -o file.o... yes >>> checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking whether -lc should be explicitly linked in... no >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> checking if libtool supports shared libraries... yes >>> checking whether to build shared libraries... yes >>> checking whether to build static libraries... no >>> configure: creating libtool >>> appending configuration tag "CXX" to libtool >>> checking for ld used by g++... /usr/bin/ld -m elf_x86_64 >>> checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes >>> checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking for g++ option to produce PIC... -fPIC >>> checking if g++ PIC flag -fPIC works... yes >>> checking if g++ supports -c -o file.o... yes >>> checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> appending configuration tag "F77" to libtool >>> checking if libtool supports shared libraries... yes >>> checking whether to build shared libraries... yes >>> checking whether to build static libraries... no >>> checking for f95 option to produce PIC... -fPIC >>> checking if f95 PIC flag -fPIC works... yes >>> checking if f95 supports -c -o file.o... yes >>> checking whether the f95 linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> checking for a BSD-compatible install... /usr/bin/install -c >>> checking whether build environment is sane... yes >>> checking for gawk... gawk >>> checking whether make sets $(MAKE)... yes >>> checking for style of include used by make... GNU >>> checking dependency style of gcc... none >>> checking dependency style of g++... none >>> checking fcntl.h usability... yes >>> checking fcntl.h presence... yes >>> checking for fcntl.h... yes >>> checking sys/fcntl.h usability... yes >>> checking sys/fcntl.h presence... yes >>> checking for sys/fcntl.h... yes >>> checking sys/file.h usability... yes >>> checking sys/file.h presence... yes >>> checking for sys/file.h... yes >>> checking sys/time.h usability... yes >>> checking sys/time.h presence... yes >>> checking for sys/time.h... yes >>> checking sys/signal.h usability... yes >>> checking sys/signal.h presence... yes >>> checking for sys/signal.h... yes >>> checking signal.h usability... yes >>> checking signal.h presence... yes >>> checking for signal.h... yes >>> checking termios.h usability... yes >>> checking termios.h presence... yes >>> checking for termios.h... yes >>> checking grp.h usability... yes >>> checking grp.h presence... yes >>> checking for grp.h... yes >>> checking pwd.h usability... yes >>> checking pwd.h presence... yes >>> checking for pwd.h... yes >>> checking whether gcc needs -traditional... no >>> checking whether to enable maintainer-specific portions of Makefiles... >> no >>> /usr/java/jdk1.5.0_13 >>> configure: WARNING: using JAVA_HOME environmental variable >>> adjusted java.home is /usr/java/jdk1.5.0_13 >>> checking os.name Linux >>> checking os.arch i386 >>> checking java.vendor Sun Microsystems Inc. >>> checking java.version 1.5.0_13 >>> checking os.version 2.6.18-8.el5xen >>> conftest.c: In function 'main': >>> conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this >> function) >>> conftest.c:8: error: (Each undeclared identifier is reported only once >>> conftest.c:8: error: for each function it appears in.) >>> conftest.c:8: error: expected ')' before string constant >>> ./configure: line 21462: ./conftest: No such file or directory >>> ./configure: line 21462: test: 2.6.18-8.el5xen: unary operator expected >>> configure: creating ./config.status >>> config.status: creating Makefile >>> config.status: creating config.h >>> config.status: executing depfiles commands >>> [root at smsgateway rxtx-2.1-7r2]# make install >>> /usr/java/jdk1.5.0_13/bin/javac -classpath .:/home/jboss/sources/rxtx- >>> >> 2.1-7r2:/home/jboss/sources/rxtx-2.1-7r2/src:/usr/java/jdk1.5.0_13/jre/lib/ext/RXTXcomm.jar-d >>> /home/jboss/sources/rxtx- >>> 2.1-7r2/ -O -source 1.3 -target 1.3 >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommDriver.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortEnumerator.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortIdentifier.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortOwnershipListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Configure.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2C.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/I2CPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/LPRPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/NoSuchPortException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/PortInUseException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Raw.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/RawPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RawPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RawPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/RS485PortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485PortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485Port.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXCommDriver.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXVersion.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPort.java >>> /home/jboss/sources/rxtx-2.1-7r2 >> /./src/UnsupportedCommOperationException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/UnSupportedLoggerException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Zystem.java >>> /usr/java/jdk1.5.0_13/bin/javah -classpath .:/home/jboss/sources/rxtx- >>> >> 2.1-7r2:/home/jboss/sources/rxtx-2.1-7r2/src:/usr/java/jdk1.5.0_13/jre/lib/ext/RXTXcomm.jar-d >>> x86_64-unknown-linux-gnu -jni `(for i in CommDriver CommPortEnumerator >>> CommPortIdentifier CommPort CommPortOwnershipListener Configure I2C >>> I2CPortEvent I2CPortEventListener I2CPort LPRPort NoSuchPortException >>> ParallelPortEvent ParallelPortEventListener ParallelPort >> PortInUseException >>> Raw RawPortEvent RawPortEventListener RawPort RS485 RS485PortEvent >>> RS485PortEventListener RS485Port RXTXCommDriver RXTXPort RXTXVersion >>> SerialPortEvent SerialPortEventListener SerialPort >>> UnsupportedCommOperationException UnSupportedLoggerException Zystem;do \ >>> if grep > /dev/null native.*\( /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/$i.java; then \ >>> echo gnu.io.$i; \ >>> fi; \ >>> done)` >>> /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialImp.c -o >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo; >>> \ >>> if [ "Serial" = "Serial" ]; >>> then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxSerial.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxSerial.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo; >> \ >>> fi; \ >>> ) >>> mkdir /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/.libs >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/SerialImp.o >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/fuserImp.o >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c: In function >> 'show_user': >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c:238: warning: cast >> from >>> pointer to integer of different size >>> gcc -shared /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/SerialImp.o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/fuserImp.o >>> -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7.so -o >> .libs/librxtxSerial- >>> 2.1-7.so >>> (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.1-7.so >>> librxtxSerial.so) >>> creating librxtxSerial.la >>> (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la >>> librxtxSerial.la) >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelImp.c -o >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/ParallelImp.lo; >>> \ >>> if [ "Parallel" = "Serial" ]; >>> then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxParallel.la -rpath >>> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/ParallelImp.lo >>> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxParallel.la -rpath >>> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/ParallelImp.lo; >>> \ >>> fi; \ >>> ) >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >>> /x86_64-unknown-linux-gnu/.libs/ParallelImp.o >>> gcc -shared /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/ParallelImp.o >>> -lpthread -Wl,-soname -Wl,librxtxParallel-2.1-7.so -o >>> .libs/librxtxParallel-2.1-7.so >>> (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.1-7.so >>> librxtxParallel.so) >>> creating librxtxParallel.la >>> (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la >>> librxtxParallel.la) >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo; >>> \ >>> if [ "I2C" = "Serial" ]; then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxI2C.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo >>> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxI2C.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo; >>> \ >>> fi; \ >>> ) >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/.libs/I2CImp.o >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c: In function >>> 'Java_gnu_io_I2CPort_Initialize': >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: 'UTS_RELEASE' >>> undeclared (first use in this function) >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: (Each >> undeclared >>> identifier is reported only once >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: for each >> function >>> it appears in.) >>> libtool: link: `/home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/I2CImp.lo' >>> is not a valid libtool object >>> make: *** [x86_64-unknown-linux-gnu/librxtxI2C.la] Error 1 >>> >>> ------ >>> >>> >>> >>> On Nov 12, 2007 4:02 PM, Trent Jarvi wrote: >>> >>>> On Mon, 12 Nov 2007, Timothy Low wrote: >>>>> >>>>> Hi Trent, >>>> >>>> Hi Tim, >>>> >>>> Comments are inline. As I mentioned off the list, rxtx 2.0 is on the >> edge >>>> of deprecation. We can get it working but this is not the path of >> least >>>> resistance for future work. >>>> >>>> You will probably need to bounce another round of questions off the >> list. >>>> The following is intended to isolate the problem. >>>> >>>>> >>>>> I tried building RXTX from source, and I got this error. >>>>> >>>>> >>>>> I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm >>>> trying >>>>> to get the necessary ".so" files to use for my serial port >> communication >>>>> through java. >>>>> My linux kernal information is: >>>>> >>>>> *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 >>>> x86_64 >>>>> x86_64 x86_64 GNU/Linux* >>>>> >>>>> I'll most glad if you can provide me some direction on this. Thanks ! >>>>> >>>>> ---------------- >>>>> [root at smsgateway rxtx-2.0-7pre1]# ./configure >>>>> checking build system type... x86_64-unknown-linux-gnu >>>>> checking host system type... x86_64-unknown-linux-gnu >>>>> checking target system type... x86_64-unknown-linux-gnu >>>>> configure: WARNING: Trying libtool. If the following fails install >>>> libtool >>>>> checking for gcc... gcc >>>>> checking for C compiler default output... a.out >>>>> checking whether the C compiler works... yes >>>>> checking whether we are cross compiling... no >>>>> checking for suffix of executables... >>>>> checking for suffix of object files... o >>>>> checking whether we are using the GNU C compiler... yes >>>>> checking whether gcc accepts -g... yes >>>>> checking for gcc option to accept ANSI C... none needed >>>>> checking for ld used by GCC... /usr/bin/ld >>>>> checking if the linker (/usr/bin/ld) is GNU ld... yes >>>>> checking for /usr/bin/ld option to reload object files... -r >>>>> checking for BSD-compatible nm... /usr/bin/nm -B >>>>> checking for a sed that does not truncate output... /bin/sed >>>>> checking whether ln -s works... yes >>>>> checking how to recognise dependent libraries... pass_all >>>>> checking command to parse /usr/bin/nm -B output... ok >>>>> checking how to run the C preprocessor... gcc -E >>>>> checking for egrep... grep -E >>>>> checking for ANSI C header files... yes >>>>> checking for sys/types.h... yes >>>>> checking for sys/stat.h... yes >>>>> checking for stdlib.h... yes >>>>> checking for string.h... yes >>>>> checking for memory.h... yes >>>>> checking for strings.h... yes >>>>> checking for inttypes.h... yes >>>>> checking for stdint.h... yes >>>>> checking for unistd.h... yes >>>>> checking dlfcn.h usability... yes >>>>> checking dlfcn.h presence... yes >>>>> checking for dlfcn.h... yes >>>>> checking for ranlib... ranlib >>>>> checking for strip... strip >>>>> checking for objdir... .libs >>>>> checking for gcc option to produce PIC... -fPIC >>>>> checking if gcc PIC flag -fPIC works... yes >>>>> checking if gcc static flag -static works... yes >>>>> checking if gcc supports -c -o file.o... yes >>>>> checking if gcc supports -c -o file.lo... yes >>>>> checking if gcc supports -fno-rtti -fno-exceptions... yes >>>>> checking whether the linker (/usr/bin/ld) supports shared libraries... >>>> yes >>>>> checking how to hardcode library paths into programs... immediate >>>>> checking whether stripping libraries is possible... yes >>>>> checking dynamic linker characteristics... GNU/Linux ld.so >>>>> checking if libtool supports shared libraries... yes >>>>> checking whether to build shared libraries... yes >>>>> checking whether to build static libraries... no >>>>> checking whether -lc should be explicitly linked in... no >>>>> creating libtool >>>>> checking for a BSD-compatible install... /usr/bin/install -c >>>>> checking whether build environment is sane... yes >>>>> checking for gawk... gawk >>>>> checking whether make sets $(MAKE)... yes >>>>> checking for style of include used by make... GNU >>>>> checking dependency style of gcc... none >>>>> checking fcntl.h usability... yes >>>>> checking fcntl.h presence... yes >>>>> checking for fcntl.h... yes >>>>> checking sys/fcntl.h usability... yes >>>>> checking sys/fcntl.h presence... yes >>>>> checking for sys/fcntl.h... yes >>>>> checking sys/file.h usability... yes >>>>> checking sys/file.h presence... yes >>>>> checking for sys/file.h... yes >>>>> checking sys/time.h usability... yes >>>>> checking sys/time.h presence... yes >>>>> checking for sys/time.h... yes >>>>> checking sys/signal.h usability... yes >>>>> checking sys/signal.h presence... yes >>>>> checking for sys/signal.h... yes >>>>> checking signal.h usability... yes >>>>> checking signal.h presence... yes >>>>> checking for signal.h.. . yes >>>>> checking termios.h usability... yes >>>>> checking termios.h presence... yes >>>>> checking for termios.h... yes >>>>> checking asm/termbits.h usability... yes >>>>> checking asm/termbits.h presence... yes >>>>> checking for asm/termbits.h... yes >>>>> checking grp.h usability... yes >>>>> checking grp.h presence... yes >>>>> checking for grp.h... yes >>>>> checking pwd.h usability... yes >>>>> checking pwd.h presence... yes >>>>> checking for pwd.h... yes >>>>> checking whether gcc needs -traditional... no >>>>> checking whether to enable maintainer-specific portions of >> Makefiles... >>>> no >>>>> /usr/java/jdk1.5.0_13 >>>>> configure: WARNING: using JAVA_HOME environmental variable >>>>> adjusted java.home is /usr/java/jdk1.5.0_13 >>>>> checking os.name Linux >>>>> checking os.arch i386 >>>>> checking java.vendor Sun Microsystems Inc. >>>>> checking java.version 1.5.0_13 >>>>> checking os.version 2.6.18-8.el5xen >>>>> comm.jar appears to be installed already. >>>>> conftest.c: In function 'main': >>>>> conftest.c:6: warning: incompatible implicit declaration of built-in >>>>> function 'printf' >>>>> conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this >>>> function) >>>>> conftest.c:6: error: (Each undeclared identifier is reported only once >>>>> conftest.c:6: error: for each function it appears in.) >>>>> conftest.c:6: error: expected ')' before string constant >>>> >>>> >>>> This is an outdated kernel version check for when headers and kernels >>>> could cause problems for rxtx. If we made it past this, then you are >> OK. >>>> >>>> >>>>> conftest.c:7: warning: incompatible implicit declaration of built-in >>>>> function 'exit' >>>>> ./configure: line 9649: ./conftest: No such file or directory >>>>> ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected >>>> >>>> It blew up but continues.. >>>> >>>>> conftest.c: In function 'main': >>>>> conftest.c:5: warning: incompatible implicit declaration of built-in >>>>> function 'printf' >>>>> conftest.c:10: warning: incompatible implicit declaration of built-in >>>>> function 'exit' >>>>> configure: creating ./config.status >>>>> config.status: creating Makefile >>>>> config.status: creating config.h >>>>> config.status : config.h is unchanged >>>>> config.status: executing depfiles commands >>>>> [root at smsgateway rxtx-2.0-7pre1]# make install >>>>> /usr/java/jdk1.5.0_13/bin/javac -classpath >>>>> .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/ -O >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1 >> /./src/UnSupportedLoggerException.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java >>>>> Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or >>>>> overrides a deprecated API. >>>>> Note: Recompile with -Xlint:deprecation for details. >>>>> /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* >>>> >>>> >>>> The java jar should be fine now. You may need to change the source >> files >>>> as mentioned below. >>>> >>>>> gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu >> -I. >>>>> -I/usr/java/jdk1.5.0_13/include >> -I/usr/java/jdk1.5.0_13/include/./linux/ >>>> -g >>>>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o >>>>> /home/jboss/sources/rxtx-2.0-7pre1 >> /x86_64-unknown-linux-gnu/SerialImp.lo >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'init_threads': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: >>>> cast >>>>> from pointer to integer of different size >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_nativeDrain': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: >>>> cast to >>>>> pointer from integer of different size >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'read_byte_array': >>>>> /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: >>>> cast to >>>>> pointer from integer of different size >>>> >>>> >>>> As I recall, this was caused by pointers (now 64 bit rather than 32 >> bit) >>>> being stored in java ints (jints). I would look at the diff between >> the >>>> CVS 2.1 SerialImp.c and RXTXPort.java files against 2.0. We >>>> did fix those issues. >>>> >>>> You have a .so file but the different pointer sizes will cause runtime >>>> errors. >>>> >>>> >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_readArray': >>>>> /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: >>>>> comparison is always false due to limited range of data type >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_readTerminatedArray': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: >>>>> comparison is always false due to limited range of data type >>>>> mkdir .libs >>>>> rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* >> .libs/librxtxSerial- >>>>> 2.0.7pre1.* >>>>> gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so-o >>>>> .libs/librxtxSerial-2.0.7pre1.so >>>>> (cd .libs && rm -f librxtxSerial.so && ln -s >> librxtxSerial-2.0.7pre1.so >>>>> librxtxSerial.so) >>>>> creating librxtxSerial.la >>>>> (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la >>>>> librxtxSerial.la) >>>>> gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu >> -I. >>>>> -I/usr/java/jdk1.5.0_13/include >> -I/usr/java/jdk1.5.0_13/include/./linux/ >>>> -g >>>>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o >>>>> /home/jboss/sources/rxtx- 2.0-7pre1 >>>> /x86_64-unknown-linux-gnu/ParallelImp.lo >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function >>>>> 'Java_javax_comm_LPRPort_readArray': >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: >>>>> comparison is always false due to limited range of data type >>>>> rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* >>>>> .libs/librxtxParallel-2.0.7pre1.* >>>>> gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so-o >>>>> .libs/librxtxParallel- 2.0.7pre1.so >>>>> (cd .libs && rm -f librxtxParallel.so && ln -s >>>> librxtxParallel-2.0.7pre1.so >>>>> librxtxParallel.so) >>>>> creating librxtxParallel.la >>>>> (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la >>>>> librxtxParallel.la) >>>>> make all-am >>>>> make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' >>>>> make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' >>>>> libtool: install: `x86_64-unknown-linux-gnu' must be an absolute >>>> directory >>>>> name >>>>> Try `libtool --help --mode=install' for more information. >>>>> make: *** [install] Error 1 >>>> >>>> A libtool change? Assuming you ran configure && make install in >>>> /home/jboss/sources/rxtx- 2.0-7pre1, libtool is looking for >>>> /home/jboss/sources/rxtx- >>>> 2.0-7pre1/x86_64-unknown-linux-gnu/.libs/librxtxSerial-2.0.7pre1.so. >>>> >>>> I think you have this? The file is just being copied to >>>> ~JAVA/jre/lib/$(JAVA_ARCH). >>>> >>>> -- >>>> Trent Jarvi >>>> tjarvi at qbang.org >>>> >>> >> > From guido.vogt at celsi.ch Tue Nov 13 00:28:01 2007 From: guido.vogt at celsi.ch (Guido Vogt) Date: Tue, 13 Nov 2007 08:28:01 +0100 Subject: [Rxtx] RTS Line can't be set Message-ID: <47395201.1050400@celsi.ch> I'm working on an Windows XP /SP2 System. Version of RXTX: 2.1.7. The serial line is connected to a modem. As I can see, the RTS-Line of the serial Port is inactive, when the port is opened (flowcontrol=none). Obviously, no data is coming from the modem. If I use the setRTS(true) command after open, the comport does not send out my data any more. This behaviour is regardless of flowcontrol. Anybody has an idea what do do? Thanks for help. From Martin.Oberhuber at windriver.com Tue Nov 13 08:58:23 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 13 Nov 2007 16:58:23 +0100 Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803880918@ism-mail03.corp.ad.wrs.com> Hi Trent, as said before, I like the idea of discussing such quality engineering issues, but why hide these away from the rest of the public? Anyways, if you do want to create a new mailing list for these kinds of things I'll happily subscribe. 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: Sunday, November 11, 2007 1:46 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: RE: [Rxtx] Quality Engineering with rxtx > > On Mon, 5 Nov 2007, Oberhuber, Martin wrote: > > > Hi Trent, > > > > are the interestes of hobbyists really so different > > from commercial ones? Both should be interested in > > high quality and innovation the like. > > > > I haven't seen too many Open Source projects from the > > "inside" but those that I have seen did not have > > separate mailing lists for quality/testing/qa > > versus innovation/development. > > > > What I have seen with the Open Source projects that > > one would call "successful" is a good deal of > > process around automated builds, automated unit > > tests, predictable release dates and milestones, > > and policies around commiting/contributing/reviewing > > changes. > > > > I think that all of these benefit commercial users > > and hobbyists the like. > > > > If you were just asking about who's interested in > > discussing changes to foster more quality, count > > me in. I'm just not sure whether discussing these > > on a separate mailing list or other channel is the > > right thing to do. > > > > Hi Martin, > > There are two issues I'm thinking about. The first is the > generic unit > testing and quality initiatives required to move rxtx > forward. The second > is the inevitable fact that rxtx connects to external hardware. The > discussion deals with a different set of problems. > > Here is a simple example of what I'm getting at. > > We have the capability of setting custom baud rates in rxtx. > We may be > interested in seeing regressions in rxtx, the C library or > the kernel. > Some people may be doing some tests with loopback > connections. These will > always work even if the baud rate is not set to the expected > value. Some > people may use null modems between two ports. This may be > able to catch > the problem but not always. > > Will the build machines be able to test this? (no - for a few reasons) > Will people be trying to catch these type of regressions? (yes) > What type of coverage does the community have in the end? (?) > > We could include the discussions in the same list or another > equally open > list that may be of interest to some folks that deal with > these types of > problems on a regular basis. > > -- > Trent Jarvi > tjarvi at qbang.org > From toupsz at cs.tamu.edu Tue Nov 13 10:33:03 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 13 Nov 2007 11:33:03 -0600 Subject: [Rxtx] [urgent] device's power off detection In-Reply-To: <4738F546.5010101@gatworks.com> References: <766782.10076.qm@web55803.mail.re3.yahoo.com> <4738F546.5010101@gatworks.com> Message-ID: Lacking any other specification on it...but can you set up the device to notify your software when it turns off? Send a message or somesuch? Maybe it can signal using RTS or DTR? -Zach On Nov 12, 2007 6:52 PM, U. George wrote: > Not sure what u are asking for. Are u asking for a way to detect if the > device is OFF? Are u asking how to power off the device - via software ? > Is it a Serial device? > is it a parallel device? > is it a usb device? > > Sara Hugh wrote: > > Hello all, > > I have a small application built on top of rxtx api. This application > > can retrieve the incoming data from a device through a port. The device > > can be powered off after the port get closed from the application. I > > have been trying a couple of hours to find a way to detect the power > > switching from device. If anyone knows how to handle it through rxtx, > > could you please give me a help? Thank you very much. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071113/e5859e4d/attachment-0014.html From tjarvi at qbang.org Tue Nov 13 20:02:03 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 13 Nov 2007 20:02:03 -0700 (MST) Subject: [Rxtx] #ifndef TIOCSERGETLSR In-Reply-To: <472E3AAF.7050709@gatworks.com> References: <472E3AAF.7050709@gatworks.com> Message-ID: On Sun, 4 Nov 2007, U. George wrote: > For Linux, it seems that you need the code for both *having* a > TIOCSERGETLSR, and *not having* a TIOCSERGETLSR. Maybe the ioctl exists > system wide, but not necessarily for the device driver itself ( always > returns -1 ) . > > Are there systems that have a *functioning* TIOCSERGETLSR for all their > devices? Then this would be the case where the "#ifndef TIOCSERGETLSR" > directive could be useful is eliminating the unnecessary code and tests. > > And for those systems that dont have a TIOCSERGETLSR, then the code for > TIOCSERGETLSR can be eliminated. > > It would be a simple case to have, as a foundation, all the code to > simulate the missing TIOCSERGETLSR ioctl. If the system does have the > ioctl, then that code can be ifdef'd in, and co-exist with the > functionality of the code that simulates the missing TIOCSERGETLSR ioctl. > Ah, there is the post. Sorry I was on vacation. Hi George, Yes there are systems that have functioning TIOCSERGETLSR for all of their devices. These are machines that just use traditional UARTs. If you mean operating systems, then probably not. Let me explain a bit about the history of those #ifdefs to help clear up a mess. RXTX aims to follow POSIX. TIOCSERGETLSR turns out to not be POSIX at all as I understand. It isn't in BSD, Solaris, AIX or HP-UX. It certainly provides access to important information. I assumed it was standard when I coded rxtx on a Linux system. Ya, laugh. Then I looked at Win32.. Oh you are still laughing? ..I could not navigate msft's web site at the time [still can't really find anything today]. So google pointed me to someones 'reverse documentation' of the w32 API and an example msft put together back in the win3.0 days. It was enough but maybe not 100% correct. They covered overlapped IO which was important for events in rxtx. Looking at Win32 and Linux, it made sense to implement TIOCSERGETLSR for win32 with the way rxtx works. That was how things matched up. But when I got feedback about other systems, it didn't match up. When people used multiport cards with money saving designs in Linux, it didn't match up. And today, there are drivers for unusual serial ports that don't match up. Now we have some ugly logic that mostly works for most serial ports. It isn't right though. The important aspect of TIOSERGETLSR is knowing when the output is really gone. But POSIX tcdrain tells us the same thing. So there is logic in the ifdefs to match that up as you suggest. Perhaps a more formal solution along those lines would be worth looking into. I would suggest the roles should be switched though. We should use POSIX calls on all systems and hide things that don't work on everything like we have with other undocumented calls. TIOSERGETLSR is nice and would be great if it was standard. It isn't as far as I can tell. In the end, many people write Java code because they want portability. The TIOSERGETLSR does not really fit. In someways, this is limiting to the least common denominator which is Solaris if you have seen it's serial kernel driver code. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 15 09:10:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 15 Nov 2007 17:10:59 +0100 Subject: [Rxtx] RXTX blocking on unconnected virtual port Message-ID: <460801A4097E3D4CA04CC64EE648584803919080@ism-mail03.corp.ad.wrs.com> Hello, we came across the following issue: * Set up a virtual serial port, e.g. with com0com: http://com0com.sourceforge.net/ * Connect RXTX to one end, e.g. cnc1a * Do not connect the other end, e.g. cnc1b * Have RXTX write data to the port --> Since the data is not being read, RXTX blocks - RXTXPort.SerialOutputStream.write increases the RXTXPort.IOLocked variable - it then calls the native writeByte or writeArray method (which blocks) closing the RXTXPort hangs for ever too: - RXTXPort.close() has a while( IOLocked > 0 ) {..Thread.sleep(500);...} which spins for ever ==> once the communication hangs, it cannot recover. Has anybody else seen such a problem before, or even got an idea how to solve it? When I connect Hyperterminal to the same half-open port, and type a character, it hangs for about 3 seconds but then times out and is available again. I guess that's what I'd like to see in RXTX as well, with a (configurable) timeout. Our big problem with the current situation is that once RXTX gets stuck, there is nothing at all we can do to make it go live again - that's why our original workaround of writing to the port in a background thread is not good enough. For more background information, the issue is being tracked in https://bugs.eclipse.org/bugs/show_bug.cgi?id=208185 Thanks for any hints or ideas, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Sun Nov 18 09:43:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 09:43:26 -0700 (MST) Subject: [Rxtx] PortInUseException - Cannot close and reopen serial port In-Reply-To: <460801A4097E3D4CA04CC64EE64858480351C711@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858480351C711@ism-mail03.corp.ad.wrs.com> Message-ID: These have been submitted to CVS and the bugzilla entries have been changed to reflect the changes. ChangeLog: find ports which were added after program startup on Mac OS X. Martin Oberhuber http://bugzilla.qbang.org/show_bug.cgi?id=48 Clean up CommPort Ownership code, avoid possible deadlocks, fix lost commport ownership events. http://bugzilla.qbang.org/show_bug.cgi?id=83 Martin Oberhuber On Wed, 24 Oct 2007, Oberhuber, Martin wrote: > 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) > > > > > > > > > > > > > > > From tjarvi at qbang.org Sun Nov 18 09:45:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 09:45:39 -0700 (MST) Subject: [Rxtx] PortInUseException - Cannot close and reopen serial port In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848020CAF26@ism-mail03.corp.ad.wrs.com> Message-ID: The current CVS code should have all the entries. With version information, I usually do not change the version until we tag and release a zip file. Any feedback would be appreciated. On Wed, 27 Jun 2007, Greg Johnson wrote: > 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) >> >> >> >> >> > From tjarvi at qbang.org Sun Nov 18 13:51:27 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 13:51:27 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs Message-ID: The following bugs have been closed and CVS updated as needed: CommPortIdentifier.getPortIdentifier throws NoSuchPortException http://bugzilla.qbang.org/show_bug.cgi?id=48 CommPortOwnership events not sent http://bugzilla.qbang.org/show_bug.cgi?id=83 JVM 1.6 builds http://bugzilla.qbang.org/show_bug.cgi?id=84 I'd like to give Martin Oberhuber CVS write access. He has been doing a great job of pushing safe patches into rxtx. I'll be preparing seperate patches for the changes I have and submitting them to the list. I'll need to work with George to do a couple things: 1) break the patch into smaller pieces to isolate issues for discussion. 2) work through the Line Status Register changes so it does not cause problems on other systems. George: If you could do the first one, it would be greatly appreciated. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Nov 18 15:33:36 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 15:33:36 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: Message-ID: I'm not running any tests at this point, I'm trying to apply the small safe patches and make sure everything is compiling. As mentioned at the bottom, there are 3 patches + the USB fix posted here that need more review before accepting. The following bugs have been closed and CVS updated as needed. Most of these are already in CVS. The diff will be small. configure script failed at line UTS_RELEASE megov http://bugzilla.qbang.org/show_bug.cgi?id=80 code cleanup patch (extra ';' creates bug for if statements + new String() calls removed) Xavier Le Vourch http://bugzilla.qbang.org/show_bug.cgi?id=77 Wont compile on linux ppc with glibc 2.5 - no sys/io.h Brian Johnson http://bugzilla.qbang.org/show_bug.cgi?id=72 rxtx overwrites System properties Andrew Gillett Nektarios K. Papadopoulos Neboj??a http://bugzilla.qbang.org/show_bug.cgi?id=64 Solaris ACM port support Dave Cleal http://bugzilla.qbang.org/show_bug.cgi?id=59 Setting of non-standard baud rate fails. Andrew Prunicki http://bugzilla.qbang.org/show_bug.cgi?id=58 RXTX uses lockfiles on MacOS X (instead of ioctl TIOCEXCL) Joachim Buechse http://bugzilla.qbang.org/show_bug.cgi?id=50 JavaDoc fixes Joachim Buechse http://bugzilla.qbang.org/show_bug.cgi?id=49 I need to further review the following: http://bugzilla.qbang.org/show_bug.cgi?id=53 http://bugzilla.qbang.org/show_bug.cgi?id=46 http://bugzilla.qbang.org/show_bug.cgi?id=41 On Sun, 18 Nov 2007, Trent Jarvi wrote: > > The following bugs have been closed and CVS updated as needed: > > CommPortIdentifier.getPortIdentifier throws NoSuchPortException > http://bugzilla.qbang.org/show_bug.cgi?id=48 > CommPortOwnership events not sent > http://bugzilla.qbang.org/show_bug.cgi?id=83 > JVM 1.6 builds > http://bugzilla.qbang.org/show_bug.cgi?id=84 > > I'd like to give Martin Oberhuber CVS write access. He has been doing a > great job of pushing safe patches into rxtx. > > I'll be preparing seperate patches for the changes I have and submitting > them to the list. > > I'll need to work with George to do a couple things: > > 1) break the patch into smaller pieces to isolate issues for discussion. > 2) work through the Line Status Register changes so it does not cause > problems on other systems. > > George: If you could do the first one, it would be greatly appreciated. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From netbeans at gatworks.com Sun Nov 18 16:20:02 2007 From: netbeans at gatworks.com (U. George) Date: Sun, 18 Nov 2007 18:20:02 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: Message-ID: <4740C8A2.6030908@gatworks.com> > I'll need to work with George to do a couple things: > > 1) break the patch into smaller pieces to isolate issues for discussion. > 2) work through the Line Status Register changes so it does not cause > problems on other systems. > > George: If you could do the first one, it would be greatly appreciated. there are ( probably ) 3 pieces: 1) the select() failure when the USB-serial device is unceremoniously unplugged ( causes rxtx to spin ) 2) TIOCSERGETLSR, need to have the simulation of it available for all os's . If the system has the capability, don't simulate for devices that have the capability. For devices that dont have the capability, but the OS still defines TIOCSERGETLSR, fall back to simulation. 3) I rearranged DEBUG ifdef's. This is probably the bulk of the patches. From tjarvi at qbang.org Sun Nov 18 18:26:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 18:26:26 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <4740C8A2.6030908@gatworks.com> References: <4740C8A2.6030908@gatworks.com> Message-ID: On Sun, 18 Nov 2007, U. George wrote: > >> I'll need to work with George to do a couple things: >> >> 1) break the patch into smaller pieces to isolate issues for discussion. >> 2) work through the Line Status Register changes so it does not cause >> problems on other systems. >> >> George: If you could do the first one, it would be greatly appreciated. > > there are ( probably ) 3 pieces: > 1) the select() failure when the USB-serial device is unceremoniously > unplugged ( causes rxtx to spin ) > 2) TIOCSERGETLSR, need to have the simulation of it available for all os's . > If the system has the capability, don't simulate for devices that have the > capability. For devices that dont have the capability, but the OS still > defines TIOCSERGETLSR, fall back to simulation. > 3) I rearranged DEBUG ifdef's. This is probably the bulk of the patches. > Hi George, I suspect if you do cvs update, there will be very few conflicts if any. While the list of fixes is fairly long, the changes are small. -- Trent Jarvi tjarvi at qbang.org From EdwardRF at xtremax.com Mon Nov 19 03:32:29 2007 From: EdwardRF at xtremax.com (Edward) Date: Mon, 19 Nov 2007 18:32:29 +0800 Subject: [Rxtx] Cannot Read under Windows XP Message-ID: <4741663D.4070200@xtremax.com> Hi Guys, I have a iTegno 3000 usb GSM modem, it is an usb-serial device. I am trying to use RXTX with it under Windows XP. The problem is it seems RXTX cannot read any data from it, but writing to it seems successful. I blindly issue a series of command to send off a SMS, it is successfully delivered, but neither the echo from the modem nor the "OK" response was received. I tried to connect to the modem directly using hyper terminal, there was no problem reading or writing. So can i assume it is not the driver problem? Then i turned to Serial Port Monitor for help, when I use hyper terminal, monitor shows both way traffic, and nothing abnormal, but when I connect using RXTX, only the data I sent to the modem is being detected, no input was detected. Does anyone else experience similar problem? Best Regards Edward From tjarvi at qbang.org Mon Nov 19 03:38:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Nov 2007 03:38:02 -0700 (MST) Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: <4741663D.4070200@xtremax.com> References: <4741663D.4070200@xtremax.com> Message-ID: On Mon, 19 Nov 2007, Edward wrote: > Hi Guys, > > I have a iTegno 3000 usb GSM modem, it is an usb-serial device. I am > trying to use RXTX with it under Windows XP. > The problem is it seems RXTX cannot read any data from it, but writing > to it seems successful. I blindly issue a series of command to send off > a SMS, it is successfully delivered, but neither the echo from the modem > nor the "OK" response was received. > > I tried to connect to the modem directly using hyper terminal, there was > no problem reading or writing. So can i assume it is not the driver problem? > > Then i turned to Serial Port Monitor for help, when I use hyper > terminal, monitor shows both way traffic, and nothing abnormal, but when > I connect using RXTX, only the data I sent to the modem is being > detected, no input was detected. > > Does anyone else experience similar problem? > Hi Edward, A common mistake is to send Strings to the modem which are i18n. You want to send the bytes. Examples of doing this are in the contrib directory with the sourcecode. ie SimpleSnuV1.java -- Trent Jarvi tjarvi at qbang.org From EdwardRF at xtremax.com Mon Nov 19 04:42:16 2007 From: EdwardRF at xtremax.com (Edward) Date: Mon, 19 Nov 2007 19:42:16 +0800 Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: References: <4741663D.4070200@xtremax.com> Message-ID: <47417698.3060705@xtremax.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071119/b0f08ba9/attachment-0009.html From netbeans at gatworks.com Mon Nov 19 06:31:30 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 19 Nov 2007 08:31:30 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: <4740C8A2.6030908@gatworks.com> Message-ID: <47419032.8080406@gatworks.com> Did the "make install". The install does not want to go to or use Makefiles's prefix = /usr/local/rxtx-devel Not terribly happy that it installed in /home/gat/JAVA/JDK14/j2sdk1.4.2_08/jre/lib/i386 Trent Jarvi wrote: > > I suspect if you do cvs update, there will be very few conflicts if any. > While the list of fixes is fairly long, the changes are small. > > -- > Trent Jarvi > tjarvi at qbang.org > > From Martin.Oberhuber at windriver.com Mon Nov 19 07:00:48 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 19 Nov 2007 15:00:48 +0100 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE6485848039986E6@ism-mail03.corp.ad.wrs.com> It's great to see things progressing - thanks Trent! I checked CVS, and it seems that most of the patch authors are yet missing from the AUTHORS file, is this intentional? The issues areound RXTXPort.close() are interesting for us in the context of Eclipse as well: https://bugs.eclipse.org/bugs/show_bug.cgi?id=208185#c3 I did a quick review and found some issues / comments: http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 http://bugzilla.qbang.org/show_bug.cgi?id=53#c9 Thanks for proposing CVS write access for me. I promise to use these thoughtfully, and discuss potential fixes openly (on bugzilla) before applying them [unless it's really trivial issues only like obvious Javadoc syntax or spelling errors]. Cheers, -- 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 Mon Nov 19 07:24:16 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 19 Nov 2007 15:24:16 +0100 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803998711@ism-mail03.corp.ad.wrs.com> Hi all, I think I've got a better version for RXTXCommDriver.checkSolaris(): http://bugzilla.qbang.org/show_bug.cgi?id=77#c3 Cheers, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From netbeans at gatworks.com Mon Nov 19 09:01:22 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 19 Nov 2007 11:01:22 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <47419032.8080406@gatworks.com> References: <4740C8A2.6030908@gatworks.com> <47419032.8080406@gatworks.com> Message-ID: <4741B352.8070205@gatworks.com> U. George wrote: > Did the "make install". The install does not want to go to or use > Makefiles's prefix = /usr/local/rxtx-devel > > Not terribly happy that it installed in > /home/gat/JAVA/JDK14/j2sdk1.4.2_08/jre/lib/i386 > Put libs and jar in MY preferential places. Ran application. And it loves to spin. Deja gnu all over again. :-/ It did find the avail /dev/ttyUSB0 port connected to LINUX usbserial/pl2303 device driver. Now to find the spin. and apply simpler set of patches From tjarvi at qbang.org Mon Nov 19 10:14:38 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Nov 2007 10:14:38 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <4741B352.8070205@gatworks.com> References: <4740C8A2.6030908@gatworks.com> <47419032.8080406@gatworks.com> <4741B352.8070205@gatworks.com> Message-ID: On Mon, 19 Nov 2007, U. George wrote: > U. George wrote: >> Did the "make install". The install does not want to go to or use >> Makefiles's prefix = /usr/local/rxtx-devel >> >> Not terribly happy that it installed in >> /home/gat/JAVA/JDK14/j2sdk1.4.2_08/jre/lib/i386 >> > Put libs and jar in MY preferential places. Ran application. And it loves to > spin. Deja gnu all over again. :-/ > > It did find the avail /dev/ttyUSB0 port connected to LINUX usbserial/pl2303 > device driver. > > Now to find the spin. and apply simpler set of patches > Hi George, When the prefix code was stomped on and the library was installed in the jre, It wasnt clear how the layout would end up looking. I'm still not sure. My usual attack was to dump a jdk onto the filesystem, set JAVA_HOME and install. When I was done, I would nuke the jdk. Obviously that may not be what people want but I'm not sure a prefix is enough to let us know what they do want. For a shared library prefix /usr/local means the library goes in /usr/local/lib. What would it mean for the jar and shared library in Java? -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Nov 19 10:24:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Nov 2007 10:24:08 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <460801A4097E3D4CA04CC64EE6485848039986E6@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848039986E6@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 19 Nov 2007, Oberhuber, Martin wrote: > > I checked CVS, and it seems that most of the patch > authors are yet missing from the AUTHORS file, > is this intentional? > There isn't a hard rule covering who goes into AUTHORS. If I recognize a person from previous patches, I try to make sure they are in. Everyone contributing (authors) is in the ChangeLog with what they did going all the way back to the first release. AUTHORS is more of a summary of what they did after a few submissions. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Nov 19 11:39:51 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 19 Nov 2007 13:39:51 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: <4740C8A2.6030908@gatworks.com> <47419032.8080406@gatworks.com> <4741B352.8070205@gatworks.com> Message-ID: <4741D877.80203@gatworks.com> For me, the makefile/prefix = /usr/local sorta suggest thats where the libs/bins/jars/... should eventually wind up. If a user does not like /usr/local, then a quick change would put it somewhere else. At this moment I dont care where the jar winds up ( in lib, or a jar directory ). So I like to keep the jre/sdk directory protected from meddling, and changes. But if a user has a penchant to use 'java -jar', then the RXTXcomm.jar file should be stuffed with the other jre/sdk jar files. From ajmas at sympatico.ca Mon Nov 19 11:54:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 19 Nov 2007 13:54:29 -0500 Subject: [Rxtx] CVS updates and closed bugs Message-ID: <20071119185429.SPYK18413.tomts22-srv.bellnexxia.net@smtp1.sympatico.ca> On this day in November "U. George" wrote: > > For me, the makefile/prefix = /usr/local sorta suggest thats where the > libs/bins/jars/... should eventually wind up. > If a user does not like /usr/local, then a quick change would put it > somewhere else. At this moment I dont care where the jar winds up ( in > lib, or a jar directory ). > So I like to keep the jre/sdk directory protected from meddling, and > changes. > But if a user has a penchant to use 'java -jar', then the RXTXcomm.jar > file should be stuffed with the other jre/sdk jar files. It should be noted that some platforms, such as MacOS X might have different conventions. In the case of MacOS X there are two 'correct' places for Java libraries that aren't part of an application: - /Library/Java/Extensions/ - ~/Library/Java/Extensions/ Andre From ajmas at sympatico.ca Mon Nov 19 18:15:37 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 19 Nov 2007 20:15:37 -0500 Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: <47417698.3060705@xtremax.com> References: <4741663D.4070200@xtremax.com> <47417698.3060705@xtremax.com> Message-ID: <3D24B671-06CA-4709-AE3C-BCDB542F427F@sympatico.ca> On 19-Nov-07, at 06:42 , Edward wrote: > Hi Trent, > > First of all, I did sent them as bytes, eg, > > output.write("at\r\n".getBytes()); > > And if writing is every the problem, it wouldn't be able to explain > why i could send out a sms successfully using RXTX. > If you have the section of code that does the communicating, could you share it with us? This should help us tell whether it is a coding issue or something more fundamental with RXTX. Andre From EdwardRF at xtremax.com Mon Nov 19 19:39:36 2007 From: EdwardRF at xtremax.com (EdwardRF) Date: Tue, 20 Nov 2007 10:39:36 +0800 Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: <3D24B671-06CA-4709-AE3C-BCDB542F427F@sympatico.ca> References: <4741663D.4070200@xtremax.com> <47417698.3060705@xtremax.com> <3D24B671-06CA-4709-AE3C-BCDB542F427F@sympatico.ca> Message-ID: <474248E8.7070002@xtremax.com> Hi Guys, Thanks for the help, i've finally found out the problem. It was a flow control issue, i did not set the flow control properly. Btw, what is the default flow control behavior for rxtx2.1.7? was it the same as 2.0? Because i remember i did not need to set the flow control when I use rxtx 2.0 2 years back. Best Regards Edward Andre-John Mas wrote: > > On 19-Nov-07, at 06:42 , Edward wrote: > >> Hi Trent, >> >> First of all, I did sent them as bytes, eg, >> >> output.write("at\r\n".getBytes()); >> >> And if writing is every the problem, it wouldn't be able to explain >> why i could send out a sms successfully using RXTX. >> > > If you have the section of code that does the communicating, could you > share it with us? This should help us tell whether it is a coding > issue or something more fundamental with RXTX. > > Andre > From netbeans at gatworks.com Tue Nov 20 06:23:26 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 20 Nov 2007 08:23:26 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: <4740C8A2.6030908@gatworks.com> Message-ID: <4742DFCE.5070504@gatworks.com> Here is the small subset of diffs just for TIOCSERGETLSR :) Next I'll pull out the usb device, and see if that also causes rxtx to spin. >> 2) TIOCSERGETLSR, need to have the simulation of it available for all >> os's . If the system has the capability, don't simulate for devices >> that have the capability. For devices that dont have the capability, >> but the OS still defines TIOCSERGETLSR, fall back to simulation. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: a Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20071120/2c5c8ee7/attachment-0006.pl From tjarvi at qbang.org Tue Nov 20 08:20:21 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Nov 2007 08:20:21 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <4742DFCE.5070504@gatworks.com> References: <4740C8A2.6030908@gatworks.com> <4742DFCE.5070504@gatworks.com> Message-ID: On Tue, 20 Nov 2007, U. George wrote: > Here is the small subset of diffs just for TIOCSERGETLSR :) > > Next I'll pull out the usb device, and see if that also causes rxtx to spin. > >>> 2) TIOCSERGETLSR, need to have the simulation of it available for all os's >>> . If the system has the capability, don't simulate for devices that have >>> the capability. For devices that dont have the capability, but the OS >>> still defines TIOCSERGETLSR, fall back to simulation. > Hi George, I'll be looking through this patch in detail tonight. I just wanted to make sure you are aware of this line in win32termios.h. The ifdef logic is messy as you noticed. That is combined with the later addition of support for it to windows. #define TIOCSERGETLSR 0x5459 (this is by far the strangest code in rxtx in retrospect) I'll be able to do extensive automated testing once we get to that point. I'm confident we can get something in that has a low probability of causing regressions. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Tue Nov 20 08:42:08 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 20 Nov 2007 10:42:08 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: <4740C8A2.6030908@gatworks.com> <4742DFCE.5070504@gatworks.com> Message-ID: <47430050.1010203@gatworks.com> It is of no difference. 1) If the define does not exist, then it should be as before. 2) If it does exist, then it should also be as before. 3) If it does exist, but the ioctl fails, then it will fallback as if it did not exist in the first place. Trent Jarvi wrote: > On Tue, 20 Nov 2007, U. George wrote: > >> Here is the small subset of diffs just for TIOCSERGETLSR :) >> >> Next I'll pull out the usb device, and see if that also causes rxtx to >> spin. >> >>>> 2) TIOCSERGETLSR, need to have the simulation of it available for >>>> all os's . If the system has the capability, don't simulate for >>>> devices that have the capability. For devices that dont have the >>>> capability, but the OS still defines TIOCSERGETLSR, fall back to >>>> simulation. >> > > Hi George, > > I'll be looking through this patch in detail tonight. I just wanted to > make sure you are aware of this line in win32termios.h. The ifdef logic > is messy as you noticed. That is combined with the later addition of > support for it to windows. > > #define TIOCSERGETLSR 0x5459 > > (this is by far the strangest code in rxtx in retrospect) > > I'll be able to do extensive automated testing once we get to that > point. I'm confident we can get something in that has a low probability > of causing regressions. > > -- > Trent Jarvi > tjarvi at qbang.org > > From netbeans at gatworks.com Tue Nov 20 08:36:56 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 20 Nov 2007 10:36:56 -0500 Subject: [Rxtx] Unplugged Opened USB devices In-Reply-To: <4742DFCE.5070504@gatworks.com> References: <4740C8A2.6030908@gatworks.com> <4742DFCE.5070504@gatworks.com> Message-ID: <4742FF18.3050005@gatworks.com> > Next I'll pull out the usb device, and see if that also causes rxtx to > spin. This is the error on a read. The select() should have failed, as well as the read(). java.io.IOException: Input/output error in nativeavailable at gnu.io.RXTXPort.nativeavailable(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1420) at jGPS.GpsData.DeviceDrivers.SerialPort.SerialPort_NMEA_GNU.serialEvent (SerialPort_NMEA_GNU.java:449) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:771) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1622) But for java program, it sees( when USB device is unplugged ) : 1) event: SerialPortEvent.DATA_AVAILABLE 2) read (non-existant) data. I think that its bad form to say DATA_AVAILABLE, when there is no data to be obtained. There does not seem to be an I/O error event. So basically, I think, and IMHO, that no events should be sent. Rather a thread timeout ( ie no data in X seconds ) AND recovery from user code should be instantiated. From manujnaman at yahoo.com Wed Nov 21 12:35:46 2007 From: manujnaman at yahoo.com (manuj naman) Date: Wed, 21 Nov 2007 11:35:46 -0800 (PST) Subject: [Rxtx] Problem reading 1-wire device using RXTX on Linux Message-ID: <371969.66249.qm@web37911.mail.mud.yahoo.com> Hello, I am trying to use the RXTX library on Ubuntu (Debian) linux to read iButtons. It works perfectly on Windows. However on my linux machines it gives the following errors. I am using DS9490 (USB port adapter) to read the iButtons. I have followed your instructions on the Wiki. I recompiled the rxtx library to produce the .so and .jar files. But still it gives me this: manujnaman at sensor:~/iButton/onewireviewer$ java -cp $CLASSPATH:./OneWireAPI.jar:./OneWireViewer.jar OneWireViewer Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Warning: serial communications API not setup properly, no ports in enumeration Pure-Java DS9097U adapter will not work, not added to adapter enum Standard drivers for 1-Wire are not found. Please download the latest drivers from http://www.ibutton.com Or install RXTX Serial Communications API from http://www.rxtx.org Do you know how to solve the "Serial communications API not setup properly, no ports in enumeration" problem? Also, how to detect which what /dev/* is the port to be used? On Windows this is simply USB1, on linux this is a bit unclear. Many thanks for your advice, Manuj Naman Dallas, TX, US manujnaman at yahoo.com --------------------------------- Be a better pen pal. Text or chat with friends inside Yahoo! Mail. See how. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071121/2760f691/attachment-0005.html From Martin.Oberhuber at windriver.com Wed Nov 21 13:55:25 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 21 Nov 2007 21:55:25 +0100 Subject: [Rxtx] Should RXTX Lixense link to LGPL-2.1 be changed? In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803A21160@ism-mail03.corp.ad.wrs.com> Hi Trent and all, In all the RXTX source files as well as http://users.frii.com/jarvi/rxtx/license.html there is the following lines: | A copy of the LGPL v 2.1 may be found at | http://www.gnu.org/licenses/lgpl.txt on March 4th 2007. A copy is | here for your convenience. But, as of today, at the link provided there is only a copy of the LGPL v3.0. I think there should be a link to the LGPL v2.1, e.g. http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html What do you think? Cheers, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Nov 21 20:46:18 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Nov 2007 20:46:18 -0700 (MST) Subject: [Rxtx] Problem reading 1-wire device using RXTX on Linux In-Reply-To: <371969.66249.qm@web37911.mail.mud.yahoo.com> References: <371969.66249.qm@web37911.mail.mud.yahoo.com> Message-ID: On Wed, 21 Nov 2007, manuj naman wrote: > Hello, > > I am trying to use the RXTX library on Ubuntu (Debian) linux to read iButtons. It works perfectly on Windows. However on my linux machines it gives the following errors. I am using DS9490 (USB port adapter) to read the iButtons. > > I have followed your instructions on the Wiki. I recompiled the rxtx library to produce the .so and .jar files. But still it gives me this: > > manujnaman at sensor:~/iButton/onewireviewer$ java -cp $CLASSPATH:./OneWireAPI.jar:./OneWireViewer.jar OneWireViewer > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > Warning: serial communications API not setup properly, no ports in enumeration > Pure-Java DS9097U adapter will not work, not added to adapter enum > > Standard drivers for 1-Wire are not found. > Please download the latest drivers from http://www.ibutton.com > Or install RXTX Serial Communications API from http://www.rxtx.org > > Do you know how to solve the "Serial communications API not setup properly, no ports in enumeration" problem? > > Also, how to detect which what /dev/* is the port to be used? On Windows this is simply USB1, on linux this is a bit unclear. Hi Manuj What is the output of the following? dmesg |grep tty touch /var/lock/test.lock && rm -f /var/lock/test.lock If you see something like /dev/ttyUSB0 in the dmesg output, what happens if you do something like tail -f /dev/ttyUSB0? These test each of the usual suspects. We are looking for missing USB drivers, no permission to create a lockfile and no read permission for the device. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Nov 21 21:05:23 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Nov 2007 21:05:23 -0700 (MST) Subject: [Rxtx] Should RXTX Lixense link to LGPL-2.1 be changed? In-Reply-To: <460801A4097E3D4CA04CC64EE648584803A21160@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803A21160@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 21 Nov 2007, Oberhuber, Martin wrote: > Hi Trent and all, > > In all the RXTX source files as well as > http://users.frii.com/jarvi/rxtx/license.html > there is the following lines: > > | A copy of the LGPL v 2.1 may be found at > | http://www.gnu.org/licenses/lgpl.txt on March 4th 2007. A copy is > | here for your convenience. > > But, as of today, at the link provided there is only > a copy of the LGPL v3.0. I think there should be a link > to the LGPL v2.1, e.g. > http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html > > What do you think? > Hi Martin, Thanks. I updated the link. Changing licences is a heavy process for me as a free software developer and an employee so I'd rather stay with 2.1 unless the current license becomes a show stopper. I figured that would happen someday so I put the date in to be clear. -- Trent Jarvi tjarvi at qbang.org From beat.arnet at gmail.com Thu Nov 22 08:45:45 2007 From: beat.arnet at gmail.com (Beat Arnet) Date: Thu, 22 Nov 2007 10:45:45 -0500 Subject: [Rxtx] Dual Core Problem Message-ID: <4745A429.9060604@gmail.com> Dear All, I am struggling with an application that uses RXTX 2.1.7 and has been working reliably in the past. When this program runs on a dual-core DELL (Intel T2500), strange things happen with the RS232 communication. The application is missing incoming characters and also often freezes when trying to close the serial port. I highly suspect a threading problem and was wondering if a) anybody had run into a similar problem with dual core processors and b) if there is a list of does and dont's when it comes to RXTX and threads. Regards, Beat From tjarvi at qbang.org Thu Nov 22 13:22:43 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 22 Nov 2007 13:22:43 -0700 (MST) Subject: [Rxtx] Dual Core Problem In-Reply-To: <4745A429.9060604@gmail.com> References: <4745A429.9060604@gmail.com> Message-ID: On Thu, 22 Nov 2007, Beat Arnet wrote: > Dear All, > I am struggling with an application that uses RXTX 2.1.7 and has been > working reliably in the past. When this program runs on a dual-core DELL > (Intel T2500), strange things happen with the RS232 communication. The > application is missing incoming characters and also often freezes when > trying to close the serial port. I highly suspect a threading problem > and was wondering if a) anybody had run into a similar problem with dual > core processors and b) if there is a list of does and dont's when it > comes to RXTX and threads. > I've used rxtx with SMP systems but have not experimented very much with threading and rxtx. One red flag rxtx raises is it stores pointers to java objects in SerialImp.c. If the JVM decides to move things around, rxtx becomes confused. Missing incomming characters is usually caused by someone running two applications. They then fight over the incomming data. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Fri Nov 23 03:12:28 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 23 Nov 2007 11:12:28 +0100 Subject: [Rxtx] Dual Core Problem In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803A84C59@ism-mail03.corp.ad.wrs.com> > Missing incomming characters is usually caused by someone running two > applications. They then fight over the incomming data. I've seen exactly this scenario on Linux with Lockfiles disabled. Usually, port locking (through Lockfiles or Ioctl method) should avoid exactly this problem. I know that on Mac, port locking through Kernel/Ioctl method has been added for the upcoming RXTX 2.1-8. What's the status of this feature for Linux and other Unixes? Cheers, Martin From chris.paton at red61.com Fri Nov 23 05:26:10 2007 From: chris.paton at red61.com (Chris Paton) Date: Fri, 23 Nov 2007 12:26:10 +0000 Subject: [Rxtx] RXTX parallel port issues Message-ID: <4746C6E2.3000304@red61.com> Hi there, I've been happily using RXTX to communicate with a serial based point-of-sale printer for a several months. I've recently received a parallel based printer and have been trying to get RXTX to talk to this too. I've encountered a few problems along the way and just wanted to check if I'm doing anything wrong, or if I've found any bugs. Writing ------- Writing to the parallel port using ParallelPort.getOutputStream works well, except when I use OutputStream.write(byte[]) to write a multiple of 8 bytes (!). Doing this causes the JVM to crash with an EXCEPTION_PRIV_INSTRUCTION on Windows. I worked around this in my application by adding an additional byte if bytesToWrite % 8 == 0. I guess I could also have called write(byte) repeatedly. This also generated a SIGSEGV on Linux but I was unable to reproduce it today using the CVS version of RXTX and a recent kernel. Reading status pins ------------------- On Linux, I've found that ParallelPort.isPaperOut and ParallelPort.isPrinterSelected appear to be inverted; i.e. when the paper is out ParallelPort.isPaperOut returns false, and when there is paper ParallelPort.isPaperOut returns true! I've tested this in both Sun JDK5 and JDK6 on machines running Linux 2.6.21 and 2.6.23. Fortunately it's easy to use a conditional based on System.getProperty("os.name") to hack around this. Reading from InputStream ------------------------ I've had more serious issues trying to read from ParallelPort.getInputStream. On Windows, readByte seems to return -1 (end of stream) any time data isn't available. On Linux, I got a kernel oops, even with a recent 2.6.23.1 kernel. I was able to stop this using a kernel patch that I found via Google. Although this stopped the oops, I still get frequent IOExceptions when calling InputStream.readByte. It appears that instead of blocking, readByte throws an IOException with message "Resource temporarily unavailable in readByte" any time it is called when no data is available. Occasionally, I get an exception instead of the data I was expecting to read, e.g when asking my printer for a version string I get "VER: S3306 * 06.03* 10/*6/06" where the *s indicate that an exception occurred and data was missed. Any advice that anyone can offer would be much appreciated. If you need any more details or debugging information about any of these problems then let me know. Cheers -- Chris Paton Technical Developer Red61 -- Transaction Marketing Software http://www.red61.com -------------- next part -------------- A non-text attachment was scrubbed... Name: chris.paton.vcf Type: text/x-vcard Size: 230 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20071123/00a747b6/attachment-0008.vcf From chris.paton at red61.com Fri Nov 23 05:26:10 2007 From: chris.paton at red61.com (Chris Paton) Date: Fri, 23 Nov 2007 12:26:10 +0000 Subject: [Rxtx] RXTX parallel port issues Message-ID: <4746C6E2.3000304@red61.com> Hi there, I've been happily using RXTX to communicate with a serial based point-of-sale printer for a several months. I've recently received a parallel based printer and have been trying to get RXTX to talk to this too. I've encountered a few problems along the way and just wanted to check if I'm doing anything wrong, or if I've found any bugs. Writing ------- Writing to the parallel port using ParallelPort.getOutputStream works well, except when I use OutputStream.write(byte[]) to write a multiple of 8 bytes (!). Doing this causes the JVM to crash with an EXCEPTION_PRIV_INSTRUCTION on Windows. I worked around this in my application by adding an additional byte if bytesToWrite % 8 == 0. I guess I could also have called write(byte) repeatedly. This also generated a SIGSEGV on Linux but I was unable to reproduce it today using the CVS version of RXTX and a recent kernel. Reading status pins ------------------- On Linux, I've found that ParallelPort.isPaperOut and ParallelPort.isPrinterSelected appear to be inverted; i.e. when the paper is out ParallelPort.isPaperOut returns false, and when there is paper ParallelPort.isPaperOut returns true! I've tested this in both Sun JDK5 and JDK6 on machines running Linux 2.6.21 and 2.6.23. Fortunately it's easy to use a conditional based on System.getProperty("os.name") to hack around this. Reading from InputStream ------------------------ I've had more serious issues trying to read from ParallelPort.getInputStream. On Windows, readByte seems to return -1 (end of stream) any time data isn't available. On Linux, I got a kernel oops, even with a recent 2.6.23.1 kernel. I was able to stop this using a kernel patch that I found via Google. Although this stopped the oops, I still get frequent IOExceptions when calling InputStream.readByte. It appears that instead of blocking, readByte throws an IOException with message "Resource temporarily unavailable in readByte" any time it is called when no data is available. Occasionally, I get an exception instead of the data I was expecting to read, e.g when asking my printer for a version string I get "VER: S3306 * 06.03* 10/*6/06" where the *s indicate that an exception occurred and data was missed. Any advice that anyone can offer would be much appreciated. If you need any more details or debugging information about any of these problems then let me know. Cheers -- Chris Paton Technical Developer Red61 -- Transaction Marketing Software http://www.red61.com -------------- next part -------------- A non-text attachment was scrubbed... Name: chris.paton.vcf Type: text/x-vcard Size: 230 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20071123/00a747b6/attachment-0009.vcf From hho at bibliotheca.dk Fri Nov 23 06:45:36 2007 From: hho at bibliotheca.dk (Hans Hvelplund Odborg) Date: Fri, 23 Nov 2007 14:45:36 +0100 Subject: [Rxtx] RXTX parallel port issues In-Reply-To: <4746C6E2.3000304@red61.com> References: <4746C6E2.3000304@red61.com> Message-ID: <001201c82dd7$21c6e2c0$6a37a8c0@HANSLAPTOP> I've experienced similar crashes in JVM when writing to the parallel port in windows (with rxtx). Unfortunately I did not save the data sent to the parallel port so cannot say anything about the length. Furthermore, I recall having problems with .write(byte) (would never exit if I recall correctly), but I do not recall if this was with serial or parallel or both. In the end, we ended printing through Java's support of the windows driver. Unfortunately I currently don?t have the time to investigate these issues further. I just wanted to let you know that currently there are bugs in rxtx. Med venlig hilsen / Best regards / Med v?nliga h?lsningar Hans Hvelplund Odborg BIBLIOTHECA A/S Vallensb?kvej 20B ? 2605 Br?ndby ? Denmark Tel.: +45 70271008 Fax: +45 70271009 hho at bibliotheca.dk www.bibliotheca.dk -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Chris Paton Sent: 23. november 2007 13:26 To: rxtx at qbang.org Subject: [Rxtx] RXTX parallel port issues Hi there, I've been happily using RXTX to communicate with a serial based point-of-sale printer for a several months. I've recently received a parallel based printer and have been trying to get RXTX to talk to this too. I've encountered a few problems along the way and just wanted to check if I'm doing anything wrong, or if I've found any bugs. Writing ------- Writing to the parallel port using ParallelPort.getOutputStream works well, except when I use OutputStream.write(byte[]) to write a multiple of 8 bytes (!). Doing this causes the JVM to crash with an EXCEPTION_PRIV_INSTRUCTION on Windows. I worked around this in my application by adding an additional byte if bytesToWrite % 8 == 0. I guess I could also have called write(byte) repeatedly. This also generated a SIGSEGV on Linux but I was unable to reproduce it today using the CVS version of RXTX and a recent kernel. Reading status pins ------------------- On Linux, I've found that ParallelPort.isPaperOut and ParallelPort.isPrinterSelected appear to be inverted; i.e. when the paper is out ParallelPort.isPaperOut returns false, and when there is paper ParallelPort.isPaperOut returns true! I've tested this in both Sun JDK5 and JDK6 on machines running Linux 2.6.21 and 2.6.23. Fortunately it's easy to use a conditional based on System.getProperty("os.name") to hack around this. Reading from InputStream ------------------------ I've had more serious issues trying to read from ParallelPort.getInputStream. On Windows, readByte seems to return -1 (end of stream) any time data isn't available. On Linux, I got a kernel oops, even with a recent 2.6.23.1 kernel. I was able to stop this using a kernel patch that I found via Google. Although this stopped the oops, I still get frequent IOExceptions when calling InputStream.readByte. It appears that instead of blocking, readByte throws an IOException with message "Resource temporarily unavailable in readByte" any time it is called when no data is available. Occasionally, I get an exception instead of the data I was expecting to read, e.g when asking my printer for a version string I get "VER: S3306 * 06.03* 10/*6/06" where the *s indicate that an exception occurred and data was missed. Any advice that anyone can offer would be much appreciated. If you need any more details or debugging information about any of these problems then let me know. Cheers -- Chris Paton Technical Developer Red61 -- Transaction Marketing Software http://www.red61.com From tjarvi at qbang.org Fri Nov 23 16:28:23 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 23 Nov 2007 16:28:23 -0700 (MST) Subject: [Rxtx] RXTX parallel port issues In-Reply-To: <001201c82dd7$21c6e2c0$6a37a8c0@HANSLAPTOP> References: <4746C6E2.3000304@red61.com> <001201c82dd7$21c6e2c0$6a37a8c0@HANSLAPTOP> Message-ID: It would be good to create a bug report for this so others can either look into it or find the report to confirm their suspicions. Currently, there is only one parallel port bug report. http://bugzilla.qbang.org/show_bug.cgi?id=40 As we do update the reports when bugs are fixed, it gives people a chance to put themselves on the CC list and get notification of fixes they are interested in. On Fri, 23 Nov 2007, Hans Hvelplund Odborg wrote: > > I've experienced similar crashes in JVM when writing to the parallel port in > windows (with rxtx). > > Unfortunately I did not save the data sent to the parallel port so cannot > say anything about the length. > > Furthermore, I recall having problems with .write(byte) (would never exit if > I recall correctly), but I do not recall if this was with serial or parallel > or both. > > In the end, we ended printing through Java's support of the windows driver. > > Unfortunately I currently don?t have the time to investigate these issues > further. I just wanted to let you know that currently there are bugs in > rxtx. > > > Med venlig hilsen / Best regards / Med v?nliga h?lsningar > Hans Hvelplund Odborg > > BIBLIOTHECA A/S > Vallensb?kvej 20B ? 2605 Br?ndby ? Denmark > Tel.: +45 70271008 > Fax: +45 70271009 > hho at bibliotheca.dk > www.bibliotheca.dk > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Chris Paton > Sent: 23. november 2007 13:26 > To: rxtx at qbang.org > Subject: [Rxtx] RXTX parallel port issues > > Hi there, > > I've been happily using RXTX to communicate with a serial based > point-of-sale printer for a several months. I've recently received a > parallel based printer and have been trying to get RXTX to talk to this > too. I've encountered a few problems along the way and just wanted to > check if I'm doing anything wrong, or if I've found any bugs. > > Writing > ------- > Writing to the parallel port using ParallelPort.getOutputStream works > well, except when I use OutputStream.write(byte[]) to write a multiple > of 8 bytes (!). Doing this causes the JVM to crash with an > EXCEPTION_PRIV_INSTRUCTION on Windows. I worked around this in my > application by adding an additional byte if bytesToWrite % 8 == 0. I > guess I could also have called write(byte) repeatedly. > > This also generated a SIGSEGV on Linux but I was unable to reproduce it > today using the CVS version of RXTX and a recent kernel. > > Reading status pins > ------------------- > On Linux, I've found that ParallelPort.isPaperOut and > ParallelPort.isPrinterSelected appear to be inverted; i.e. when the > paper is out ParallelPort.isPaperOut returns false, and when there is > paper ParallelPort.isPaperOut returns true! I've tested this in both Sun > JDK5 and JDK6 on machines running Linux 2.6.21 and 2.6.23. Fortunately > it's easy to use a conditional based on System.getProperty("os.name") to > hack around this. > > Reading from InputStream > ------------------------ > > I've had more serious issues trying to read from > ParallelPort.getInputStream. On Windows, readByte seems to return -1 > (end of stream) any time data isn't available. > > On Linux, I got a kernel oops, even with a recent 2.6.23.1 > kernel. I was able to stop this using a kernel patch > > that I found via Google. Although this stopped the oops, I still get > frequent IOExceptions when calling InputStream.readByte. It appears that > instead of blocking, readByte throws an IOException with message > "Resource temporarily unavailable in readByte" any time it is called > when no data is available. Occasionally, I get an exception instead of > the data I was expecting to read, e.g when asking my printer for a > version string I get "VER: S3306 * 06.03* 10/*6/06" where the *s > indicate that an exception occurred and data was missed. > > > Any advice that anyone can offer would be much appreciated. If you need > any more details or debugging information about any of these problems > then let me know. > > Cheers > From manujnaman at yahoo.com Sun Nov 25 14:59:21 2007 From: manujnaman at yahoo.com (manuj naman) Date: Sun, 25 Nov 2007 13:59:21 -0800 (PST) Subject: [Rxtx] Problem reading 1-wire device using RXTX on Linux In-Reply-To: Message-ID: <104159.48942.qm@web37909.mail.mud.yahoo.com> Trent, dmesg | grep tty gives nothing. however, greping for usb does. The output for that is below. touch /var/lock/test.lock file does not exist, the directory does exits though. tail -f /dev/ttyUSB0 gives nothing simply because ttyUSB0 does not exist. Seems as if USB ports are not there... however, numerous /dev/tty* exist starting from /dev/tty, /dev/tty0, /dev/tty1... to ... /dev/ttyzf. The result of dmesg | grep usb is as follows: [17179576.220000] usbcore: registered new driver usbfs [17179576.220000] usbcore: registered new driver hub [17179576.572000] usb 1-1: new low speed USB device using uhci_hcd and address 2 [17179576.992000] usb 2-1: new full speed USB device using uhci_hcd and address 2 [17179577.132000] usbcore: registered new driver hiddev [17179577.188000] input: USB HID v1.11 Mouse [Microsoft Microsoft Wireless Optical Mouse� 1.00] on usb-0000:00:1f.2-1 [17179577.188000] usbcore: registered new driver usbhid [17179577.188000] drivers/usb/input/hid-core.c: v2.6:USB HID core driver [17179577.192000] usb-storage: device found at 2 [17179577.192000] usb-storage: waiting for device to settle before scanning [17179577.192000] usbcore: registered new driver usb-storage [17179582.192000] usb-storage: device scan complete [17209993.728000] usb 1-2: new full speed USB device using uhci_hcd and address 3 [17209994.816000] usbcore: registered new driver DS9490R [17248016.760000] usb 1-1: USB disconnect, address 2 [17302939.908000] usb 1-2: USB disconnect, address 3 [17302944.856000] usb 1-2: new full speed USB device using uhci_hcd and address 4 [17794170.232000] usb 1-2: USB disconnect, address 4 Does it help in diagnosis? The name of the 1-wire viewer device is DS9490 Best regards, Manuj Trent Jarvi wrote: On Wed, 21 Nov 2007, manuj naman wrote: > Hello, > > I am trying to use the RXTX library on Ubuntu (Debian) linux to read iButtons. It works perfectly on Windows. However on my linux machines it gives the following errors. I am using DS9490 (USB port adapter) to read the iButtons. > > I have followed your instructions on the Wiki. I recompiled the rxtx library to produce the .so and .jar files. But still it gives me this: > > manujnaman at sensor:~/iButton/onewireviewer$ java -cp $CLASSPATH:./OneWireAPI.jar:./OneWireViewer.jar OneWireViewer > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > Warning: serial communications API not setup properly, no ports in enumeration > Pure-Java DS9097U adapter will not work, not added to adapter enum > > Standard drivers for 1-Wire are not found. > Please download the latest drivers from http://www.ibutton.com > Or install RXTX Serial Communications API from http://www.rxtx.org > > Do you know how to solve the "Serial communications API not setup properly, no ports in enumeration" problem? > > Also, how to detect which what /dev/* is the port to be used? On Windows this is simply USB1, on linux this is a bit unclear. Hi Manuj What is the output of the following? dmesg |grep tty touch /var/lock/test.lock && rm -f /var/lock/test.lock If you see something like /dev/ttyUSB0 in the dmesg output, what happens if you do something like tail -f /dev/ttyUSB0? These test each of the usual suspects. We are looking for missing USB drivers, no permission to create a lockfile and no read permission for the device. -- Trent Jarvi tjarvi at qbang.org --------------------------------- Be a better sports nut! Let your teams follow you with Yahoo Mobile. Try it now. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071125/ef4f80c4/attachment.html From tjarvi at qbang.org Sun Nov 25 16:43:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 25 Nov 2007 16:43:04 -0700 (MST) Subject: [Rxtx] Problem reading 1-wire device using RXTX on Linux In-Reply-To: <104159.48942.qm@web37909.mail.mud.yahoo.com> References: <104159.48942.qm@web37909.mail.mud.yahoo.com> Message-ID: Hi Manuj, This does help diagnose the problem. Sadly the answer is in the system configuration of your debian system. I can only point you towards some areas that are suspect. /dev/tty01->/dev/ttyzz are terminals which are not of interest. It appears that the usb serial kernel module is not loading. That is usually in a directory like the following: /lib/modules/2.6.*/kernel/drivers/usb/serial modprobe is used to manually load the drivers. Your /dev/* may be created based upon the kernel modules loaded or MAKEDEV may be used to create the devices. /etc/modules.conf may be what is misconfigured though I'm not sure. One of the modules in usb/serial is probably responsible for representing your USB dongle as a tty. UDEV is probably responsible for creating ttyUSB01 once the kernel module is loaded. Perhaps someone has been through this before but basically this is a system configuration problem or a missing kernel driver. Once /dev/USB?? are present, rxtx should find the port. On Sun, 25 Nov 2007, manuj naman wrote: > Trent, > > dmesg | grep tty > gives nothing. however, greping for usb does. The output for that is below. > > touch /var/lock/test.lock file does not exist, the directory does exits though. > > tail -f /dev/ttyUSB0 gives nothing simply because ttyUSB0 does not exist. > > Seems as if USB ports are not there... however, numerous /dev/tty* exist starting from /dev/tty, /dev/tty0, /dev/tty1... to ... /dev/ttyzf. > > The result of dmesg | grep usb is as follows: > > [17179576.220000] usbcore: registered new driver usbfs > [17179576.220000] usbcore: registered new driver hub > [17179576.572000] usb 1-1: new low speed USB device using uhci_hcd and address 2 > [17179576.992000] usb 2-1: new full speed USB device using uhci_hcd and address 2 > [17179577.132000] usbcore: registered new driver hiddev > [17179577.188000] input: USB HID v1.11 Mouse [Microsoft Microsoft Wireless Optical Mouse� 1.00] on usb-0000:00:1f.2-1 > [17179577.188000] usbcore: registered new driver usbhid > [17179577.188000] drivers/usb/input/hid-core.c: v2.6:USB HID core driver > [17179577.192000] usb-storage: device found at 2 > [17179577.192000] usb-storage: waiting for device to settle before scanning > [17179577.192000] usbcore: registered new driver usb-storage > [17179582.192000] usb-storage: device scan complete > [17209993.728000] usb 1-2: new full speed USB device using uhci_hcd and address 3 > [17209994.816000] usbcore: registered new driver DS9490R > [17248016.760000] usb 1-1: USB disconnect, address 2 > [17302939.908000] usb 1-2: USB disconnect, address 3 > [17302944.856000] usb 1-2: new full speed USB device using uhci_hcd and address 4 > [17794170.232000] usb 1-2: USB disconnect, address 4 > > Does it help in diagnosis? The name of the 1-wire viewer device is DS9490 > > Best regards, > Manuj > > > Trent Jarvi wrote: On Wed, 21 Nov 2007, manuj naman wrote: > >> Hello, >> >> I am trying to use the RXTX library on Ubuntu (Debian) linux to read iButtons. It works perfectly on Windows. However on my linux machines it gives the following errors. I am using DS9490 (USB port adapter) to read the iButtons. >> >> I have followed your instructions on the Wiki. I recompiled the rxtx library to produce the .so and .jar files. But still it gives me this: >> >> manujnaman at sensor:~/iButton/onewireviewer$ java -cp $CLASSPATH:./OneWireAPI.jar:./OneWireViewer.jar OneWireViewer >> Experimental: JNI_OnLoad called. >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> Warning: serial communications API not setup properly, no ports in enumeration >> Pure-Java DS9097U adapter will not work, not added to adapter enum >> >> Standard drivers for 1-Wire are not found. >> Please download the latest drivers from http://www.ibutton.com >> Or install RXTX Serial Communications API from http://www.rxtx.org >> >> Do you know how to solve the "Serial communications API not setup properly, no ports in enumeration" problem? >> >> Also, how to detect which what /dev/* is the port to be used? On Windows this is simply USB1, on linux this is a bit unclear. > > > Hi Manuj > > What is the output of the following? > > dmesg |grep tty > > touch /var/lock/test.lock && rm -f /var/lock/test.lock > > If you see something like /dev/ttyUSB0 in the dmesg output, what happens > if you do something like > > tail -f /dev/ttyUSB0? > > These test each of the usual suspects. We are looking for missing USB > drivers, no permission to create a lockfile and no read permission for the > device. > > -- > Trent Jarvi > tjarvi at qbang.org > > > > --------------------------------- > Be a better sports nut! Let your teams follow you with Yahoo Mobile. Try it now. From netbeans at gatworks.com Mon Nov 26 06:53:02 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 26 Nov 2007 08:53:02 -0500 Subject: [Rxtx] #undef TIOCSERGETLSR on LINUX Message-ID: <474ACFBE.5050406@gatworks.com> So I undef'ed the define TIOCSERGETLSR on a linux box, I find that RXTX no longer works . this is a :{ It appears that the sigprocmask( SIG_SETMASK, &newmask, &oldmask ) at src/SerialImp.c:1427 seems to unblock more events than it should. On a linux box there are 2 other events that are blocked, and this code un-sets them, and the thread hangs. It also appears that this code is incomplete. Also, if you only add in the block for SIGCHLD ( which I think is what someone wanted ) , the code will (soon) core-dump ( or silently exit ). So has anyone run with this code ? From keithvz at verizon.net Thu Nov 1 08:08:58 2007 From: keithvz at verizon.net (Keith) Date: Thu, 01 Nov 2007 10:08:58 -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: <4729DDFA.7080206@verizon.net> Trent Jarvi wrote: > 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? Well, I honestly don't know how all this fits together. I think it's just a matter of enabling the right flow control option within the standard serial framework to tell the device driver, "HEY START USING DTR/DSR FOR FLOW CONTROL." If what UGeorge said,(about that type of nitty-gritty lead control being done within the device driver), is true, then this confirms my suspicion. I tried narrowing down within the Linux drivers what you are looking for, but I can't entirely tell wth I'm looking at. (virtual com port drivers -- they are included compiled by default with Ubuntu, source included) http://www.ftdichip.com/Drivers/VCP/Linux/ftdi_sio.tar.gz Hahahaa, they make a reference to DTR flow control being supported but say (UGH) in parenthesis. You can also use their direct device driver library on Ubuntu -- libftd2xx.so.0.4.13. No source code. http://www.ftdichip.com/Drivers/D2XX/Linux/libftd2xx0.4.13.tar.gz In that case, you make a call to their FT_SetFlowControl() function. FT_STATUS FT_SetFlowControl (FT_HANDLE ftHandle, USHORT usFlowControl, UCHAR uXon,UCHAR uXoff) Parameters ftHandle Handle of the device. usFlowControl Must be one of FT_FLOW_NONE, FT_FLOW_RTS_CTS, ****FT_FLOW_DTR_DSR**** or FT_FLOW_XON_XOFF. uXon Character used to signal Xon. Only used if flow control is FT_FLOW_XON_XOFF. uXoff Character used to signal Xoff. Only used if flow control is FT_FLOW_XON_XOFF. This is from their programming guide http://www.ftdichip.com/Documents/ProgramGuides/D2XXPG34.pdf I actually want to take this a step further and say that I think the flow control is actually handled right on the device itself in hardware/firmware. It's enabled through the device driver, but I think the maintaining of buffers, asserting/deasserting of leads, etc is handled by the device. For the time being, I've switched to jd2xx, https://jd2xx.dev.java.net/ and http://bleyer.org/jd2xx/ These are Java wrappers for the device driver libraries. It allows almost direct access to the well-documented device drivers from Java. I hope this helps Keith From tjarvi at qbang.org Thu Nov 1 11:09:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:09:51 -0600 (MDT) 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: Hi Martin, What I usually have done is allow changes that do not impact working software including changes to methods not documented in CommAPI (which remain undocumented in rxtx) and fixes to known problems in the documented portions. That way if you use the documented API, the releases should only become better with time. If you use the undocumented portions, the behavior is not as predictable but open for improvement. On Wed, 31 Oct 2007, 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 >> > From tjarvi at qbang.org Thu Nov 1 11:15:52 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:15:52 -0600 (MDT) 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: I too use rxtx in commercial products. The problem I've been trying to address while bringing the server back was how to make it possible for hobby folks to build the same software as companies so we can move rxtx along a little faster. Exposing internal tools is not an option at this time, the public rxtx builds have been done on my home machine which has drives hanging out of it all over the place dying one at a time. This isn't maintainable. I'm currently looking at the possibility of making an S3 image available on Amazon's EC. These are machines you can rent for ~10 cents an hour which is more than enough to build rxtx. The S3 image is not changed when people use it so everyone has the same starting point. With this, we could all build rxtx for ~20 platforms for a small price and eliminate tool issues. On Wed, 31 Oct 2007, Greg Johnson wrote: > 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 tjarvi at qbang.org Thu Nov 1 11:19:55 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:19:55 -0600 (MDT) 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: On Wed, 31 Oct 2007, 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. I was helping Dmitry do the Mac OS X port without access to a machine when we put that in. In the archives there is information (easily found with google on Apple's site) that describes how their API (and others) can determine if a port is used and ignore it. I think these changes are in CVS but need to confirm. The bottom line is that rxtx should not have used lock files on Mac. It was just ignorance of the system on my part. -- Trent Jarvi tjarvi at qbang.org From fabioanjos at gmail.com Thu Nov 1 12:35:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Thu, 1 Nov 2007 15:35:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Hi, I was using SerialEventListener in my project. But, as was said here, id doesnt work very well with virtual serial ports. So, I changed the strategy using the code posted here in this thread: try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > 0) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } The thing is that in my tests I could notice that in.read(buffer) never blocks. Even when there's nothing to read. Instead of blocking when there's nothing to read it returns 0. So, my questions are: 1. Am I doing something wrong? 2. If not, wouldnt this decrease performance? (the thread would be locked in a loop that does nothing.) 3. Is there a better way to do the job? Thanks in advance!! F?bio -------- On 10/31/07, Andre-John Mas wrote: > > > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/0aee59d0/attachment-0027.html From ajmas at sympatico.ca Thu Nov 1 16:07:55 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Nov 2007 18:07:55 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Message-ID: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From sarah_662005 at yahoo.com Thu Nov 1 17:10:05 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Thu, 1 Nov 2007 16:10:05 -0700 (PDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Message-ID: <351433.37166.qm@web55814.mail.re3.yahoo.com> Thank you very much for your help. Now the application works fine. the serialEvent gets triggered. Rxtx is cool! ----- Original Message ---- From: Andre-John Mas To: Sara Hugh ; RXTX Developers and Users Sent: Wednesday, October 31, 2007 9:55:45 AM Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered 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 __________________________________________________ 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/20071101/4a86bea6/attachment-0027.html From tjarvi at qbang.org Thu Nov 1 17:58:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 17:58:02 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx Message-ID: The rxtx.org site is primarily interested in the hobby aspects of rxtx. Obviously, there are some companies following the work too. These interests bring larger workflows and concerns about details hobby folks may not care about. They also bring many more users. I know the company I work for has a quality engineering effort going on which includes rxtx. While the server was down, I was contacted by another company that was missing the binaries for their testing. Several people have mentioned concerns about a stable release for like reasons. Would there be interest on the quality side of the coin to get together? It could be just sharing email's with each other or a seperate list for QE/QA. I can not say for sure, but we may be able to share some of our efforts/results that could help keep rxtx releases stable. -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Fri Nov 2 01:42:55 2007 From: scldad at sdc.com.au (Stephen Davies) Date: Fri, 2 Nov 2007 18:12:55 +1030 Subject: [Rxtx] Multiple modems Message-ID: <200711021812.56047.scldad@sdc.com.au> This may or may not be related to the Multiple Ports thread. I have an application which uses rxtx on Linux (via cron jobs) to connect multiple modems to remote sensing devices. The application works fine most of the time but occasionally fails to connect if two (or more) connection attempts happen at about the same time. When it fails, it looks as if it may get confused as to which port it is talking to. The app has a "base" component that looks for an available port, opens it and then creates an input thread and an output thread for the connection and data transfer. The "base" component uses this code: // loop round all known ports until one is available. Give up after three minutes Counter ptimeout = new Counter(); while(!portFound && ptimeout.elapsed() < 180000) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // special case. ttyS0 is not available to us on this server. if (!portId.isCurrentlyOwned() && !portId.getName().equals("/dev/ttyS0")) { gLog.debug(lognm + ": Found port " + portId.getName()); try { serialPort = (RXTXPort) portId.open("AguaModem", 10000); } catch (Exception e) { gLog.error(lognm + ": Port " + portId.getName() + " will not open."); gLog.error(e.getMessage()); continue; } AguaModem aguamodem = new AguaModem(); portFound = true; break; } gLog.debug(lognm + ": Port " + portId.getName() + " is busy"); } } } I am wondering about the isCurrentlyOwned method. Does this actually tell me whether a port is currently being used by another process? TIA, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From fabioanjos at gmail.com Fri Nov 2 04:59:58 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 07:59:58 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Message-ID: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/9009eb1d/attachment-0027.html From netbeans at gatworks.com Fri Nov 2 06:28:13 2007 From: netbeans at gatworks.com (U. George) Date: Fri, 02 Nov 2007 08:28:13 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <472B17DD.1050508@gatworks.com> It should normally block ( unless eof / event ) . so its a :{ whats the device ( to recreate if possible ) and how do u open. > My question is, is there a way to make in.read block the thead until > there's something to read? > From fabioanjos at gmail.com Fri Nov 2 06:34:46 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 09:34:46 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > On 11/1/07, Andre-John Mas wrote: > > > > Fabio, > > > > Turns out there was a small error in my example. The test should be: > > > > (numBytes = in.read(buffer)) > -1 > > > > This is because -1 indicates an end of file (end of data stream) > > > > Andre > > > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > > > Hi, > > > > > > I was using SerialEventListener in my project. But, as was said > > > here, id doesnt work very well with virtual serial ports. > > > So, I changed the strategy using the code posted here in this thread: > > > > > > try{ > > > in = port.getInputStream(); > > > out = port.getOutputStream(); > > > int numBytes = 0; > > > while(active){ > > > > > > byte[] buffer = new byte[10]; > > > > > > while ( (numBytes = in.read(buffer)) > 0) > > > { > > > String dataValue = new String(buffer,0,numBytes); > > > processInput(dataValue); > > > } > > > > > > if(numBytes==-1){ > > > break; > > > } > > > > > > Thread.sleep(50); > > > } > > > > > > }catch(IOException e){ > > > logger.info("falha de comunicacao "+ > > > getReceptor().getPort() ); > > > > > > }catch(InterruptedException e){ > > > logger.info ("Interrompendo leitura da porta "+ > > > getReceptor().getPort() ); > > > } > > > > > > The thing is that in my tests I could notice that in.read(buffer) > > > never blocks. Even when there's nothing to read. Instead of blocking > > > when there's nothing to read it returns 0. > > > > > > So, my questions are: > > > > > > 1. Am I doing something wrong? > > > 2. If not, wouldnt this decrease performance? (the thread would be > > > locked in a loop that does nothing.) > > > 3. Is there a better way to do the job? > > > > > > Thanks in advance!! > > > > > > F?bio > > > -------- > > > > > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > > 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 > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > > > > > -- > > > Atenciosamente, > > > F?bio Cristiano dos Anjos > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/5306c4b1/attachment-0027.html From nick.circelli at infrasafe.com Fri Nov 2 07:01:17 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Fri, 2 Nov 2007 08:01:17 -0500 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com><29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com><90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca><29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Message-ID: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> I'm pretty sure that not blocking has to do with you virtual ports. Cause it should block. Maybe you should try: while ((numBytes = in.available()) > 0) { If (numBytes > buffer.length) { numBytes = buffer.length; // in case you have buffer overflow } numBytes = in.read(buffer, 0 , numBytes)); String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } Also, just for optimization, I'd move that byte[] buffer = new byte[10]; out of the while since you don't need to reallocate it every iteration. ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of F?bio Cristiano dos Anjos Sent: Friday, November 02, 2007 8:35 AM To: RXTX Developers and Users Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream (); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas < ajmas at sympatico.ca > wrote: Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info ("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Atenciosamente, F?bio Cristiano dos Anjos -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/4de7f6a3/attachment-0027.html From fabioanjos at gmail.com Fri Nov 2 07:36:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 10:36:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> Message-ID: <29788b250711020636q1588c88fgaa5e27f5504164fb@mail.gmail.com> Hi Nick, Actually, it doesnt block for physical ports too. And, the method avaiable does not block either, so when there's nothing avaiable the loop ends and the thread stops lintening to the port. But I did some more test with serialEventListener, and now its working. I realy dont know what I've done to get it working. I just start woking as soon as I decided to test it again. It was said here that serialEventListener is not reliable for virtual serial ports. Is there another way to read it, without compromising performance? Tanks again!! F?bio ------- On 11/2/07, Nick Circelli wrote: > > I'm pretty sure that not blocking has to do with you virtual ports. > Cause it should block. > > Maybe you should try: > > > > while ((numBytes = in.available()) > 0) > > { > > If (numBytes > buffer.length) { > > numBytes = buffer.length; // in case you have buffer overflow > > } > > numBytes = in.read(buffer, 0 , numBytes)); > > String dataValue = new String(buffer,0,numBytes,"ASCII"); > > processInput(dataValue); > > } > > > > Also, just for optimization, I'd move that byte[] buffer = new > byte[10]; > > out of the while since you don't need to reallocate it every iteration. > > > ------------------------------ > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On Behalf > Of *F?bio Cristiano dos Anjos > *Sent:* Friday, November 02, 2007 8:35 AM > *To:* RXTX Developers and Users > *Subject:* Re: [Rxtx] serialEvent(SerialPortEvent event) never be > triggered > > > > Hi, > > I think i missunderstand something here. > The code you post here was meant to be used inside serialEvent method, > right? > > The think is, that i cannot user SerialEventListener to read serial ports, > because i need to read virual serial ports and id does not behaves well, as > said here before. serialEvent is never triggered. > > So what I quit using SerialEventListener and created a thread to listen to > the port: > > public void run(){ > try{ > in = port.getInputStream(); > out = port.getOutputStream (); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new > String(buffer,0,numBytes,"ASCII"); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ getReceptor().getPort() > ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > } > > > So, the problem is that in.read(buffer) always returns 0 when there is > nothing to read, instead of blocking the flow, and the thread becames locked > in the loop. > > I hope you can help me solve this. > > Thanks in advance! > > F?bio > -------- > > On 11/2/07, *F?bio Cristiano dos Anjos* wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > > > On 11/1/07, *Andre-John Mas* < ajmas at sympatico.ca> wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info ("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/571df6ea/attachment-0026.html From tjarvi at qbang.org Fri Nov 2 08:32:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Nov 2007 08:32:15 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: References: Message-ID: On Fri, 2 Nov 2007, Greg Johnson wrote: > Hi Trent, folks, > Having a single rxtx that is suitable for commercial uses and hobbyists both > would be a great idea? Perhaps it would be worth submitting rxtx as a > proposal to Codehaus - they not only provide excellent tools (Jira (bug > tracker), Confluence (wiki)) but also support build management ( > maestro, continuum, bamboo). Relying on your personal machine (btw, frii.com > / rxtx.org is down again?) seems like a burden you shouldn't have to shoulder > alone. Hi Greg, There may be a little confusion here. There is no need to have two seperate rxtx releases. What I'm trying to encourage is a discussion between some of the people responsible for making sure rxtx does not break their products each release. Usually these people are interested in testing a set of functionality their product depends upon. They do not work with rxtx code but rather traps to catch when rxtx developers break something. This goes on all the time in isolated labs. There are many services that offer to do various pieces of a project for you if you... Anyone is free to do the 'if you' portion with rxtx and see how it goes. I'm actually interested in doing less of that than more. The rxtx.org work I do just happens to overlap with other things I do for personal/family use. The reason I suggest the amazon solution is that anyone can take full control of the environment for a day and it costs less than a package of gum without causing harm to what anyone else is doing. I assume the down question was with respect to a mod_security setting that has been resolved. If not, please post a url to the problem. -- Trent Jarvi tjarvi at qbang.org From nsayer at kfu.com Sat Nov 3 20:17:49 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 19:17:49 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? Message-ID: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Has anyone got RXTX working with an app under Leopard? My app hangs on port open (it works fine with Tiger). The relevant thread looks like this in the activity monitor: 1536 JVM_InvokeMethod 1536 0x48ccd0 1536 0x46f8a0 1536 0x4c3ff4 1536 0x4c4284 1536 0x357d160 1536 0x357faac 1536 Java_gnu_io_RXTXPort_open 1536 open $NOCANCEL$UNIX2003 1536 open $NOCANCEL$UNIX2003 From ajmas at sympatico.ca Sat Nov 3 22:02:04 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 00:02:04 -0400 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> RXTX works for me with Leopard. I am currently using it communicate with a Bluetooth GPS. What computer and device are you trying to use? Is the driver for your serial device compatible with MacOS X 10.5? Andre On 3-Nov-07, at 22:17 , Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From nsayer at kfu.com Sat Nov 3 22:17:47 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 21:17:47 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> Message-ID: <1720F723-3643-438C-B3AB-E09A67536977@kfu.com> On Nov 3, 2007, at 9:02 PM, Andre-John Mas wrote: > RXTX works for me with Leopard. I am currently using it communicate > with a Bluetooth GPS. > > What computer and device are you trying to use? Is the driver for > your serial device compatible with MacOS X 10.5? An Intel mac mini The FTDI USB serial driver an XMPCR, which is just a fancy serial controlled radio and an FTDI usb-to-serial chip I've successfully used the FTDI driver with another FTDI device in another context. > > > Andre > > On 3-Nov-07, at 22:17 , Nick Sayer wrote: > >> Has anyone got RXTX working with an app under Leopard? >> >> My app hangs on port open (it works fine with Tiger). The relevant >> thread looks like this in the activity monitor: >> >> 1536 JVM_InvokeMethod >> 1536 0x48ccd0 >> 1536 0x46f8a0 >> 1536 0x4c3ff4 >> 1536 0x4c4284 >> 1536 0x357d160 >> 1536 0x357faac >> 1536 >> Java_gnu_io_RXTXPort_open >> 1536 open >> $NOCANCEL$UNIX2003 >> 1536 open >> $NOCANCEL$UNIX2003 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From racecar at gmail.com Sat Nov 3 22:25:53 2007 From: racecar at gmail.com (Kevin Mateo Lim) Date: Sat, 3 Nov 2007 21:25:53 -0700 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: Message-ID: I am alternating between two errors. After i run the macosx_setup.command, "everyone" is set to Read only in /var/lock. I notice in the terminal that the group for these perms is _uucp, not uucp. In that state, I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 check_group_uucp(): error testing lock file creation Error details:Permission deniedcheck_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException : Error inside Serial.() at processing.serial.Serial.errorMessage(Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.( Serial.java:102) at Temporary_829_3245.setup(Temporary_829_3245.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java :690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) Then, I hand edit the "everyone" permissions for /var/lock/ to Read and Write (note /var/spool/uucp is Read/Write in all cases, and doesn't change). I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX uucp_lock() /var/lock/LK.003.009.000 is there gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException: Error inside Serial.() at processing.serial.Serial.errorMessage (Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.(Serial.java:102) at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java:690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) See here: http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071103/f1a2c467/attachment-0025.html From greg.johnson at manchester.ac.uk Sun Nov 4 02:31:13 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sun, 4 Nov 2007 10:31:13 +0100 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <28B5E0A0-0802-4C74-AC21-87ED35F3B9A2@manchester.ac.uk> Hi Nick, I also had problems initially with Leopard, but it was resolved by reinstalling the serial USB driver (FTDI in my case). The symptoms were a non-detection of any ports (but I twigged when I tried ZTerm and it had the same problem). Good luck! Cheers, greg PS I did a "Archive and install" which may be the reason my FTDI driver had disappeared - I don't think the driver has changed for 10.5 ------------------------------------------------------------------------- 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 4 Nov 2007, at 03:17, Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Sun Nov 4 13:01:12 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 15:01:12 -0500 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: Message-ID: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Hi, You will need to get the 2.1-8 code from CVS. See the FAQ for more information: http://rxtx.qbang.org/wiki/index.php/FAQ Andre On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > I am alternating between two errors. > > After i run the macosx_setup.command, "everyone" is set to Read only > in /var/lock. I notice in the terminal that the group for these > perms is _uucp, not uucp. > > In that state, I get this error: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > check_group_uucp(): error testing lock file creation Error > details:Permission deniedcheck_lock_status: No permission to create > lock file. > please see: How can I use Lock Files with rxtx? in INSTALL > gnu.io.PortInUseException: Unknown Application > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > java.lang.RuntimeException : Error inside Serial.() > > at processing.serial.Serial.errorMessage(Serial.java:583) > > at processing.serial.Serial.(Serial.java:148) > > at processing.serial.Serial.( Serial.java:102) > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > at processing.core.PApplet.run(PApplet.java:1556) > > at java.lang.Thread.run(Thread.java:613) > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > and Write (note /var/spool/uucp is Read/Write in all cases, and > doesn't change). I get this error: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > gnu.io.PortInUseException: Unknown Application > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > java.lang.RuntimeException: Error inside Serial.() > > at processing.serial.Serial.errorMessage (Serial.java:583) > > at processing.serial.Serial.(Serial.java:148) > > at processing.serial.Serial.(Serial.java:102) > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > at processing.core.PApplet.run(PApplet.java:1556) > > at java.lang.Thread.run(Thread.java:613) > > See here: > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From netbeans at gatworks.com Sun Nov 4 14:33:35 2007 From: netbeans at gatworks.com (U. George) Date: Sun, 04 Nov 2007 16:33:35 -0500 Subject: [Rxtx] #ifndef TIOCSERGETLSR Message-ID: <472E3AAF.7050709@gatworks.com> For Linux, it seems that you need the code for both *having* a TIOCSERGETLSR, and *not having* a TIOCSERGETLSR. Maybe the ioctl exists system wide, but not necessarily for the device driver itself ( always returns -1 ) . Are there systems that have a *functioning* TIOCSERGETLSR for all their devices? Then this would be the case where the "#ifndef TIOCSERGETLSR" directive could be useful is eliminating the unnecessary code and tests. And for those systems that dont have a TIOCSERGETLSR, then the code for TIOCSERGETLSR can be eliminated. It would be a simple case to have, as a foundation, all the code to simulate the missing TIOCSERGETLSR ioctl. If the system does have the ioctl, then that code can be ifdef'd in, and co-exist with the functionality of the code that simulates the missing TIOCSERGETLSR ioctl. From racecar at gmail.com Sun Nov 4 17:30:19 2007 From: racecar at gmail.com (Kevin Mateo Lim) Date: Sun, 4 Nov 2007 17:30:19 -0700 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: the README.OSX reads: Put libSerial.jnilib in the directory of the application (the JavaVM will find it there). Add RXTXComm.jar to the application classpath or include the classes in the application jar. (Some applications already include the RXTX classes in their application jar, in which case only the file libSerial.jnilib is required). I can't find libSerial.jnilib I put librxtxSerial.jnilib into my Processing /libraries/serial/library/ directory. Yet it still sees the old version: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 On 11/4/07, Andre-John Mas wrote: > > Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > 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/20071104/c0a83f91/attachment-0024.html From ajmas at sympatico.ca Sun Nov 4 17:41:47 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 19:41:47 -0500 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> If you are wanting it to be available for all applications, - for all users: /Library/Java/Extensions - for your user: ~/Library/Java/Extensions Or just for your application, then it should be in the same directory from which yo are launching your application. If you are getting the 2.1-8 source, then the library built is called: librxtxSerial.jnilib despite what the docs say. Andre On 4-Nov-07, at 19:30 , Kevin Mateo Lim wrote: > > the README.OSX reads: > Put > libSerial.jnilib > in the directory of the application (the JavaVM will find it there). > Add > RXTXComm.jar > to the application classpath or include the classes in the > application jar. > (Some applications already include the RXTX classes in their > application jar, > in which case only the file libSerial.jnilib is required). > > > I can't find libSerial.jnilib > I put librxtxSerial.jnilib into my Processing /libraries/serial/ > library/ directory. > > Yet it still sees the old version: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > On 11/4/07, Andre-John Mas wrote: Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial .(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay (PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > From bschlining at gmail.com Sun Nov 4 19:46:23 2007 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 4 Nov 2007 18:46:23 -0800 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> Message-ID: > > Or just for your application, then it should be in the same directory > from which yo are launching your application. Just wanted to add one more way of specifying the native lib location... If you don't want to define it globally by putting it in /Library/Java/Extensions (and you don't, it's a very very bad practice) you can also specify the location of the native library when starting the JVM by specifying the 'java.library.path' property. For example: java -Djava.library.path=/Path/To/Directory/With/RXTX/Library YourMainClass -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071104/c5af6980/attachment-0024.html From greg.johnson at manchester.ac.uk Mon Nov 5 01:39:02 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Mon, 5 Nov 2007 09:39:02 +0100 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: The 2.1-8 code reports 2.1-7, hence your (and my) confusion. But as long as you've removed all traces of the old library, it really _is_ 2.1-8. And if you specify the library path to the VM, don't make my mistake (on OSX at least) - you need to respecify the entire library path it had by default, as the command line argument replaces the path, rather than appending to it. 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 5 Nov 2007, at 01:30, Kevin Mateo Lim wrote: > > the README.OSX reads: > Put > libSerial.jnilib > in the directory of the application (the JavaVM will find it there). > Add > RXTXComm.jar > to the application classpath or include the classes in the > application jar. > (Some applications already include the RXTX classes in their > application jar, > in which case only the file libSerial.jnilib is required). > > > I can't find libSerial.jnilib > I put librxtxSerial.jnilib into my Processing /libraries/serial/ > library/ directory. > > Yet it still sees the old version: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > On 11/4/07, Andre-John Mas wrote: > Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial .(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay (PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > 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 HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071105/7f50506d/attachment-0024.html From cyrille.dumont at tatexpress.fr Mon Nov 5 05:46:03 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 05 Nov 2007 13:46:03 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: References: <472727F1.1000704@tatexpress.fr> Message-ID: <472F108B.2090101@tatexpress.fr> Thanks a lot for your solution ... but I'm not a expert in JAVA ... (sorry) For the moment I've this function : """ public void serialEvent(SerialPortEvent e) { StringBuffer inputBuffer = new StringBuffer(); int newData = 0; switch (e.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } //-- Manag. Data from Scanner this.MngDataScanner(inputBuffer.toString()); break; case SerialPortEvent.BI:; //-- Break Received } } """ How can I do what you write ? ( maybe a simple ex ? ) PS : I don't know the PDF417 size (could be, for example, 338 char, or 500 ... ; what I know is that it can't be more than 800 char) Thanks in advance. Best regards. Trent Jarvi a ?crit : > 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 Martin.Oberhuber at windriver.com Mon Nov 5 08:47:50 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 5 Nov 2007 16:47:50 +0100 Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> Hi Trent, are the interestes of hobbyists really so different from commercial ones? Both should be interested in high quality and innovation the like. I haven't seen too many Open Source projects from the "inside" but those that I have seen did not have separate mailing lists for quality/testing/qa versus innovation/development. What I have seen with the Open Source projects that one would call "successful" is a good deal of process around automated builds, automated unit tests, predictable release dates and milestones, and policies around commiting/contributing/reviewing changes. I think that all of these benefit commercial users and hobbyists the like. If you were just asking about who's interested in discussing changes to foster more quality, count me in. I'm just not sure whether discussing these on a separate mailing list or other channel is the right thing to do. Cheers, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From toupsz at cs.tamu.edu Tue Nov 6 14:27:04 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 15:27:04 -0600 Subject: [Rxtx] reading TTL level signals from serial? Message-ID: Dear RXTX community- I've been using RXTX to handle communicating with several hardware devices in Java (a GPS and some custom audio circuitry for my dissertation work). I have a new, high-accuracy GPS which only communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there any way to communicate with this device using RXTX, perhaps by modding the native code for Windows? If so, does anyone have any tips on how to do it? Has it perhaps already been done? Another option is for me to invert / amplify the signal in hardware, but this is difficult for me to pull off due to the sensitivity of the electronics involved...I'll likely end up using a much less accurate piece of equipment rather than go that far! If anyone could help out, I'd really appreciate it! Thanks! -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/b6c59c2b/attachment-0022.html From netbeans at gatworks.com Tue Nov 6 14:55:22 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 06 Nov 2007 16:55:22 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: Message-ID: <4730E2CA.3090009@gatworks.com> This is really a hardware issue. Is there any device ( ie the serial port ) on your computer that will accept the voltage signals ( and load ) that your device produces? Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it happen safely ( ie u dont cook the GPS device ) I have a new, high-accuracy GPS which only > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there > any way to communicate with this device using RXTX, From toupsz at cs.tamu.edu Tue Nov 6 15:14:01 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 16:14:01 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4730E2CA.3090009@gatworks.com> References: <4730E2CA.3090009@gatworks.com> Message-ID: Actually, the device runs over USB, but shows up as a virtual serial port and is outputting these signals. The software that comes with the device (a u-blox ANTARIS 4 eval kit) is able to communicate. RXTX is able to detect and properly configure the port, but does not get any of the data from it. :-/ It seems like there must be some way to do it (obviously, ublox knows how)... -Zach On Nov 6, 2007 3:55 PM, U. George wrote: > This is really a hardware issue. > Is there any device ( ie the serial port ) on your computer that will > accept the voltage signals ( and load ) that your device produces? > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it > happen safely ( ie u dont cook the GPS device ) > > > I have a new, high-accuracy GPS which only > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there > > any way to communicate with this device using RXTX, > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/15ae7a0b/attachment-0022.html From keithvz at verizon.net Tue Nov 6 16:16:55 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 06 Nov 2007 18:16:55 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> Message-ID: <4730F5E7.1030704@verizon.net> Zach Toups wrote: > On Nov 6, 2007 3:55 PM, U. George > wrote: > > This is really a hardware issue. > Is there any device ( ie the serial port ) on your computer that will > accept the voltage signals ( and load ) that your device produces? > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it > happen safely ( ie u dont cook the GPS device ) > > > I have a new, high-accuracy GPS which only > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is > there > > any way to communicate with this device using RXTX, > _______________________________________________ As UGeorge intimated, it's a hardware issue. If your device outputs TTL level voltages, and your USB to serial converter is RS-232, then you've got a physical hardware differences. Inverted leads and voltage issues are mainly the problem. MAXIM makes a neat little chip called the MAX233 (better than the 232, no extern caps required) You can't solve this in software. Now, there are TTL level compatible USB to serial converters available, I happen to be using one right now. This unit below is from a UK company (there might be sources in the US) http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm Parallax makes one that does 3.3 and 5v http://www.parallax.com/detail.asp?product_id=32201 (but only supports RX, TX, GND, AND DTR towards device) (i've tested a variant of the unit above, and it works with RXTX) In both cases, you'll need some creative wiring depending on the interface on your GPS. Hope this helps Keith From toupsz at cs.tamu.edu Tue Nov 6 16:53:01 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 17:53:01 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4730F5E7.1030704@verizon.net> References: <4730E2CA.3090009@gatworks.com> <4730F5E7.1030704@verizon.net> Message-ID: Yeah...I used an FTDI chip to handle USB/serial conversion on the audio equipment I built. I'm leery of trying to build a board for this ublox GPS due to all the grounding/shielding issues around it. Anyway, I apreciate the help...just sad that I can't handle the problem in software! Ublox did send me the source code for their USB drivers...but as a Java programmer, it's a bit tough for me to sort out. ;) Thanks again! -Zach On Nov 6, 2007 5:16 PM, Keith Monahan wrote: > Zach Toups wrote: > > > On Nov 6, 2007 3:55 PM, U. George > > wrote: > > > > This is really a hardware issue. > > Is there any device ( ie the serial port ) on your computer that > will > > accept the voltage signals ( and load ) that your device produces? > > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make > it > > happen safely ( ie u dont cook the GPS device ) > > > > > > I have a new, high-accuracy GPS which only > > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is > > there > > > any way to communicate with this device using RXTX, > > _______________________________________________ > > As UGeorge intimated, it's a hardware issue. > > If your device outputs TTL level voltages, and your USB to serial > converter is RS-232, then you've got a physical hardware differences. > Inverted leads and voltage issues are mainly the problem. MAXIM makes a > neat little chip called the MAX233 (better than the 232, no extern caps > required) > > You can't solve this in software. > > Now, there are TTL level compatible USB to serial converters available, > I happen to be using one right now. > > This unit below is from a UK company (there might be sources in the US) > > http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm > > Parallax makes one that does 3.3 and 5v > > http://www.parallax.com/detail.asp?product_id=32201 > (but only supports RX, TX, GND, AND DTR towards device) > > (i've tested a variant of the unit above, and it works with RXTX) > > In both cases, you'll need some creative wiring depending on the > interface on your GPS. > > Hope this helps > > Keith > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/06e88ad4/attachment-0022.html From netbeans at gatworks.com Tue Nov 6 17:14:01 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 06 Nov 2007 19:14:01 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> <4730F5E7.1030704@verizon.net> Message-ID: <47310349.5000406@gatworks.com> what gps chipset do u have? > Ublox did send me the source code for their USB drivers...but as a Java > programmer, it's a bit tough for me to sort out. ;) From Steffen.DETTMER at ingenico.com Wed Nov 7 03:10:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 7 Nov 2007 11:10:01 +0100 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> Message-ID: <20071107101000.GN10978@elberon.bln.de.ingenico.com> * Zach Toups wrote on Tue, Nov 06, 2007 at 16:14 -0600: > Actually, the device runs over USB, but shows up as a virtual > serial port and is outputting these signals. Ahh, so what you want is to use rxtx on the serial port that is created by the driver and mapped maybe as some COM8 or whatever? I this case then IMHO it would be no hardware question but maybe a problem in your application, or some driver or indeed a rxtx issue. > The software that > comes with the device (a u-blox ANTARIS 4 eval kit) is able to > communicate. Is it sure that this software is really using the virtual serial port and only this port? oki, Steffen -- About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Wed Nov 7 04:59:10 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 06:59:10 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <20071107101000.GN10978@elberon.bln.de.ingenico.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> Message-ID: <4731A88E.6080705@gatworks.com> >> The software that >> comes with the device (a u-blox ANTARIS 4 eval kit) is able to >> communicate. > > Is it sure that this software is really using the virtual serial > port and only this port? > I have tried to read the docs. I have yet to find any explanation on a (windoz) device driver for this device ( the usb device ). That magic is not explained. For a developer thats important magic. Maybe a call to their support team is in order? From netbeans at gatworks.com Wed Nov 7 05:01:38 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 07:01:38 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <20071107101000.GN10978@elberon.bln.de.ingenico.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> Message-ID: <4731A922.7@gatworks.com> Steffen DETTMER wrote: > * Zach Toups wrote on Tue, Nov 06, 2007 at 16:14 -0600: >> Actually, the device runs over USB, but shows up as a virtual BTW: it seems that I am not getting all the Rxtx mail. Is there still a problem? From toupsz at cs.tamu.edu Wed Nov 7 07:36:20 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Wed, 7 Nov 2007 08:36:20 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4731A88E.6080705@gatworks.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> <4731A88E.6080705@gatworks.com> Message-ID: When I emailed them about this issue, they sent me their WinCE drivers, which are apparently based on this open source driver: http://www.yetanotherhomepage.com/j7xx/j7xx.html?/j7xx/software/util/usbdriver.html These include srcdll, and x86 subfolders, though it's not 100% clear to me that these are useful. The ublox communication suite appears to only communicate with serial ports...I've communicated with the ublox on two different comm ports (one with the serial adapter plugged into the serial port, one with the main USB connection), as well as a Garmin bluetooth GPS (which comes up as a bluetooth serial device). I'm not well versed in code this close to the hardware, but it seems to me that if you're running a virtual serial port, then you're virtually controlling the "voltages" that come in on this "port"...so why would they be "ttl level"? :-/ Shouldn't the USB driver be able to interpret the signals in whatever way it wants and just supply software with the binary interpretation? Thanks for all the help, guys, it's really appreciated! -Zach On Nov 7, 2007 5:59 AM, U. George wrote: > > >> The software that > >> comes with the device (a u-blox ANTARIS 4 eval kit) is able to > >> communicate. > > > > Is it sure that this software is really using the virtual serial > > port and only this port? > > > > I have tried to read the docs. I have yet to find any explanation on a > (windoz) device driver for this device ( the usb device ). That magic > is not explained. For a developer thats important magic. Maybe a call > to their support team is in order? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071107/18a13314/attachment-0021.html From netbeans at gatworks.com Wed Nov 7 08:55:55 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 10:55:55 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> <4731A88E.6080705@gatworks.com> Message-ID: <4731E00B.9030902@gatworks.com> There are 2 components to talking to hardware. There is the electrical specification, and then there is the software specification. there is the rs232 specification, parallel port specification, and the USB electrical specification. Generally these are used to plug in the various devices, and hook up electrically. Then there is the software side. There is the device driver, a software component that sits somewhere in the kernel that handles the USB ( in your case ) controller. The device driver generally does not care about the electrical component. There are various chips that handle USB signals, and these chips have I/O addresses so that signals and data can be properly routed. There is also the side that communicates to the user via the COM port device-name. The device driver that you mentioned is for the "Support PL2303 serial chip". This device driver, which hopefully works, handles the USB chip, and eventually recognzes the gps device, and hopefully creates an COM port so the user can open up and communicate. These are a lot of "HOPES". Since u have the web address of the device driver, and developer, I would think that the developer, and any docs, might be better able to help u to first determine if the GPS device is recognized, and the COM port ( maybe its called by another name ) is created, as per documentation. > > These include srcdll, and x86 subfolders, though it's not 100% clear to > me that these are useful. From tjarvi at qbang.org Sat Nov 10 17:46:13 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Nov 2007 17:46:13 -0700 (MST) Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 5 Nov 2007, Oberhuber, Martin wrote: > Hi Trent, > > are the interestes of hobbyists really so different > from commercial ones? Both should be interested in > high quality and innovation the like. > > I haven't seen too many Open Source projects from the > "inside" but those that I have seen did not have > separate mailing lists for quality/testing/qa > versus innovation/development. > > What I have seen with the Open Source projects that > one would call "successful" is a good deal of > process around automated builds, automated unit > tests, predictable release dates and milestones, > and policies around commiting/contributing/reviewing > changes. > > I think that all of these benefit commercial users > and hobbyists the like. > > If you were just asking about who's interested in > discussing changes to foster more quality, count > me in. I'm just not sure whether discussing these > on a separate mailing list or other channel is the > right thing to do. > Hi Martin, There are two issues I'm thinking about. The first is the generic unit testing and quality initiatives required to move rxtx forward. The second is the inevitable fact that rxtx connects to external hardware. The discussion deals with a different set of problems. Here is a simple example of what I'm getting at. We have the capability of setting custom baud rates in rxtx. We may be interested in seeing regressions in rxtx, the C library or the kernel. Some people may be doing some tests with loopback connections. These will always work even if the baud rate is not set to the expected value. Some people may use null modems between two ports. This may be able to catch the problem but not always. Will the build machines be able to test this? (no - for a few reasons) Will people be trying to catch these type of regressions? (yes) What type of coverage does the community have in the end? (?) We could include the discussions in the same list or another equally open list that may be of interest to some folks that deal with these types of problems on a regular basis. -- Trent Jarvi tjarvi at qbang.org From timlow84 at gmail.com Mon Nov 12 00:31:17 2007 From: timlow84 at gmail.com (Timothy Low) Date: Mon, 12 Nov 2007 15:31:17 +0800 Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> Message-ID: <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> ---------- Forwarded message ---------- From: Timothy Low Date: Nov 12, 2007 3:02 PM Subject: Building RXTX From Source To: taj at www.linux.org.uk Cc: ferdinand.tang at tangs.net, Timothy Low , chweehuat.ng at tangs.net Hi Trent, I tried building RXTX from source, and I got this error. I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm trying to get the necessary ".so" files to use for my serial port communication through java. My linux kernal information is: *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 x86_64 x86_64 x86_64 GNU/Linux* I'll most glad if you can provide me some direction on this. Thanks ! ---------------- [root at smsgateway rxtx-2.0-7pre1]# ./configure checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu configure: WARNING: Trying libtool. If the following fails install libtool checking for gcc... gcc checking for C compiler default output... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking for ld used by GCC... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking for a sed that does not truncate output... /bin/sed checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking command to parse /usr/bin/nm -B output... ok checking how to run the C preprocessor... gcc -E checking for egrep... grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for ranlib... ranlib checking for strip... strip checking for objdir... .libs checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.lo... yes checking if gcc supports -fno-rtti -fno-exceptions... yes checking whether the linker (/usr/bin/ld) supports shared libraries... yes checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking dynamic linker characteristics... GNU/Linux ld.so checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no checking whether -lc should be explicitly linked in... no creating libtool checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking for style of include used by make... GNU checking dependency style of gcc... none checking fcntl.h usability... yes checking fcntl.h presence... yes checking for fcntl.h... yes checking sys/fcntl.h usability... yes checking sys/fcntl.h presence... yes checking for sys/fcntl.h... yes checking sys/file.h usability... yes checking sys/file.h presence... yes checking for sys/file.h... yes checking sys/time.h usability... yes checking sys/time.h presence... yes checking for sys/time.h... yes checking sys/signal.h usability... yes checking sys/signal.h presence... yes checking for sys/signal.h... yes checking signal.h usability... yes checking signal.h presence... yes checking for signal.h.. . yes checking termios.h usability... yes checking termios.h presence... yes checking for termios.h... yes checking asm/termbits.h usability... yes checking asm/termbits.h presence... yes checking for asm/termbits.h... yes checking grp.h usability... yes checking grp.h presence... yes checking for grp.h... yes checking pwd.h usability... yes checking pwd.h presence... yes checking for pwd.h... yes checking whether gcc needs -traditional... no checking whether to enable maintainer-specific portions of Makefiles... no /usr/java/jdk1.5.0_13 configure: WARNING: using JAVA_HOME environmental variable adjusted java.home is /usr/java/jdk1.5.0_13 checking os.name Linux checking os.arch i386 checking java.vendor Sun Microsystems Inc. checking java.version 1.5.0_13 checking os.version 2.6.18-8.el5xen comm.jar appears to be installed already. conftest.c: In function 'main': conftest.c:6: warning: incompatible implicit declaration of built-in function 'printf' conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:6: error: (Each undeclared identifier is reported only once conftest.c:6: error: for each function it appears in.) conftest.c:6: error: expected ')' before string constant conftest.c:7: warning: incompatible implicit declaration of built-in function 'exit' ./configure: line 9649: ./conftest: No such file or directory ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected conftest.c: In function 'main': conftest.c:5: warning: incompatible implicit declaration of built-in function 'printf' conftest.c:10: warning: incompatible implicit declaration of built-in function 'exit' configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status : config.h is unchanged config.status: executing depfiles commands [root at smsgateway rxtx-2.0-7pre1]# make install /usr/java/jdk1.5.0_13/bin/javac -classpath .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d /home/jboss/sources/rxtx- 2.0-7pre1/ -O /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java /home/jboss/sources/rxtx-2.0-7pre1/./src/UnSupportedLoggerException.java /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o /home/jboss/sources/rxtx-2.0-7pre1/x86_64-unknown-linux-gnu/SerialImp.lo /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'init_threads': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: cast from pointer to integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_nativeDrain': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: cast to pointer from integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'read_byte_array': /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: cast to pointer from integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_readArray': /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: comparison is always false due to limited range of data type /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_readTerminatedArray': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: comparison is always false due to limited range of data type mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial- 2.0.7pre1.* gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so -o .libs/librxtxSerial-2.0.7pre1.so (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.0.7pre1.so librxtxSerial.so) creating librxtxSerial.la (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la librxtxSerial.la) gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/ParallelImp.lo /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function 'Java_javax_comm_LPRPort_readArray': /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: comparison is always false due to limited range of data type rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* .libs/librxtxParallel-2.0.7pre1.* gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so -o .libs/librxtxParallel- 2.0.7pre1.so (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.0.7pre1.so librxtxParallel.so) creating librxtxParallel.la (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la librxtxParallel.la) make all-am make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' libtool: install: `x86_64-unknown-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 ------------- Regards, Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071112/27758c3c/attachment-0017.html From tjarvi at qbang.org Mon Nov 12 01:02:09 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Nov 2007 01:02:09 -0700 (MST) Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> Message-ID: On Mon, 12 Nov 2007, Timothy Low wrote: > > Hi Trent, Hi Tim, Comments are inline. As I mentioned off the list, rxtx 2.0 is on the edge of deprecation. We can get it working but this is not the path of least resistance for future work. You will probably need to bounce another round of questions off the list. The following is intended to isolate the problem. > > I tried building RXTX from source, and I got this error. > > > I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm trying > to get the necessary ".so" files to use for my serial port communication > through java. > My linux kernal information is: > > *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 x86_64 > x86_64 x86_64 GNU/Linux* > > I'll most glad if you can provide me some direction on this. Thanks ! > > ---------------- > [root at smsgateway rxtx-2.0-7pre1]# ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > checking for C compiler default output... a.out > checking whether the C compiler works... yes > checking whether we are cross compiling... no > checking for suffix of executables... > checking for suffix of object files... o > checking whether we are using the GNU C compiler... yes > checking whether gcc accepts -g... yes > checking for gcc option to accept ANSI C... none needed > checking for ld used by GCC... /usr/bin/ld > checking if the linker (/usr/bin/ld) is GNU ld... yes > checking for /usr/bin/ld option to reload object files... -r > checking for BSD-compatible nm... /usr/bin/nm -B > checking for a sed that does not truncate output... /bin/sed > checking whether ln -s works... yes > checking how to recognise dependent libraries... pass_all > checking command to parse /usr/bin/nm -B output... ok > checking how to run the C preprocessor... gcc -E > checking for egrep... grep -E > checking for ANSI C header files... yes > checking for sys/types.h... yes > checking for sys/stat.h... yes > checking for stdlib.h... yes > checking for string.h... yes > checking for memory.h... yes > checking for strings.h... yes > checking for inttypes.h... yes > checking for stdint.h... yes > checking for unistd.h... yes > checking dlfcn.h usability... yes > checking dlfcn.h presence... yes > checking for dlfcn.h... yes > checking for ranlib... ranlib > checking for strip... strip > checking for objdir... .libs > checking for gcc option to produce PIC... -fPIC > checking if gcc PIC flag -fPIC works... yes > checking if gcc static flag -static works... yes > checking if gcc supports -c -o file.o... yes > checking if gcc supports -c -o file.lo... yes > checking if gcc supports -fno-rtti -fno-exceptions... yes > checking whether the linker (/usr/bin/ld) supports shared libraries... yes > checking how to hardcode library paths into programs... immediate > checking whether stripping libraries is possible... yes > checking dynamic linker characteristics... GNU/Linux ld.so > checking if libtool supports shared libraries... yes > checking whether to build shared libraries... yes > checking whether to build static libraries... no > checking whether -lc should be explicitly linked in... no > creating libtool > checking for a BSD-compatible install... /usr/bin/install -c > checking whether build environment is sane... yes > checking for gawk... gawk > checking whether make sets $(MAKE)... yes > checking for style of include used by make... GNU > checking dependency style of gcc... none > checking fcntl.h usability... yes > checking fcntl.h presence... yes > checking for fcntl.h... yes > checking sys/fcntl.h usability... yes > checking sys/fcntl.h presence... yes > checking for sys/fcntl.h... yes > checking sys/file.h usability... yes > checking sys/file.h presence... yes > checking for sys/file.h... yes > checking sys/time.h usability... yes > checking sys/time.h presence... yes > checking for sys/time.h... yes > checking sys/signal.h usability... yes > checking sys/signal.h presence... yes > checking for sys/signal.h... yes > checking signal.h usability... yes > checking signal.h presence... yes > checking for signal.h.. . yes > checking termios.h usability... yes > checking termios.h presence... yes > checking for termios.h... yes > checking asm/termbits.h usability... yes > checking asm/termbits.h presence... yes > checking for asm/termbits.h... yes > checking grp.h usability... yes > checking grp.h presence... yes > checking for grp.h... yes > checking pwd.h usability... yes > checking pwd.h presence... yes > checking for pwd.h... yes > checking whether gcc needs -traditional... no > checking whether to enable maintainer-specific portions of Makefiles... no > /usr/java/jdk1.5.0_13 > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /usr/java/jdk1.5.0_13 > checking os.name Linux > checking os.arch i386 > checking java.vendor Sun Microsystems Inc. > checking java.version 1.5.0_13 > checking os.version 2.6.18-8.el5xen > comm.jar appears to be installed already. > conftest.c: In function 'main': > conftest.c:6: warning: incompatible implicit declaration of built-in > function 'printf' > conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:6: error: (Each undeclared identifier is reported only once > conftest.c:6: error: for each function it appears in.) > conftest.c:6: error: expected ')' before string constant This is an outdated kernel version check for when headers and kernels could cause problems for rxtx. If we made it past this, then you are OK. > conftest.c:7: warning: incompatible implicit declaration of built-in > function 'exit' > ./configure: line 9649: ./conftest: No such file or directory > ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected It blew up but continues.. > conftest.c: In function 'main': > conftest.c:5: warning: incompatible implicit declaration of built-in > function 'printf' > conftest.c:10: warning: incompatible implicit declaration of built-in > function 'exit' > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status : config.h is unchanged > config.status: executing depfiles commands > [root at smsgateway rxtx-2.0-7pre1]# make install > /usr/java/jdk1.5.0_13/bin/javac -classpath > .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d > /home/jboss/sources/rxtx- 2.0-7pre1/ -O > /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java > /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/UnSupportedLoggerException.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java > Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or > overrides a deprecated API. > Note: Recompile with -Xlint:deprecation for details. > /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* The java jar should be fine now. You may need to change the source files as mentioned below. > gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. > -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g > -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o > /home/jboss/sources/rxtx-2.0-7pre1/x86_64-unknown-linux-gnu/SerialImp.lo > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'init_threads': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: cast > from pointer to integer of different size > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_nativeDrain': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: cast to > pointer from integer of different size > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'read_byte_array': > /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: cast to > pointer from integer of different size As I recall, this was caused by pointers (now 64 bit rather than 32 bit) being stored in java ints (jints). I would look at the diff between the CVS 2.1 SerialImp.c and RXTXPort.java files against 2.0. We did fix those issues. You have a .so file but the different pointer sizes will cause runtime errors. > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_readArray': > /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: > comparison is always false due to limited range of data type > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_readTerminatedArray': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: > comparison is always false due to limited range of data type > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial- > 2.0.7pre1.* > gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so -o > .libs/librxtxSerial-2.0.7pre1.so > (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.0.7pre1.so > librxtxSerial.so) > creating librxtxSerial.la > (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la > librxtxSerial.la) > gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. > -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g > -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o > /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/ParallelImp.lo > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function > 'Java_javax_comm_LPRPort_readArray': > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: > comparison is always false due to limited range of data type > rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* > .libs/librxtxParallel-2.0.7pre1.* > gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so -o > .libs/librxtxParallel- 2.0.7pre1.so > (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.0.7pre1.so > librxtxParallel.so) > creating librxtxParallel.la > (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la > librxtxParallel.la) > make all-am > make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' > make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' > libtool: install: `x86_64-unknown-linux-gnu' must be an absolute directory > name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 A libtool change? Assuming you ran configure && make install in /home/jboss/sources/rxtx- 2.0-7pre1, libtool is looking for /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/.libs/librxtxSerial-2.0.7pre1.so. I think you have this? The file is just being copied to ~JAVA/jre/lib/$(JAVA_ARCH). -- Trent Jarvi tjarvi at qbang.org From sarah_662005 at yahoo.com Mon Nov 12 16:10:28 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Mon, 12 Nov 2007 15:10:28 -0800 (PST) Subject: [Rxtx] [urgent] device's power off detection Message-ID: <766782.10076.qm@web55803.mail.re3.yahoo.com> Hello all, I have a small application built on top of rxtx api. This application can retrieve the incoming data from a device through a port. The device can be powered off after the port get closed from the application. I have been trying a couple of hours to find a way to detect the power switching from device. If anyone knows how to handle it through rxtx, could you please give me a help? Thank you very much. r, Sara ____________________________________________________________________________________ Get easy, one-click access to your favorites. Make Yahoo! your homepage. http://www.yahoo.com/r/hs -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071112/4599f3ec/attachment-0016.html From netbeans at gatworks.com Mon Nov 12 17:52:22 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 12 Nov 2007 19:52:22 -0500 Subject: [Rxtx] [urgent] device's power off detection In-Reply-To: <766782.10076.qm@web55803.mail.re3.yahoo.com> References: <766782.10076.qm@web55803.mail.re3.yahoo.com> Message-ID: <4738F546.5010101@gatworks.com> Not sure what u are asking for. Are u asking for a way to detect if the device is OFF? Are u asking how to power off the device - via software ? Is it a Serial device? is it a parallel device? is it a usb device? Sara Hugh wrote: > Hello all, > I have a small application built on top of rxtx api. This application > can retrieve the incoming data from a device through a port. The device > can be powered off after the port get closed from the application. I > have been trying a couple of hours to find a way to detect the power > switching from device. If anyone knows how to handle it through rxtx, > could you please give me a help? Thank you very much. From tjarvi at qbang.org Mon Nov 12 22:48:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Nov 2007 22:48:11 -0700 (MST) Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711120225x562db8cbxb750767ade3b0d73@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> <900c6ba90711120031p66edc001ted76f7ba24e34b98@mail.gmail.com> <900c6ba90711120225x562db8cbxb750767ade3b0d73@mail.gmail.com> Message-ID: Hi Tim, The gnu.io namespace looks just like the javax.comm 2.0 namespace. There are additional (discouraged) undocumented methods in gnu.io that you need not use. We just used the different namespace to avoid poluting Sun's by mistake and to make sure we stayed off any potential licensing related radar. Usuaully, you just change your imports and make sure you do not use the javax.comm namespace for anything like exception handling. As I mentioned off the list, there are no issues with rxtx going through the JSR process to be more Sun friendly other than time. rxtx has no hidden intentions there; anything that does not work like CommAPI 2.0 documented is a bug. The reason we do not support CommAPI 2.1 is technical in nature and is in the list archives as well as the front page of www.rxtx.org. On Mon, 12 Nov 2007, Timothy Low wrote: > Hi Trent, > > I'll move to use a JDK1.5 64-bit version... but do I need to make any source > code changes to use the package (gnu.io) in the RTXTcomm.jar instead of the > ones from the javacomm api ? > > > Regards, > Tim > > On Nov 12, 2007 5:22 PM, Trent Jarvi wrote: > >> >> Hi Tim, >> >> I see a couple things here. >> >> First your jdk is for i686 yet the library is compiled on a x86_64 >> machine. You may try passing configure the --target=i686-unknown-linux to >> try using the i686 backend to gcc if it is available. Or move to the 64 >> bit jdk. >> >> The other error I see is again the moved UTF_RELEASE define that we need >> to fix. You can probably get around that with: >> >> make -DUTF_RELEASE=`uname -r` >> >> even more simple would be to just specify the serial library which should >> be in configure --help. >> >> You can remove the UTF_RELEASE check from configure by editing >> configure.in, searching for the simple C program check and deleting it. >> Running autoconf after that will regenerate a new configure without the >> check. >> >> Note that you should remove the previous native libraries >> (librxtxSerial.so) when moving from rxtx 2.0 to 2.1. These are compiled >> for different namespaces (javax.comm/gnu.io). >> >> On Mon, 12 Nov 2007, Timothy Low wrote: >> >>> *Hi Trent, >>> >>> I moved on to rxtx 2.1.7r2, and updated my jre to 1.6.0 (64-bit)... I >> tried >>> the following 2 methods: >>> >>> (1) using the rxtx 2.1.7 binaries from the RXTX website* >>> *Are these binaries suitable for a 64-bit OS ? There mentioning of the >>> gnu.io that you've talked about previously...* >>> ------ >>> [root at smsgateway sources]# java -Djava.library.path=/usr/lib PortLister >>> Experimental: JNI_OnLoad called. >>> >>> java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion >>> ()Ljava/lang/String; >>> at gnu.io.RXTXCommDriver.nativeGetVersion(Native Method) >>> at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:85) >>> at java.lang.Class.forName0(Native Method) >>> at java.lang.Class.forName(Unknown Source) >>> at javax.comm.CommPortIdentifier.loadDriver( >> CommPortIdentifier.java >>> :237) >>> at javax.comm.CommPortIdentifier.(CommPortIdentifier.java >>> :109) >>> at PortLister.(PortLister.java:6) >>> at PortLister.main(PortLister.java:25) >>> Exception in thread "main" java.lang.UnsatisfiedLinkError: >>> com.sun.comm.SunrayInfo.isSessionActive()Z >>> at com.sun.comm.SunrayInfo.isSessionActive(Native Method) >>> at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java >> :155) >>> at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java >>> :100) >>> at javax.comm.CommPortIdentifier.(CommPortIdentifier.java >>> :138) >>> at PortLister.(PortLister.java:6) >>> at PortLister.main(PortLister.java:25) >>> >>> ------ >>> >>> (2) compiling the rxtx 2.1.7 from source >>> *but i got the following error while running ./configure and make all* >>> >>> ------ >>> [root at smsgateway rxtx-2.1-7r2]# ./configure >>> checking build system type... x86_64-unknown-linux-gnu >>> checking host system type... x86_64-unknown-linux-gnu >>> checking target system type... x86_64-unknown-linux-gnu >>> configure: WARNING: Trying libtool. If the following fails install >> libtool >>> checking for gcc... gcc >>> checking for C compiler default output file name... a.out >>> checking whether the C compiler works... yes >>> checking whether we are cross compiling... no >>> checking for suffix of executables... >>> checking for suffix of object files... o >>> checking whether we are using the GNU C compiler... yes >>> checking whether gcc accepts -g... yes >>> checking for gcc option to accept ANSI C... none needed >>> checking for a sed that does not truncate output... /bin/sed >>> checking for egrep... grep -E >>> checking for ld used by gcc... /usr/bin/ld >>> checking if the linker (/usr/bin/ld) is GNU ld... yes >>> checking for /usr/bin/ld option to reload object files... -r >>> checking for BSD-compatible nm... /usr/bin/nm -B >>> checking whether ln -s works... yes >>> checking how to recognise dependent libraries... pass_all >>> checking how to run the C preprocessor... gcc -E >>> checking for ANSI C header files... yes >>> checking for sys/types.h... yes >>> checking for sys/stat.h... yes >>> checking for stdlib.h... yes >>> checking for string.h... yes >>> checking for memory.h... yes >>> checking for strings.h... yes >>> checking for inttypes.h... yes >>> checking for stdint.h... yes >>> checking for unistd.h... yes >>> checking dlfcn.h usability... yes >>> checking dlfcn.h presence... yes >>> checking for dlfcn.h... yes >>> checking for g++... g++ >>> checking whether we are using the GNU C++ compiler... yes >>> checking whether g++ accepts -g... yes >>> checking how to run the C++ preprocessor... g++ -E >>> checking for g77... no >>> checking for f77... no >>> checking for xlf... no >>> checking for frt... no >>> checking for pgf77... no >>> checking for fort77... no >>> checking for fl32... no >>> checking for af77... no >>> checking for f90... no >>> checking for xlf90... no >>> checking for pgf90... no >>> checking for epcf90... no >>> checking for f95... f95 >>> checking whether we are using the GNU Fortran 77 compiler... yes >>> checking whether f95 accepts -g... yes >>> checking the maximum length of command line arguments... 32768 >>> checking command to parse /usr/bin/nm -B output from gcc object... ok >>> checking for objdir... .libs >>> checking for ar... ar >>> checking for ranlib... ranlib >>> checking for strip... strip >>> checking if gcc static flag works... yes >>> checking if gcc supports -fno-rtti -fno-exceptions... no >>> checking for gcc option to produce PIC... -fPIC >>> checking if gcc PIC flag -fPIC works... yes >>> checking if gcc supports -c -o file.o... yes >>> checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking whether -lc should be explicitly linked in... no >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> checking if libtool supports shared libraries... yes >>> checking whether to build shared libraries... yes >>> checking whether to build static libraries... no >>> configure: creating libtool >>> appending configuration tag "CXX" to libtool >>> checking for ld used by g++... /usr/bin/ld -m elf_x86_64 >>> checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes >>> checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking for g++ option to produce PIC... -fPIC >>> checking if g++ PIC flag -fPIC works... yes >>> checking if g++ supports -c -o file.o... yes >>> checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> appending configuration tag "F77" to libtool >>> checking if libtool supports shared libraries... yes >>> checking whether to build shared libraries... yes >>> checking whether to build static libraries... no >>> checking for f95 option to produce PIC... -fPIC >>> checking if f95 PIC flag -fPIC works... yes >>> checking if f95 supports -c -o file.o... yes >>> checking whether the f95 linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> checking for a BSD-compatible install... /usr/bin/install -c >>> checking whether build environment is sane... yes >>> checking for gawk... gawk >>> checking whether make sets $(MAKE)... yes >>> checking for style of include used by make... GNU >>> checking dependency style of gcc... none >>> checking dependency style of g++... none >>> checking fcntl.h usability... yes >>> checking fcntl.h presence... yes >>> checking for fcntl.h... yes >>> checking sys/fcntl.h usability... yes >>> checking sys/fcntl.h presence... yes >>> checking for sys/fcntl.h... yes >>> checking sys/file.h usability... yes >>> checking sys/file.h presence... yes >>> checking for sys/file.h... yes >>> checking sys/time.h usability... yes >>> checking sys/time.h presence... yes >>> checking for sys/time.h... yes >>> checking sys/signal.h usability... yes >>> checking sys/signal.h presence... yes >>> checking for sys/signal.h... yes >>> checking signal.h usability... yes >>> checking signal.h presence... yes >>> checking for signal.h... yes >>> checking termios.h usability... yes >>> checking termios.h presence... yes >>> checking for termios.h... yes >>> checking grp.h usability... yes >>> checking grp.h presence... yes >>> checking for grp.h... yes >>> checking pwd.h usability... yes >>> checking pwd.h presence... yes >>> checking for pwd.h... yes >>> checking whether gcc needs -traditional... no >>> checking whether to enable maintainer-specific portions of Makefiles... >> no >>> /usr/java/jdk1.5.0_13 >>> configure: WARNING: using JAVA_HOME environmental variable >>> adjusted java.home is /usr/java/jdk1.5.0_13 >>> checking os.name Linux >>> checking os.arch i386 >>> checking java.vendor Sun Microsystems Inc. >>> checking java.version 1.5.0_13 >>> checking os.version 2.6.18-8.el5xen >>> conftest.c: In function 'main': >>> conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this >> function) >>> conftest.c:8: error: (Each undeclared identifier is reported only once >>> conftest.c:8: error: for each function it appears in.) >>> conftest.c:8: error: expected ')' before string constant >>> ./configure: line 21462: ./conftest: No such file or directory >>> ./configure: line 21462: test: 2.6.18-8.el5xen: unary operator expected >>> configure: creating ./config.status >>> config.status: creating Makefile >>> config.status: creating config.h >>> config.status: executing depfiles commands >>> [root at smsgateway rxtx-2.1-7r2]# make install >>> /usr/java/jdk1.5.0_13/bin/javac -classpath .:/home/jboss/sources/rxtx- >>> >> 2.1-7r2:/home/jboss/sources/rxtx-2.1-7r2/src:/usr/java/jdk1.5.0_13/jre/lib/ext/RXTXcomm.jar-d >>> /home/jboss/sources/rxtx- >>> 2.1-7r2/ -O -source 1.3 -target 1.3 >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommDriver.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortEnumerator.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortIdentifier.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortOwnershipListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Configure.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2C.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/I2CPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/LPRPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/NoSuchPortException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/PortInUseException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Raw.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/RawPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RawPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RawPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/RS485PortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485PortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485Port.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXCommDriver.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXVersion.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPort.java >>> /home/jboss/sources/rxtx-2.1-7r2 >> /./src/UnsupportedCommOperationException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/UnSupportedLoggerException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Zystem.java >>> /usr/java/jdk1.5.0_13/bin/javah -classpath .:/home/jboss/sources/rxtx- >>> >> 2.1-7r2:/home/jboss/sources/rxtx-2.1-7r2/src:/usr/java/jdk1.5.0_13/jre/lib/ext/RXTXcomm.jar-d >>> x86_64-unknown-linux-gnu -jni `(for i in CommDriver CommPortEnumerator >>> CommPortIdentifier CommPort CommPortOwnershipListener Configure I2C >>> I2CPortEvent I2CPortEventListener I2CPort LPRPort NoSuchPortException >>> ParallelPortEvent ParallelPortEventListener ParallelPort >> PortInUseException >>> Raw RawPortEvent RawPortEventListener RawPort RS485 RS485PortEvent >>> RS485PortEventListener RS485Port RXTXCommDriver RXTXPort RXTXVersion >>> SerialPortEvent SerialPortEventListener SerialPort >>> UnsupportedCommOperationException UnSupportedLoggerException Zystem;do \ >>> if grep > /dev/null native.*\( /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/$i.java; then \ >>> echo gnu.io.$i; \ >>> fi; \ >>> done)` >>> /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialImp.c -o >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo; >>> \ >>> if [ "Serial" = "Serial" ]; >>> then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxSerial.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxSerial.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo; >> \ >>> fi; \ >>> ) >>> mkdir /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/.libs >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/SerialImp.o >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/fuserImp.o >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c: In function >> 'show_user': >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c:238: warning: cast >> from >>> pointer to integer of different size >>> gcc -shared /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/SerialImp.o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/fuserImp.o >>> -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7.so -o >> .libs/librxtxSerial- >>> 2.1-7.so >>> (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.1-7.so >>> librxtxSerial.so) >>> creating librxtxSerial.la >>> (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la >>> librxtxSerial.la) >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelImp.c -o >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/ParallelImp.lo; >>> \ >>> if [ "Parallel" = "Serial" ]; >>> then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxParallel.la -rpath >>> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/ParallelImp.lo >>> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxParallel.la -rpath >>> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/ParallelImp.lo; >>> \ >>> fi; \ >>> ) >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >>> /x86_64-unknown-linux-gnu/.libs/ParallelImp.o >>> gcc -shared /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/ParallelImp.o >>> -lpthread -Wl,-soname -Wl,librxtxParallel-2.1-7.so -o >>> .libs/librxtxParallel-2.1-7.so >>> (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.1-7.so >>> librxtxParallel.so) >>> creating librxtxParallel.la >>> (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la >>> librxtxParallel.la) >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo; >>> \ >>> if [ "I2C" = "Serial" ]; then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxI2C.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo >>> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxI2C.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo; >>> \ >>> fi; \ >>> ) >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/.libs/I2CImp.o >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c: In function >>> 'Java_gnu_io_I2CPort_Initialize': >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: 'UTS_RELEASE' >>> undeclared (first use in this function) >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: (Each >> undeclared >>> identifier is reported only once >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: for each >> function >>> it appears in.) >>> libtool: link: `/home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/I2CImp.lo' >>> is not a valid libtool object >>> make: *** [x86_64-unknown-linux-gnu/librxtxI2C.la] Error 1 >>> >>> ------ >>> >>> >>> >>> On Nov 12, 2007 4:02 PM, Trent Jarvi wrote: >>> >>>> On Mon, 12 Nov 2007, Timothy Low wrote: >>>>> >>>>> Hi Trent, >>>> >>>> Hi Tim, >>>> >>>> Comments are inline. As I mentioned off the list, rxtx 2.0 is on the >> edge >>>> of deprecation. We can get it working but this is not the path of >> least >>>> resistance for future work. >>>> >>>> You will probably need to bounce another round of questions off the >> list. >>>> The following is intended to isolate the problem. >>>> >>>>> >>>>> I tried building RXTX from source, and I got this error. >>>>> >>>>> >>>>> I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm >>>> trying >>>>> to get the necessary ".so" files to use for my serial port >> communication >>>>> through java. >>>>> My linux kernal information is: >>>>> >>>>> *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 >>>> x86_64 >>>>> x86_64 x86_64 GNU/Linux* >>>>> >>>>> I'll most glad if you can provide me some direction on this. Thanks ! >>>>> >>>>> ---------------- >>>>> [root at smsgateway rxtx-2.0-7pre1]# ./configure >>>>> checking build system type... x86_64-unknown-linux-gnu >>>>> checking host system type... x86_64-unknown-linux-gnu >>>>> checking target system type... x86_64-unknown-linux-gnu >>>>> configure: WARNING: Trying libtool. If the following fails install >>>> libtool >>>>> checking for gcc... gcc >>>>> checking for C compiler default output... a.out >>>>> checking whether the C compiler works... yes >>>>> checking whether we are cross compiling... no >>>>> checking for suffix of executables... >>>>> checking for suffix of object files... o >>>>> checking whether we are using the GNU C compiler... yes >>>>> checking whether gcc accepts -g... yes >>>>> checking for gcc option to accept ANSI C... none needed >>>>> checking for ld used by GCC... /usr/bin/ld >>>>> checking if the linker (/usr/bin/ld) is GNU ld... yes >>>>> checking for /usr/bin/ld option to reload object files... -r >>>>> checking for BSD-compatible nm... /usr/bin/nm -B >>>>> checking for a sed that does not truncate output... /bin/sed >>>>> checking whether ln -s works... yes >>>>> checking how to recognise dependent libraries... pass_all >>>>> checking command to parse /usr/bin/nm -B output... ok >>>>> checking how to run the C preprocessor... gcc -E >>>>> checking for egrep... grep -E >>>>> checking for ANSI C header files... yes >>>>> checking for sys/types.h... yes >>>>> checking for sys/stat.h... yes >>>>> checking for stdlib.h... yes >>>>> checking for string.h... yes >>>>> checking for memory.h... yes >>>>> checking for strings.h... yes >>>>> checking for inttypes.h... yes >>>>> checking for stdint.h... yes >>>>> checking for unistd.h... yes >>>>> checking dlfcn.h usability... yes >>>>> checking dlfcn.h presence... yes >>>>> checking for dlfcn.h... yes >>>>> checking for ranlib... ranlib >>>>> checking for strip... strip >>>>> checking for objdir... .libs >>>>> checking for gcc option to produce PIC... -fPIC >>>>> checking if gcc PIC flag -fPIC works... yes >>>>> checking if gcc static flag -static works... yes >>>>> checking if gcc supports -c -o file.o... yes >>>>> checking if gcc supports -c -o file.lo... yes >>>>> checking if gcc supports -fno-rtti -fno-exceptions... yes >>>>> checking whether the linker (/usr/bin/ld) supports shared libraries... >>>> yes >>>>> checking how to hardcode library paths into programs... immediate >>>>> checking whether stripping libraries is possible... yes >>>>> checking dynamic linker characteristics... GNU/Linux ld.so >>>>> checking if libtool supports shared libraries... yes >>>>> checking whether to build shared libraries... yes >>>>> checking whether to build static libraries... no >>>>> checking whether -lc should be explicitly linked in... no >>>>> creating libtool >>>>> checking for a BSD-compatible install... /usr/bin/install -c >>>>> checking whether build environment is sane... yes >>>>> checking for gawk... gawk >>>>> checking whether make sets $(MAKE)... yes >>>>> checking for style of include used by make... GNU >>>>> checking dependency style of gcc... none >>>>> checking fcntl.h usability... yes >>>>> checking fcntl.h presence... yes >>>>> checking for fcntl.h... yes >>>>> checking sys/fcntl.h usability... yes >>>>> checking sys/fcntl.h presence... yes >>>>> checking for sys/fcntl.h... yes >>>>> checking sys/file.h usability... yes >>>>> checking sys/file.h presence... yes >>>>> checking for sys/file.h... yes >>>>> checking sys/time.h usability... yes >>>>> checking sys/time.h presence... yes >>>>> checking for sys/time.h... yes >>>>> checking sys/signal.h usability... yes >>>>> checking sys/signal.h presence... yes >>>>> checking for sys/signal.h... yes >>>>> checking signal.h usability... yes >>>>> checking signal.h presence... yes >>>>> checking for signal.h.. . yes >>>>> checking termios.h usability... yes >>>>> checking termios.h presence... yes >>>>> checking for termios.h... yes >>>>> checking asm/termbits.h usability... yes >>>>> checking asm/termbits.h presence... yes >>>>> checking for asm/termbits.h... yes >>>>> checking grp.h usability... yes >>>>> checking grp.h presence... yes >>>>> checking for grp.h... yes >>>>> checking pwd.h usability... yes >>>>> checking pwd.h presence... yes >>>>> checking for pwd.h... yes >>>>> checking whether gcc needs -traditional... no >>>>> checking whether to enable maintainer-specific portions of >> Makefiles... >>>> no >>>>> /usr/java/jdk1.5.0_13 >>>>> configure: WARNING: using JAVA_HOME environmental variable >>>>> adjusted java.home is /usr/java/jdk1.5.0_13 >>>>> checking os.name Linux >>>>> checking os.arch i386 >>>>> checking java.vendor Sun Microsystems Inc. >>>>> checking java.version 1.5.0_13 >>>>> checking os.version 2.6.18-8.el5xen >>>>> comm.jar appears to be installed already. >>>>> conftest.c: In function 'main': >>>>> conftest.c:6: warning: incompatible implicit declaration of built-in >>>>> function 'printf' >>>>> conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this >>>> function) >>>>> conftest.c:6: error: (Each undeclared identifier is reported only once >>>>> conftest.c:6: error: for each function it appears in.) >>>>> conftest.c:6: error: expected ')' before string constant >>>> >>>> >>>> This is an outdated kernel version check for when headers and kernels >>>> could cause problems for rxtx. If we made it past this, then you are >> OK. >>>> >>>> >>>>> conftest.c:7: warning: incompatible implicit declaration of built-in >>>>> function 'exit' >>>>> ./configure: line 9649: ./conftest: No such file or directory >>>>> ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected >>>> >>>> It blew up but continues.. >>>> >>>>> conftest.c: In function 'main': >>>>> conftest.c:5: warning: incompatible implicit declaration of built-in >>>>> function 'printf' >>>>> conftest.c:10: warning: incompatible implicit declaration of built-in >>>>> function 'exit' >>>>> configure: creating ./config.status >>>>> config.status: creating Makefile >>>>> config.status: creating config.h >>>>> config.status : config.h is unchanged >>>>> config.status: executing depfiles commands >>>>> [root at smsgateway rxtx-2.0-7pre1]# make install >>>>> /usr/java/jdk1.5.0_13/bin/javac -classpath >>>>> .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/ -O >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1 >> /./src/UnSupportedLoggerException.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java >>>>> Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or >>>>> overrides a deprecated API. >>>>> Note: Recompile with -Xlint:deprecation for details. >>>>> /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* >>>> >>>> >>>> The java jar should be fine now. You may need to change the source >> files >>>> as mentioned below. >>>> >>>>> gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu >> -I. >>>>> -I/usr/java/jdk1.5.0_13/include >> -I/usr/java/jdk1.5.0_13/include/./linux/ >>>> -g >>>>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o >>>>> /home/jboss/sources/rxtx-2.0-7pre1 >> /x86_64-unknown-linux-gnu/SerialImp.lo >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'init_threads': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: >>>> cast >>>>> from pointer to integer of different size >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_nativeDrain': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: >>>> cast to >>>>> pointer from integer of different size >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'read_byte_array': >>>>> /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: >>>> cast to >>>>> pointer from integer of different size >>>> >>>> >>>> As I recall, this was caused by pointers (now 64 bit rather than 32 >> bit) >>>> being stored in java ints (jints). I would look at the diff between >> the >>>> CVS 2.1 SerialImp.c and RXTXPort.java files against 2.0. We >>>> did fix those issues. >>>> >>>> You have a .so file but the different pointer sizes will cause runtime >>>> errors. >>>> >>>> >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_readArray': >>>>> /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: >>>>> comparison is always false due to limited range of data type >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_readTerminatedArray': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: >>>>> comparison is always false due to limited range of data type >>>>> mkdir .libs >>>>> rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* >> .libs/librxtxSerial- >>>>> 2.0.7pre1.* >>>>> gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so-o >>>>> .libs/librxtxSerial-2.0.7pre1.so >>>>> (cd .libs && rm -f librxtxSerial.so && ln -s >> librxtxSerial-2.0.7pre1.so >>>>> librxtxSerial.so) >>>>> creating librxtxSerial.la >>>>> (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la >>>>> librxtxSerial.la) >>>>> gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu >> -I. >>>>> -I/usr/java/jdk1.5.0_13/include >> -I/usr/java/jdk1.5.0_13/include/./linux/ >>>> -g >>>>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o >>>>> /home/jboss/sources/rxtx- 2.0-7pre1 >>>> /x86_64-unknown-linux-gnu/ParallelImp.lo >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function >>>>> 'Java_javax_comm_LPRPort_readArray': >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: >>>>> comparison is always false due to limited range of data type >>>>> rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* >>>>> .libs/librxtxParallel-2.0.7pre1.* >>>>> gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so-o >>>>> .libs/librxtxParallel- 2.0.7pre1.so >>>>> (cd .libs && rm -f librxtxParallel.so && ln -s >>>> librxtxParallel-2.0.7pre1.so >>>>> librxtxParallel.so) >>>>> creating librxtxParallel.la >>>>> (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la >>>>> librxtxParallel.la) >>>>> make all-am >>>>> make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' >>>>> make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' >>>>> libtool: install: `x86_64-unknown-linux-gnu' must be an absolute >>>> directory >>>>> name >>>>> Try `libtool --help --mode=install' for more information. >>>>> make: *** [install] Error 1 >>>> >>>> A libtool change? Assuming you ran configure && make install in >>>> /home/jboss/sources/rxtx- 2.0-7pre1, libtool is looking for >>>> /home/jboss/sources/rxtx- >>>> 2.0-7pre1/x86_64-unknown-linux-gnu/.libs/librxtxSerial-2.0.7pre1.so. >>>> >>>> I think you have this? The file is just being copied to >>>> ~JAVA/jre/lib/$(JAVA_ARCH). >>>> >>>> -- >>>> Trent Jarvi >>>> tjarvi at qbang.org >>>> >>> >> > From guido.vogt at celsi.ch Tue Nov 13 00:28:01 2007 From: guido.vogt at celsi.ch (Guido Vogt) Date: Tue, 13 Nov 2007 08:28:01 +0100 Subject: [Rxtx] RTS Line can't be set Message-ID: <47395201.1050400@celsi.ch> I'm working on an Windows XP /SP2 System. Version of RXTX: 2.1.7. The serial line is connected to a modem. As I can see, the RTS-Line of the serial Port is inactive, when the port is opened (flowcontrol=none). Obviously, no data is coming from the modem. If I use the setRTS(true) command after open, the comport does not send out my data any more. This behaviour is regardless of flowcontrol. Anybody has an idea what do do? Thanks for help. From Martin.Oberhuber at windriver.com Tue Nov 13 08:58:23 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 13 Nov 2007 16:58:23 +0100 Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803880918@ism-mail03.corp.ad.wrs.com> Hi Trent, as said before, I like the idea of discussing such quality engineering issues, but why hide these away from the rest of the public? Anyways, if you do want to create a new mailing list for these kinds of things I'll happily subscribe. 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: Sunday, November 11, 2007 1:46 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: RE: [Rxtx] Quality Engineering with rxtx > > On Mon, 5 Nov 2007, Oberhuber, Martin wrote: > > > Hi Trent, > > > > are the interestes of hobbyists really so different > > from commercial ones? Both should be interested in > > high quality and innovation the like. > > > > I haven't seen too many Open Source projects from the > > "inside" but those that I have seen did not have > > separate mailing lists for quality/testing/qa > > versus innovation/development. > > > > What I have seen with the Open Source projects that > > one would call "successful" is a good deal of > > process around automated builds, automated unit > > tests, predictable release dates and milestones, > > and policies around commiting/contributing/reviewing > > changes. > > > > I think that all of these benefit commercial users > > and hobbyists the like. > > > > If you were just asking about who's interested in > > discussing changes to foster more quality, count > > me in. I'm just not sure whether discussing these > > on a separate mailing list or other channel is the > > right thing to do. > > > > Hi Martin, > > There are two issues I'm thinking about. The first is the > generic unit > testing and quality initiatives required to move rxtx > forward. The second > is the inevitable fact that rxtx connects to external hardware. The > discussion deals with a different set of problems. > > Here is a simple example of what I'm getting at. > > We have the capability of setting custom baud rates in rxtx. > We may be > interested in seeing regressions in rxtx, the C library or > the kernel. > Some people may be doing some tests with loopback > connections. These will > always work even if the baud rate is not set to the expected > value. Some > people may use null modems between two ports. This may be > able to catch > the problem but not always. > > Will the build machines be able to test this? (no - for a few reasons) > Will people be trying to catch these type of regressions? (yes) > What type of coverage does the community have in the end? (?) > > We could include the discussions in the same list or another > equally open > list that may be of interest to some folks that deal with > these types of > problems on a regular basis. > > -- > Trent Jarvi > tjarvi at qbang.org > From toupsz at cs.tamu.edu Tue Nov 13 10:33:03 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 13 Nov 2007 11:33:03 -0600 Subject: [Rxtx] [urgent] device's power off detection In-Reply-To: <4738F546.5010101@gatworks.com> References: <766782.10076.qm@web55803.mail.re3.yahoo.com> <4738F546.5010101@gatworks.com> Message-ID: Lacking any other specification on it...but can you set up the device to notify your software when it turns off? Send a message or somesuch? Maybe it can signal using RTS or DTR? -Zach On Nov 12, 2007 6:52 PM, U. George wrote: > Not sure what u are asking for. Are u asking for a way to detect if the > device is OFF? Are u asking how to power off the device - via software ? > Is it a Serial device? > is it a parallel device? > is it a usb device? > > Sara Hugh wrote: > > Hello all, > > I have a small application built on top of rxtx api. This application > > can retrieve the incoming data from a device through a port. The device > > can be powered off after the port get closed from the application. I > > have been trying a couple of hours to find a way to detect the power > > switching from device. If anyone knows how to handle it through rxtx, > > could you please give me a help? Thank you very much. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071113/e5859e4d/attachment-0015.html From tjarvi at qbang.org Tue Nov 13 20:02:03 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 13 Nov 2007 20:02:03 -0700 (MST) Subject: [Rxtx] #ifndef TIOCSERGETLSR In-Reply-To: <472E3AAF.7050709@gatworks.com> References: <472E3AAF.7050709@gatworks.com> Message-ID: On Sun, 4 Nov 2007, U. George wrote: > For Linux, it seems that you need the code for both *having* a > TIOCSERGETLSR, and *not having* a TIOCSERGETLSR. Maybe the ioctl exists > system wide, but not necessarily for the device driver itself ( always > returns -1 ) . > > Are there systems that have a *functioning* TIOCSERGETLSR for all their > devices? Then this would be the case where the "#ifndef TIOCSERGETLSR" > directive could be useful is eliminating the unnecessary code and tests. > > And for those systems that dont have a TIOCSERGETLSR, then the code for > TIOCSERGETLSR can be eliminated. > > It would be a simple case to have, as a foundation, all the code to > simulate the missing TIOCSERGETLSR ioctl. If the system does have the > ioctl, then that code can be ifdef'd in, and co-exist with the > functionality of the code that simulates the missing TIOCSERGETLSR ioctl. > Ah, there is the post. Sorry I was on vacation. Hi George, Yes there are systems that have functioning TIOCSERGETLSR for all of their devices. These are machines that just use traditional UARTs. If you mean operating systems, then probably not. Let me explain a bit about the history of those #ifdefs to help clear up a mess. RXTX aims to follow POSIX. TIOCSERGETLSR turns out to not be POSIX at all as I understand. It isn't in BSD, Solaris, AIX or HP-UX. It certainly provides access to important information. I assumed it was standard when I coded rxtx on a Linux system. Ya, laugh. Then I looked at Win32.. Oh you are still laughing? ..I could not navigate msft's web site at the time [still can't really find anything today]. So google pointed me to someones 'reverse documentation' of the w32 API and an example msft put together back in the win3.0 days. It was enough but maybe not 100% correct. They covered overlapped IO which was important for events in rxtx. Looking at Win32 and Linux, it made sense to implement TIOCSERGETLSR for win32 with the way rxtx works. That was how things matched up. But when I got feedback about other systems, it didn't match up. When people used multiport cards with money saving designs in Linux, it didn't match up. And today, there are drivers for unusual serial ports that don't match up. Now we have some ugly logic that mostly works for most serial ports. It isn't right though. The important aspect of TIOSERGETLSR is knowing when the output is really gone. But POSIX tcdrain tells us the same thing. So there is logic in the ifdefs to match that up as you suggest. Perhaps a more formal solution along those lines would be worth looking into. I would suggest the roles should be switched though. We should use POSIX calls on all systems and hide things that don't work on everything like we have with other undocumented calls. TIOSERGETLSR is nice and would be great if it was standard. It isn't as far as I can tell. In the end, many people write Java code because they want portability. The TIOSERGETLSR does not really fit. In someways, this is limiting to the least common denominator which is Solaris if you have seen it's serial kernel driver code. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 15 09:10:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 15 Nov 2007 17:10:59 +0100 Subject: [Rxtx] RXTX blocking on unconnected virtual port Message-ID: <460801A4097E3D4CA04CC64EE648584803919080@ism-mail03.corp.ad.wrs.com> Hello, we came across the following issue: * Set up a virtual serial port, e.g. with com0com: http://com0com.sourceforge.net/ * Connect RXTX to one end, e.g. cnc1a * Do not connect the other end, e.g. cnc1b * Have RXTX write data to the port --> Since the data is not being read, RXTX blocks - RXTXPort.SerialOutputStream.write increases the RXTXPort.IOLocked variable - it then calls the native writeByte or writeArray method (which blocks) closing the RXTXPort hangs for ever too: - RXTXPort.close() has a while( IOLocked > 0 ) {..Thread.sleep(500);...} which spins for ever ==> once the communication hangs, it cannot recover. Has anybody else seen such a problem before, or even got an idea how to solve it? When I connect Hyperterminal to the same half-open port, and type a character, it hangs for about 3 seconds but then times out and is available again. I guess that's what I'd like to see in RXTX as well, with a (configurable) timeout. Our big problem with the current situation is that once RXTX gets stuck, there is nothing at all we can do to make it go live again - that's why our original workaround of writing to the port in a background thread is not good enough. For more background information, the issue is being tracked in https://bugs.eclipse.org/bugs/show_bug.cgi?id=208185 Thanks for any hints or ideas, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Sun Nov 18 09:43:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 09:43:26 -0700 (MST) Subject: [Rxtx] PortInUseException - Cannot close and reopen serial port In-Reply-To: <460801A4097E3D4CA04CC64EE64858480351C711@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858480351C711@ism-mail03.corp.ad.wrs.com> Message-ID: These have been submitted to CVS and the bugzilla entries have been changed to reflect the changes. ChangeLog: find ports which were added after program startup on Mac OS X. Martin Oberhuber http://bugzilla.qbang.org/show_bug.cgi?id=48 Clean up CommPort Ownership code, avoid possible deadlocks, fix lost commport ownership events. http://bugzilla.qbang.org/show_bug.cgi?id=83 Martin Oberhuber On Wed, 24 Oct 2007, Oberhuber, Martin wrote: > 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) > > > > > > > > > > > > > > > From tjarvi at qbang.org Sun Nov 18 09:45:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 09:45:39 -0700 (MST) Subject: [Rxtx] PortInUseException - Cannot close and reopen serial port In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848020CAF26@ism-mail03.corp.ad.wrs.com> Message-ID: The current CVS code should have all the entries. With version information, I usually do not change the version until we tag and release a zip file. Any feedback would be appreciated. On Wed, 27 Jun 2007, Greg Johnson wrote: > 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) >> >> >> >> >> > From tjarvi at qbang.org Sun Nov 18 13:51:27 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 13:51:27 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs Message-ID: The following bugs have been closed and CVS updated as needed: CommPortIdentifier.getPortIdentifier throws NoSuchPortException http://bugzilla.qbang.org/show_bug.cgi?id=48 CommPortOwnership events not sent http://bugzilla.qbang.org/show_bug.cgi?id=83 JVM 1.6 builds http://bugzilla.qbang.org/show_bug.cgi?id=84 I'd like to give Martin Oberhuber CVS write access. He has been doing a great job of pushing safe patches into rxtx. I'll be preparing seperate patches for the changes I have and submitting them to the list. I'll need to work with George to do a couple things: 1) break the patch into smaller pieces to isolate issues for discussion. 2) work through the Line Status Register changes so it does not cause problems on other systems. George: If you could do the first one, it would be greatly appreciated. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Nov 18 15:33:36 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 15:33:36 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: Message-ID: I'm not running any tests at this point, I'm trying to apply the small safe patches and make sure everything is compiling. As mentioned at the bottom, there are 3 patches + the USB fix posted here that need more review before accepting. The following bugs have been closed and CVS updated as needed. Most of these are already in CVS. The diff will be small. configure script failed at line UTS_RELEASE megov http://bugzilla.qbang.org/show_bug.cgi?id=80 code cleanup patch (extra ';' creates bug for if statements + new String() calls removed) Xavier Le Vourch http://bugzilla.qbang.org/show_bug.cgi?id=77 Wont compile on linux ppc with glibc 2.5 - no sys/io.h Brian Johnson http://bugzilla.qbang.org/show_bug.cgi?id=72 rxtx overwrites System properties Andrew Gillett Nektarios K. Papadopoulos Neboj??a http://bugzilla.qbang.org/show_bug.cgi?id=64 Solaris ACM port support Dave Cleal http://bugzilla.qbang.org/show_bug.cgi?id=59 Setting of non-standard baud rate fails. Andrew Prunicki http://bugzilla.qbang.org/show_bug.cgi?id=58 RXTX uses lockfiles on MacOS X (instead of ioctl TIOCEXCL) Joachim Buechse http://bugzilla.qbang.org/show_bug.cgi?id=50 JavaDoc fixes Joachim Buechse http://bugzilla.qbang.org/show_bug.cgi?id=49 I need to further review the following: http://bugzilla.qbang.org/show_bug.cgi?id=53 http://bugzilla.qbang.org/show_bug.cgi?id=46 http://bugzilla.qbang.org/show_bug.cgi?id=41 On Sun, 18 Nov 2007, Trent Jarvi wrote: > > The following bugs have been closed and CVS updated as needed: > > CommPortIdentifier.getPortIdentifier throws NoSuchPortException > http://bugzilla.qbang.org/show_bug.cgi?id=48 > CommPortOwnership events not sent > http://bugzilla.qbang.org/show_bug.cgi?id=83 > JVM 1.6 builds > http://bugzilla.qbang.org/show_bug.cgi?id=84 > > I'd like to give Martin Oberhuber CVS write access. He has been doing a > great job of pushing safe patches into rxtx. > > I'll be preparing seperate patches for the changes I have and submitting > them to the list. > > I'll need to work with George to do a couple things: > > 1) break the patch into smaller pieces to isolate issues for discussion. > 2) work through the Line Status Register changes so it does not cause > problems on other systems. > > George: If you could do the first one, it would be greatly appreciated. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From netbeans at gatworks.com Sun Nov 18 16:20:02 2007 From: netbeans at gatworks.com (U. George) Date: Sun, 18 Nov 2007 18:20:02 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: Message-ID: <4740C8A2.6030908@gatworks.com> > I'll need to work with George to do a couple things: > > 1) break the patch into smaller pieces to isolate issues for discussion. > 2) work through the Line Status Register changes so it does not cause > problems on other systems. > > George: If you could do the first one, it would be greatly appreciated. there are ( probably ) 3 pieces: 1) the select() failure when the USB-serial device is unceremoniously unplugged ( causes rxtx to spin ) 2) TIOCSERGETLSR, need to have the simulation of it available for all os's . If the system has the capability, don't simulate for devices that have the capability. For devices that dont have the capability, but the OS still defines TIOCSERGETLSR, fall back to simulation. 3) I rearranged DEBUG ifdef's. This is probably the bulk of the patches. From tjarvi at qbang.org Sun Nov 18 18:26:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 18:26:26 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <4740C8A2.6030908@gatworks.com> References: <4740C8A2.6030908@gatworks.com> Message-ID: On Sun, 18 Nov 2007, U. George wrote: > >> I'll need to work with George to do a couple things: >> >> 1) break the patch into smaller pieces to isolate issues for discussion. >> 2) work through the Line Status Register changes so it does not cause >> problems on other systems. >> >> George: If you could do the first one, it would be greatly appreciated. > > there are ( probably ) 3 pieces: > 1) the select() failure when the USB-serial device is unceremoniously > unplugged ( causes rxtx to spin ) > 2) TIOCSERGETLSR, need to have the simulation of it available for all os's . > If the system has the capability, don't simulate for devices that have the > capability. For devices that dont have the capability, but the OS still > defines TIOCSERGETLSR, fall back to simulation. > 3) I rearranged DEBUG ifdef's. This is probably the bulk of the patches. > Hi George, I suspect if you do cvs update, there will be very few conflicts if any. While the list of fixes is fairly long, the changes are small. -- Trent Jarvi tjarvi at qbang.org From EdwardRF at xtremax.com Mon Nov 19 03:32:29 2007 From: EdwardRF at xtremax.com (Edward) Date: Mon, 19 Nov 2007 18:32:29 +0800 Subject: [Rxtx] Cannot Read under Windows XP Message-ID: <4741663D.4070200@xtremax.com> Hi Guys, I have a iTegno 3000 usb GSM modem, it is an usb-serial device. I am trying to use RXTX with it under Windows XP. The problem is it seems RXTX cannot read any data from it, but writing to it seems successful. I blindly issue a series of command to send off a SMS, it is successfully delivered, but neither the echo from the modem nor the "OK" response was received. I tried to connect to the modem directly using hyper terminal, there was no problem reading or writing. So can i assume it is not the driver problem? Then i turned to Serial Port Monitor for help, when I use hyper terminal, monitor shows both way traffic, and nothing abnormal, but when I connect using RXTX, only the data I sent to the modem is being detected, no input was detected. Does anyone else experience similar problem? Best Regards Edward From tjarvi at qbang.org Mon Nov 19 03:38:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Nov 2007 03:38:02 -0700 (MST) Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: <4741663D.4070200@xtremax.com> References: <4741663D.4070200@xtremax.com> Message-ID: On Mon, 19 Nov 2007, Edward wrote: > Hi Guys, > > I have a iTegno 3000 usb GSM modem, it is an usb-serial device. I am > trying to use RXTX with it under Windows XP. > The problem is it seems RXTX cannot read any data from it, but writing > to it seems successful. I blindly issue a series of command to send off > a SMS, it is successfully delivered, but neither the echo from the modem > nor the "OK" response was received. > > I tried to connect to the modem directly using hyper terminal, there was > no problem reading or writing. So can i assume it is not the driver problem? > > Then i turned to Serial Port Monitor for help, when I use hyper > terminal, monitor shows both way traffic, and nothing abnormal, but when > I connect using RXTX, only the data I sent to the modem is being > detected, no input was detected. > > Does anyone else experience similar problem? > Hi Edward, A common mistake is to send Strings to the modem which are i18n. You want to send the bytes. Examples of doing this are in the contrib directory with the sourcecode. ie SimpleSnuV1.java -- Trent Jarvi tjarvi at qbang.org From EdwardRF at xtremax.com Mon Nov 19 04:42:16 2007 From: EdwardRF at xtremax.com (Edward) Date: Mon, 19 Nov 2007 19:42:16 +0800 Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: References: <4741663D.4070200@xtremax.com> Message-ID: <47417698.3060705@xtremax.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071119/b0f08ba9/attachment-0010.html From netbeans at gatworks.com Mon Nov 19 06:31:30 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 19 Nov 2007 08:31:30 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: <4740C8A2.6030908@gatworks.com> Message-ID: <47419032.8080406@gatworks.com> Did the "make install". The install does not want to go to or use Makefiles's prefix = /usr/local/rxtx-devel Not terribly happy that it installed in /home/gat/JAVA/JDK14/j2sdk1.4.2_08/jre/lib/i386 Trent Jarvi wrote: > > I suspect if you do cvs update, there will be very few conflicts if any. > While the list of fixes is fairly long, the changes are small. > > -- > Trent Jarvi > tjarvi at qbang.org > > From Martin.Oberhuber at windriver.com Mon Nov 19 07:00:48 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 19 Nov 2007 15:00:48 +0100 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE6485848039986E6@ism-mail03.corp.ad.wrs.com> It's great to see things progressing - thanks Trent! I checked CVS, and it seems that most of the patch authors are yet missing from the AUTHORS file, is this intentional? The issues areound RXTXPort.close() are interesting for us in the context of Eclipse as well: https://bugs.eclipse.org/bugs/show_bug.cgi?id=208185#c3 I did a quick review and found some issues / comments: http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 http://bugzilla.qbang.org/show_bug.cgi?id=53#c9 Thanks for proposing CVS write access for me. I promise to use these thoughtfully, and discuss potential fixes openly (on bugzilla) before applying them [unless it's really trivial issues only like obvious Javadoc syntax or spelling errors]. Cheers, -- 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 Mon Nov 19 07:24:16 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 19 Nov 2007 15:24:16 +0100 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803998711@ism-mail03.corp.ad.wrs.com> Hi all, I think I've got a better version for RXTXCommDriver.checkSolaris(): http://bugzilla.qbang.org/show_bug.cgi?id=77#c3 Cheers, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From netbeans at gatworks.com Mon Nov 19 09:01:22 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 19 Nov 2007 11:01:22 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <47419032.8080406@gatworks.com> References: <4740C8A2.6030908@gatworks.com> <47419032.8080406@gatworks.com> Message-ID: <4741B352.8070205@gatworks.com> U. George wrote: > Did the "make install". The install does not want to go to or use > Makefiles's prefix = /usr/local/rxtx-devel > > Not terribly happy that it installed in > /home/gat/JAVA/JDK14/j2sdk1.4.2_08/jre/lib/i386 > Put libs and jar in MY preferential places. Ran application. And it loves to spin. Deja gnu all over again. :-/ It did find the avail /dev/ttyUSB0 port connected to LINUX usbserial/pl2303 device driver. Now to find the spin. and apply simpler set of patches From tjarvi at qbang.org Mon Nov 19 10:14:38 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Nov 2007 10:14:38 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <4741B352.8070205@gatworks.com> References: <4740C8A2.6030908@gatworks.com> <47419032.8080406@gatworks.com> <4741B352.8070205@gatworks.com> Message-ID: On Mon, 19 Nov 2007, U. George wrote: > U. George wrote: >> Did the "make install". The install does not want to go to or use >> Makefiles's prefix = /usr/local/rxtx-devel >> >> Not terribly happy that it installed in >> /home/gat/JAVA/JDK14/j2sdk1.4.2_08/jre/lib/i386 >> > Put libs and jar in MY preferential places. Ran application. And it loves to > spin. Deja gnu all over again. :-/ > > It did find the avail /dev/ttyUSB0 port connected to LINUX usbserial/pl2303 > device driver. > > Now to find the spin. and apply simpler set of patches > Hi George, When the prefix code was stomped on and the library was installed in the jre, It wasnt clear how the layout would end up looking. I'm still not sure. My usual attack was to dump a jdk onto the filesystem, set JAVA_HOME and install. When I was done, I would nuke the jdk. Obviously that may not be what people want but I'm not sure a prefix is enough to let us know what they do want. For a shared library prefix /usr/local means the library goes in /usr/local/lib. What would it mean for the jar and shared library in Java? -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Nov 19 10:24:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Nov 2007 10:24:08 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <460801A4097E3D4CA04CC64EE6485848039986E6@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848039986E6@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 19 Nov 2007, Oberhuber, Martin wrote: > > I checked CVS, and it seems that most of the patch > authors are yet missing from the AUTHORS file, > is this intentional? > There isn't a hard rule covering who goes into AUTHORS. If I recognize a person from previous patches, I try to make sure they are in. Everyone contributing (authors) is in the ChangeLog with what they did going all the way back to the first release. AUTHORS is more of a summary of what they did after a few submissions. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Nov 19 11:39:51 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 19 Nov 2007 13:39:51 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: <4740C8A2.6030908@gatworks.com> <47419032.8080406@gatworks.com> <4741B352.8070205@gatworks.com> Message-ID: <4741D877.80203@gatworks.com> For me, the makefile/prefix = /usr/local sorta suggest thats where the libs/bins/jars/... should eventually wind up. If a user does not like /usr/local, then a quick change would put it somewhere else. At this moment I dont care where the jar winds up ( in lib, or a jar directory ). So I like to keep the jre/sdk directory protected from meddling, and changes. But if a user has a penchant to use 'java -jar', then the RXTXcomm.jar file should be stuffed with the other jre/sdk jar files. From ajmas at sympatico.ca Mon Nov 19 11:54:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 19 Nov 2007 13:54:29 -0500 Subject: [Rxtx] CVS updates and closed bugs Message-ID: <20071119185429.SPYK18413.tomts22-srv.bellnexxia.net@smtp1.sympatico.ca> On this day in November "U. George" wrote: > > For me, the makefile/prefix = /usr/local sorta suggest thats where the > libs/bins/jars/... should eventually wind up. > If a user does not like /usr/local, then a quick change would put it > somewhere else. At this moment I dont care where the jar winds up ( in > lib, or a jar directory ). > So I like to keep the jre/sdk directory protected from meddling, and > changes. > But if a user has a penchant to use 'java -jar', then the RXTXcomm.jar > file should be stuffed with the other jre/sdk jar files. It should be noted that some platforms, such as MacOS X might have different conventions. In the case of MacOS X there are two 'correct' places for Java libraries that aren't part of an application: - /Library/Java/Extensions/ - ~/Library/Java/Extensions/ Andre From ajmas at sympatico.ca Mon Nov 19 18:15:37 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 19 Nov 2007 20:15:37 -0500 Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: <47417698.3060705@xtremax.com> References: <4741663D.4070200@xtremax.com> <47417698.3060705@xtremax.com> Message-ID: <3D24B671-06CA-4709-AE3C-BCDB542F427F@sympatico.ca> On 19-Nov-07, at 06:42 , Edward wrote: > Hi Trent, > > First of all, I did sent them as bytes, eg, > > output.write("at\r\n".getBytes()); > > And if writing is every the problem, it wouldn't be able to explain > why i could send out a sms successfully using RXTX. > If you have the section of code that does the communicating, could you share it with us? This should help us tell whether it is a coding issue or something more fundamental with RXTX. Andre From EdwardRF at xtremax.com Mon Nov 19 19:39:36 2007 From: EdwardRF at xtremax.com (EdwardRF) Date: Tue, 20 Nov 2007 10:39:36 +0800 Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: <3D24B671-06CA-4709-AE3C-BCDB542F427F@sympatico.ca> References: <4741663D.4070200@xtremax.com> <47417698.3060705@xtremax.com> <3D24B671-06CA-4709-AE3C-BCDB542F427F@sympatico.ca> Message-ID: <474248E8.7070002@xtremax.com> Hi Guys, Thanks for the help, i've finally found out the problem. It was a flow control issue, i did not set the flow control properly. Btw, what is the default flow control behavior for rxtx2.1.7? was it the same as 2.0? Because i remember i did not need to set the flow control when I use rxtx 2.0 2 years back. Best Regards Edward Andre-John Mas wrote: > > On 19-Nov-07, at 06:42 , Edward wrote: > >> Hi Trent, >> >> First of all, I did sent them as bytes, eg, >> >> output.write("at\r\n".getBytes()); >> >> And if writing is every the problem, it wouldn't be able to explain >> why i could send out a sms successfully using RXTX. >> > > If you have the section of code that does the communicating, could you > share it with us? This should help us tell whether it is a coding > issue or something more fundamental with RXTX. > > Andre > From netbeans at gatworks.com Tue Nov 20 06:23:26 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 20 Nov 2007 08:23:26 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: <4740C8A2.6030908@gatworks.com> Message-ID: <4742DFCE.5070504@gatworks.com> Here is the small subset of diffs just for TIOCSERGETLSR :) Next I'll pull out the usb device, and see if that also causes rxtx to spin. >> 2) TIOCSERGETLSR, need to have the simulation of it available for all >> os's . If the system has the capability, don't simulate for devices >> that have the capability. For devices that dont have the capability, >> but the OS still defines TIOCSERGETLSR, fall back to simulation. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: a Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20071120/2c5c8ee7/attachment-0007.pl From tjarvi at qbang.org Tue Nov 20 08:20:21 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Nov 2007 08:20:21 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <4742DFCE.5070504@gatworks.com> References: <4740C8A2.6030908@gatworks.com> <4742DFCE.5070504@gatworks.com> Message-ID: On Tue, 20 Nov 2007, U. George wrote: > Here is the small subset of diffs just for TIOCSERGETLSR :) > > Next I'll pull out the usb device, and see if that also causes rxtx to spin. > >>> 2) TIOCSERGETLSR, need to have the simulation of it available for all os's >>> . If the system has the capability, don't simulate for devices that have >>> the capability. For devices that dont have the capability, but the OS >>> still defines TIOCSERGETLSR, fall back to simulation. > Hi George, I'll be looking through this patch in detail tonight. I just wanted to make sure you are aware of this line in win32termios.h. The ifdef logic is messy as you noticed. That is combined with the later addition of support for it to windows. #define TIOCSERGETLSR 0x5459 (this is by far the strangest code in rxtx in retrospect) I'll be able to do extensive automated testing once we get to that point. I'm confident we can get something in that has a low probability of causing regressions. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Tue Nov 20 08:42:08 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 20 Nov 2007 10:42:08 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: <4740C8A2.6030908@gatworks.com> <4742DFCE.5070504@gatworks.com> Message-ID: <47430050.1010203@gatworks.com> It is of no difference. 1) If the define does not exist, then it should be as before. 2) If it does exist, then it should also be as before. 3) If it does exist, but the ioctl fails, then it will fallback as if it did not exist in the first place. Trent Jarvi wrote: > On Tue, 20 Nov 2007, U. George wrote: > >> Here is the small subset of diffs just for TIOCSERGETLSR :) >> >> Next I'll pull out the usb device, and see if that also causes rxtx to >> spin. >> >>>> 2) TIOCSERGETLSR, need to have the simulation of it available for >>>> all os's . If the system has the capability, don't simulate for >>>> devices that have the capability. For devices that dont have the >>>> capability, but the OS still defines TIOCSERGETLSR, fall back to >>>> simulation. >> > > Hi George, > > I'll be looking through this patch in detail tonight. I just wanted to > make sure you are aware of this line in win32termios.h. The ifdef logic > is messy as you noticed. That is combined with the later addition of > support for it to windows. > > #define TIOCSERGETLSR 0x5459 > > (this is by far the strangest code in rxtx in retrospect) > > I'll be able to do extensive automated testing once we get to that > point. I'm confident we can get something in that has a low probability > of causing regressions. > > -- > Trent Jarvi > tjarvi at qbang.org > > From netbeans at gatworks.com Tue Nov 20 08:36:56 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 20 Nov 2007 10:36:56 -0500 Subject: [Rxtx] Unplugged Opened USB devices In-Reply-To: <4742DFCE.5070504@gatworks.com> References: <4740C8A2.6030908@gatworks.com> <4742DFCE.5070504@gatworks.com> Message-ID: <4742FF18.3050005@gatworks.com> > Next I'll pull out the usb device, and see if that also causes rxtx to > spin. This is the error on a read. The select() should have failed, as well as the read(). java.io.IOException: Input/output error in nativeavailable at gnu.io.RXTXPort.nativeavailable(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1420) at jGPS.GpsData.DeviceDrivers.SerialPort.SerialPort_NMEA_GNU.serialEvent (SerialPort_NMEA_GNU.java:449) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:771) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1622) But for java program, it sees( when USB device is unplugged ) : 1) event: SerialPortEvent.DATA_AVAILABLE 2) read (non-existant) data. I think that its bad form to say DATA_AVAILABLE, when there is no data to be obtained. There does not seem to be an I/O error event. So basically, I think, and IMHO, that no events should be sent. Rather a thread timeout ( ie no data in X seconds ) AND recovery from user code should be instantiated. From manujnaman at yahoo.com Wed Nov 21 12:35:46 2007 From: manujnaman at yahoo.com (manuj naman) Date: Wed, 21 Nov 2007 11:35:46 -0800 (PST) Subject: [Rxtx] Problem reading 1-wire device using RXTX on Linux Message-ID: <371969.66249.qm@web37911.mail.mud.yahoo.com> Hello, I am trying to use the RXTX library on Ubuntu (Debian) linux to read iButtons. It works perfectly on Windows. However on my linux machines it gives the following errors. I am using DS9490 (USB port adapter) to read the iButtons. I have followed your instructions on the Wiki. I recompiled the rxtx library to produce the .so and .jar files. But still it gives me this: manujnaman at sensor:~/iButton/onewireviewer$ java -cp $CLASSPATH:./OneWireAPI.jar:./OneWireViewer.jar OneWireViewer Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Warning: serial communications API not setup properly, no ports in enumeration Pure-Java DS9097U adapter will not work, not added to adapter enum Standard drivers for 1-Wire are not found. Please download the latest drivers from http://www.ibutton.com Or install RXTX Serial Communications API from http://www.rxtx.org Do you know how to solve the "Serial communications API not setup properly, no ports in enumeration" problem? Also, how to detect which what /dev/* is the port to be used? On Windows this is simply USB1, on linux this is a bit unclear. Many thanks for your advice, Manuj Naman Dallas, TX, US manujnaman at yahoo.com --------------------------------- Be a better pen pal. Text or chat with friends inside Yahoo! Mail. See how. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071121/2760f691/attachment-0006.html From Martin.Oberhuber at windriver.com Wed Nov 21 13:55:25 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 21 Nov 2007 21:55:25 +0100 Subject: [Rxtx] Should RXTX Lixense link to LGPL-2.1 be changed? In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803A21160@ism-mail03.corp.ad.wrs.com> Hi Trent and all, In all the RXTX source files as well as http://users.frii.com/jarvi/rxtx/license.html there is the following lines: | A copy of the LGPL v 2.1 may be found at | http://www.gnu.org/licenses/lgpl.txt on March 4th 2007. A copy is | here for your convenience. But, as of today, at the link provided there is only a copy of the LGPL v3.0. I think there should be a link to the LGPL v2.1, e.g. http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html What do you think? Cheers, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Nov 21 20:46:18 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Nov 2007 20:46:18 -0700 (MST) Subject: [Rxtx] Problem reading 1-wire device using RXTX on Linux In-Reply-To: <371969.66249.qm@web37911.mail.mud.yahoo.com> References: <371969.66249.qm@web37911.mail.mud.yahoo.com> Message-ID: On Wed, 21 Nov 2007, manuj naman wrote: > Hello, > > I am trying to use the RXTX library on Ubuntu (Debian) linux to read iButtons. It works perfectly on Windows. However on my linux machines it gives the following errors. I am using DS9490 (USB port adapter) to read the iButtons. > > I have followed your instructions on the Wiki. I recompiled the rxtx library to produce the .so and .jar files. But still it gives me this: > > manujnaman at sensor:~/iButton/onewireviewer$ java -cp $CLASSPATH:./OneWireAPI.jar:./OneWireViewer.jar OneWireViewer > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > Warning: serial communications API not setup properly, no ports in enumeration > Pure-Java DS9097U adapter will not work, not added to adapter enum > > Standard drivers for 1-Wire are not found. > Please download the latest drivers from http://www.ibutton.com > Or install RXTX Serial Communications API from http://www.rxtx.org > > Do you know how to solve the "Serial communications API not setup properly, no ports in enumeration" problem? > > Also, how to detect which what /dev/* is the port to be used? On Windows this is simply USB1, on linux this is a bit unclear. Hi Manuj What is the output of the following? dmesg |grep tty touch /var/lock/test.lock && rm -f /var/lock/test.lock If you see something like /dev/ttyUSB0 in the dmesg output, what happens if you do something like tail -f /dev/ttyUSB0? These test each of the usual suspects. We are looking for missing USB drivers, no permission to create a lockfile and no read permission for the device. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Nov 21 21:05:23 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Nov 2007 21:05:23 -0700 (MST) Subject: [Rxtx] Should RXTX Lixense link to LGPL-2.1 be changed? In-Reply-To: <460801A4097E3D4CA04CC64EE648584803A21160@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803A21160@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 21 Nov 2007, Oberhuber, Martin wrote: > Hi Trent and all, > > In all the RXTX source files as well as > http://users.frii.com/jarvi/rxtx/license.html > there is the following lines: > > | A copy of the LGPL v 2.1 may be found at > | http://www.gnu.org/licenses/lgpl.txt on March 4th 2007. A copy is > | here for your convenience. > > But, as of today, at the link provided there is only > a copy of the LGPL v3.0. I think there should be a link > to the LGPL v2.1, e.g. > http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html > > What do you think? > Hi Martin, Thanks. I updated the link. Changing licences is a heavy process for me as a free software developer and an employee so I'd rather stay with 2.1 unless the current license becomes a show stopper. I figured that would happen someday so I put the date in to be clear. -- Trent Jarvi tjarvi at qbang.org From beat.arnet at gmail.com Thu Nov 22 08:45:45 2007 From: beat.arnet at gmail.com (Beat Arnet) Date: Thu, 22 Nov 2007 10:45:45 -0500 Subject: [Rxtx] Dual Core Problem Message-ID: <4745A429.9060604@gmail.com> Dear All, I am struggling with an application that uses RXTX 2.1.7 and has been working reliably in the past. When this program runs on a dual-core DELL (Intel T2500), strange things happen with the RS232 communication. The application is missing incoming characters and also often freezes when trying to close the serial port. I highly suspect a threading problem and was wondering if a) anybody had run into a similar problem with dual core processors and b) if there is a list of does and dont's when it comes to RXTX and threads. Regards, Beat From tjarvi at qbang.org Thu Nov 22 13:22:43 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 22 Nov 2007 13:22:43 -0700 (MST) Subject: [Rxtx] Dual Core Problem In-Reply-To: <4745A429.9060604@gmail.com> References: <4745A429.9060604@gmail.com> Message-ID: On Thu, 22 Nov 2007, Beat Arnet wrote: > Dear All, > I am struggling with an application that uses RXTX 2.1.7 and has been > working reliably in the past. When this program runs on a dual-core DELL > (Intel T2500), strange things happen with the RS232 communication. The > application is missing incoming characters and also often freezes when > trying to close the serial port. I highly suspect a threading problem > and was wondering if a) anybody had run into a similar problem with dual > core processors and b) if there is a list of does and dont's when it > comes to RXTX and threads. > I've used rxtx with SMP systems but have not experimented very much with threading and rxtx. One red flag rxtx raises is it stores pointers to java objects in SerialImp.c. If the JVM decides to move things around, rxtx becomes confused. Missing incomming characters is usually caused by someone running two applications. They then fight over the incomming data. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Fri Nov 23 03:12:28 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 23 Nov 2007 11:12:28 +0100 Subject: [Rxtx] Dual Core Problem In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803A84C59@ism-mail03.corp.ad.wrs.com> > Missing incomming characters is usually caused by someone running two > applications. They then fight over the incomming data. I've seen exactly this scenario on Linux with Lockfiles disabled. Usually, port locking (through Lockfiles or Ioctl method) should avoid exactly this problem. I know that on Mac, port locking through Kernel/Ioctl method has been added for the upcoming RXTX 2.1-8. What's the status of this feature for Linux and other Unixes? Cheers, Martin From chris.paton at red61.com Fri Nov 23 05:26:10 2007 From: chris.paton at red61.com (Chris Paton) Date: Fri, 23 Nov 2007 12:26:10 +0000 Subject: [Rxtx] RXTX parallel port issues Message-ID: <4746C6E2.3000304@red61.com> Hi there, I've been happily using RXTX to communicate with a serial based point-of-sale printer for a several months. I've recently received a parallel based printer and have been trying to get RXTX to talk to this too. I've encountered a few problems along the way and just wanted to check if I'm doing anything wrong, or if I've found any bugs. Writing ------- Writing to the parallel port using ParallelPort.getOutputStream works well, except when I use OutputStream.write(byte[]) to write a multiple of 8 bytes (!). Doing this causes the JVM to crash with an EXCEPTION_PRIV_INSTRUCTION on Windows. I worked around this in my application by adding an additional byte if bytesToWrite % 8 == 0. I guess I could also have called write(byte) repeatedly. This also generated a SIGSEGV on Linux but I was unable to reproduce it today using the CVS version of RXTX and a recent kernel. Reading status pins ------------------- On Linux, I've found that ParallelPort.isPaperOut and ParallelPort.isPrinterSelected appear to be inverted; i.e. when the paper is out ParallelPort.isPaperOut returns false, and when there is paper ParallelPort.isPaperOut returns true! I've tested this in both Sun JDK5 and JDK6 on machines running Linux 2.6.21 and 2.6.23. Fortunately it's easy to use a conditional based on System.getProperty("os.name") to hack around this. Reading from InputStream ------------------------ I've had more serious issues trying to read from ParallelPort.getInputStream. On Windows, readByte seems to return -1 (end of stream) any time data isn't available. On Linux, I got a kernel oops, even with a recent 2.6.23.1 kernel. I was able to stop this using a kernel patch that I found via Google. Although this stopped the oops, I still get frequent IOExceptions when calling InputStream.readByte. It appears that instead of blocking, readByte throws an IOException with message "Resource temporarily unavailable in readByte" any time it is called when no data is available. Occasionally, I get an exception instead of the data I was expecting to read, e.g when asking my printer for a version string I get "VER: S3306 * 06.03* 10/*6/06" where the *s indicate that an exception occurred and data was missed. Any advice that anyone can offer would be much appreciated. If you need any more details or debugging information about any of these problems then let me know. Cheers -- Chris Paton Technical Developer Red61 -- Transaction Marketing Software http://www.red61.com -------------- next part -------------- A non-text attachment was scrubbed... Name: chris.paton.vcf Type: text/x-vcard Size: 230 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20071123/00a747b6/attachment-0010.vcf From chris.paton at red61.com Fri Nov 23 05:26:10 2007 From: chris.paton at red61.com (Chris Paton) Date: Fri, 23 Nov 2007 12:26:10 +0000 Subject: [Rxtx] RXTX parallel port issues Message-ID: <4746C6E2.3000304@red61.com> Hi there, I've been happily using RXTX to communicate with a serial based point-of-sale printer for a several months. I've recently received a parallel based printer and have been trying to get RXTX to talk to this too. I've encountered a few problems along the way and just wanted to check if I'm doing anything wrong, or if I've found any bugs. Writing ------- Writing to the parallel port using ParallelPort.getOutputStream works well, except when I use OutputStream.write(byte[]) to write a multiple of 8 bytes (!). Doing this causes the JVM to crash with an EXCEPTION_PRIV_INSTRUCTION on Windows. I worked around this in my application by adding an additional byte if bytesToWrite % 8 == 0. I guess I could also have called write(byte) repeatedly. This also generated a SIGSEGV on Linux but I was unable to reproduce it today using the CVS version of RXTX and a recent kernel. Reading status pins ------------------- On Linux, I've found that ParallelPort.isPaperOut and ParallelPort.isPrinterSelected appear to be inverted; i.e. when the paper is out ParallelPort.isPaperOut returns false, and when there is paper ParallelPort.isPaperOut returns true! I've tested this in both Sun JDK5 and JDK6 on machines running Linux 2.6.21 and 2.6.23. Fortunately it's easy to use a conditional based on System.getProperty("os.name") to hack around this. Reading from InputStream ------------------------ I've had more serious issues trying to read from ParallelPort.getInputStream. On Windows, readByte seems to return -1 (end of stream) any time data isn't available. On Linux, I got a kernel oops, even with a recent 2.6.23.1 kernel. I was able to stop this using a kernel patch that I found via Google. Although this stopped the oops, I still get frequent IOExceptions when calling InputStream.readByte. It appears that instead of blocking, readByte throws an IOException with message "Resource temporarily unavailable in readByte" any time it is called when no data is available. Occasionally, I get an exception instead of the data I was expecting to read, e.g when asking my printer for a version string I get "VER: S3306 * 06.03* 10/*6/06" where the *s indicate that an exception occurred and data was missed. Any advice that anyone can offer would be much appreciated. If you need any more details or debugging information about any of these problems then let me know. Cheers -- Chris Paton Technical Developer Red61 -- Transaction Marketing Software http://www.red61.com -------------- next part -------------- A non-text attachment was scrubbed... Name: chris.paton.vcf Type: text/x-vcard Size: 230 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20071123/00a747b6/attachment-0011.vcf From hho at bibliotheca.dk Fri Nov 23 06:45:36 2007 From: hho at bibliotheca.dk (Hans Hvelplund Odborg) Date: Fri, 23 Nov 2007 14:45:36 +0100 Subject: [Rxtx] RXTX parallel port issues In-Reply-To: <4746C6E2.3000304@red61.com> References: <4746C6E2.3000304@red61.com> Message-ID: <001201c82dd7$21c6e2c0$6a37a8c0@HANSLAPTOP> I've experienced similar crashes in JVM when writing to the parallel port in windows (with rxtx). Unfortunately I did not save the data sent to the parallel port so cannot say anything about the length. Furthermore, I recall having problems with .write(byte) (would never exit if I recall correctly), but I do not recall if this was with serial or parallel or both. In the end, we ended printing through Java's support of the windows driver. Unfortunately I currently don?t have the time to investigate these issues further. I just wanted to let you know that currently there are bugs in rxtx. Med venlig hilsen / Best regards / Med v?nliga h?lsningar Hans Hvelplund Odborg BIBLIOTHECA A/S Vallensb?kvej 20B ? 2605 Br?ndby ? Denmark Tel.: +45 70271008 Fax: +45 70271009 hho at bibliotheca.dk www.bibliotheca.dk -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Chris Paton Sent: 23. november 2007 13:26 To: rxtx at qbang.org Subject: [Rxtx] RXTX parallel port issues Hi there, I've been happily using RXTX to communicate with a serial based point-of-sale printer for a several months. I've recently received a parallel based printer and have been trying to get RXTX to talk to this too. I've encountered a few problems along the way and just wanted to check if I'm doing anything wrong, or if I've found any bugs. Writing ------- Writing to the parallel port using ParallelPort.getOutputStream works well, except when I use OutputStream.write(byte[]) to write a multiple of 8 bytes (!). Doing this causes the JVM to crash with an EXCEPTION_PRIV_INSTRUCTION on Windows. I worked around this in my application by adding an additional byte if bytesToWrite % 8 == 0. I guess I could also have called write(byte) repeatedly. This also generated a SIGSEGV on Linux but I was unable to reproduce it today using the CVS version of RXTX and a recent kernel. Reading status pins ------------------- On Linux, I've found that ParallelPort.isPaperOut and ParallelPort.isPrinterSelected appear to be inverted; i.e. when the paper is out ParallelPort.isPaperOut returns false, and when there is paper ParallelPort.isPaperOut returns true! I've tested this in both Sun JDK5 and JDK6 on machines running Linux 2.6.21 and 2.6.23. Fortunately it's easy to use a conditional based on System.getProperty("os.name") to hack around this. Reading from InputStream ------------------------ I've had more serious issues trying to read from ParallelPort.getInputStream. On Windows, readByte seems to return -1 (end of stream) any time data isn't available. On Linux, I got a kernel oops, even with a recent 2.6.23.1 kernel. I was able to stop this using a kernel patch that I found via Google. Although this stopped the oops, I still get frequent IOExceptions when calling InputStream.readByte. It appears that instead of blocking, readByte throws an IOException with message "Resource temporarily unavailable in readByte" any time it is called when no data is available. Occasionally, I get an exception instead of the data I was expecting to read, e.g when asking my printer for a version string I get "VER: S3306 * 06.03* 10/*6/06" where the *s indicate that an exception occurred and data was missed. Any advice that anyone can offer would be much appreciated. If you need any more details or debugging information about any of these problems then let me know. Cheers -- Chris Paton Technical Developer Red61 -- Transaction Marketing Software http://www.red61.com From tjarvi at qbang.org Fri Nov 23 16:28:23 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 23 Nov 2007 16:28:23 -0700 (MST) Subject: [Rxtx] RXTX parallel port issues In-Reply-To: <001201c82dd7$21c6e2c0$6a37a8c0@HANSLAPTOP> References: <4746C6E2.3000304@red61.com> <001201c82dd7$21c6e2c0$6a37a8c0@HANSLAPTOP> Message-ID: It would be good to create a bug report for this so others can either look into it or find the report to confirm their suspicions. Currently, there is only one parallel port bug report. http://bugzilla.qbang.org/show_bug.cgi?id=40 As we do update the reports when bugs are fixed, it gives people a chance to put themselves on the CC list and get notification of fixes they are interested in. On Fri, 23 Nov 2007, Hans Hvelplund Odborg wrote: > > I've experienced similar crashes in JVM when writing to the parallel port in > windows (with rxtx). > > Unfortunately I did not save the data sent to the parallel port so cannot > say anything about the length. > > Furthermore, I recall having problems with .write(byte) (would never exit if > I recall correctly), but I do not recall if this was with serial or parallel > or both. > > In the end, we ended printing through Java's support of the windows driver. > > Unfortunately I currently don?t have the time to investigate these issues > further. I just wanted to let you know that currently there are bugs in > rxtx. > > > Med venlig hilsen / Best regards / Med v?nliga h?lsningar > Hans Hvelplund Odborg > > BIBLIOTHECA A/S > Vallensb?kvej 20B ? 2605 Br?ndby ? Denmark > Tel.: +45 70271008 > Fax: +45 70271009 > hho at bibliotheca.dk > www.bibliotheca.dk > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Chris Paton > Sent: 23. november 2007 13:26 > To: rxtx at qbang.org > Subject: [Rxtx] RXTX parallel port issues > > Hi there, > > I've been happily using RXTX to communicate with a serial based > point-of-sale printer for a several months. I've recently received a > parallel based printer and have been trying to get RXTX to talk to this > too. I've encountered a few problems along the way and just wanted to > check if I'm doing anything wrong, or if I've found any bugs. > > Writing > ------- > Writing to the parallel port using ParallelPort.getOutputStream works > well, except when I use OutputStream.write(byte[]) to write a multiple > of 8 bytes (!). Doing this causes the JVM to crash with an > EXCEPTION_PRIV_INSTRUCTION on Windows. I worked around this in my > application by adding an additional byte if bytesToWrite % 8 == 0. I > guess I could also have called write(byte) repeatedly. > > This also generated a SIGSEGV on Linux but I was unable to reproduce it > today using the CVS version of RXTX and a recent kernel. > > Reading status pins > ------------------- > On Linux, I've found that ParallelPort.isPaperOut and > ParallelPort.isPrinterSelected appear to be inverted; i.e. when the > paper is out ParallelPort.isPaperOut returns false, and when there is > paper ParallelPort.isPaperOut returns true! I've tested this in both Sun > JDK5 and JDK6 on machines running Linux 2.6.21 and 2.6.23. Fortunately > it's easy to use a conditional based on System.getProperty("os.name") to > hack around this. > > Reading from InputStream > ------------------------ > > I've had more serious issues trying to read from > ParallelPort.getInputStream. On Windows, readByte seems to return -1 > (end of stream) any time data isn't available. > > On Linux, I got a kernel oops, even with a recent 2.6.23.1 > kernel. I was able to stop this using a kernel patch > > that I found via Google. Although this stopped the oops, I still get > frequent IOExceptions when calling InputStream.readByte. It appears that > instead of blocking, readByte throws an IOException with message > "Resource temporarily unavailable in readByte" any time it is called > when no data is available. Occasionally, I get an exception instead of > the data I was expecting to read, e.g when asking my printer for a > version string I get "VER: S3306 * 06.03* 10/*6/06" where the *s > indicate that an exception occurred and data was missed. > > > Any advice that anyone can offer would be much appreciated. If you need > any more details or debugging information about any of these problems > then let me know. > > Cheers > From manujnaman at yahoo.com Sun Nov 25 14:59:21 2007 From: manujnaman at yahoo.com (manuj naman) Date: Sun, 25 Nov 2007 13:59:21 -0800 (PST) Subject: [Rxtx] Problem reading 1-wire device using RXTX on Linux In-Reply-To: Message-ID: <104159.48942.qm@web37909.mail.mud.yahoo.com> Trent, dmesg | grep tty gives nothing. however, greping for usb does. The output for that is below. touch /var/lock/test.lock file does not exist, the directory does exits though. tail -f /dev/ttyUSB0 gives nothing simply because ttyUSB0 does not exist. Seems as if USB ports are not there... however, numerous /dev/tty* exist starting from /dev/tty, /dev/tty0, /dev/tty1... to ... /dev/ttyzf. The result of dmesg | grep usb is as follows: [17179576.220000] usbcore: registered new driver usbfs [17179576.220000] usbcore: registered new driver hub [17179576.572000] usb 1-1: new low speed USB device using uhci_hcd and address 2 [17179576.992000] usb 2-1: new full speed USB device using uhci_hcd and address 2 [17179577.132000] usbcore: registered new driver hiddev [17179577.188000] input: USB HID v1.11 Mouse [Microsoft Microsoft Wireless Optical Mouse� 1.00] on usb-0000:00:1f.2-1 [17179577.188000] usbcore: registered new driver usbhid [17179577.188000] drivers/usb/input/hid-core.c: v2.6:USB HID core driver [17179577.192000] usb-storage: device found at 2 [17179577.192000] usb-storage: waiting for device to settle before scanning [17179577.192000] usbcore: registered new driver usb-storage [17179582.192000] usb-storage: device scan complete [17209993.728000] usb 1-2: new full speed USB device using uhci_hcd and address 3 [17209994.816000] usbcore: registered new driver DS9490R [17248016.760000] usb 1-1: USB disconnect, address 2 [17302939.908000] usb 1-2: USB disconnect, address 3 [17302944.856000] usb 1-2: new full speed USB device using uhci_hcd and address 4 [17794170.232000] usb 1-2: USB disconnect, address 4 Does it help in diagnosis? The name of the 1-wire viewer device is DS9490 Best regards, Manuj Trent Jarvi wrote: On Wed, 21 Nov 2007, manuj naman wrote: > Hello, > > I am trying to use the RXTX library on Ubuntu (Debian) linux to read iButtons. It works perfectly on Windows. However on my linux machines it gives the following errors. I am using DS9490 (USB port adapter) to read the iButtons. > > I have followed your instructions on the Wiki. I recompiled the rxtx library to produce the .so and .jar files. But still it gives me this: > > manujnaman at sensor:~/iButton/onewireviewer$ java -cp $CLASSPATH:./OneWireAPI.jar:./OneWireViewer.jar OneWireViewer > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > Warning: serial communications API not setup properly, no ports in enumeration > Pure-Java DS9097U adapter will not work, not added to adapter enum > > Standard drivers for 1-Wire are not found. > Please download the latest drivers from http://www.ibutton.com > Or install RXTX Serial Communications API from http://www.rxtx.org > > Do you know how to solve the "Serial communications API not setup properly, no ports in enumeration" problem? > > Also, how to detect which what /dev/* is the port to be used? On Windows this is simply USB1, on linux this is a bit unclear. Hi Manuj What is the output of the following? dmesg |grep tty touch /var/lock/test.lock && rm -f /var/lock/test.lock If you see something like /dev/ttyUSB0 in the dmesg output, what happens if you do something like tail -f /dev/ttyUSB0? These test each of the usual suspects. We are looking for missing USB drivers, no permission to create a lockfile and no read permission for the device. -- Trent Jarvi tjarvi at qbang.org --------------------------------- Be a better sports nut! Let your teams follow you with Yahoo Mobile. Try it now. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071125/ef4f80c4/attachment-0001.html From tjarvi at qbang.org Sun Nov 25 16:43:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 25 Nov 2007 16:43:04 -0700 (MST) Subject: [Rxtx] Problem reading 1-wire device using RXTX on Linux In-Reply-To: <104159.48942.qm@web37909.mail.mud.yahoo.com> References: <104159.48942.qm@web37909.mail.mud.yahoo.com> Message-ID: Hi Manuj, This does help diagnose the problem. Sadly the answer is in the system configuration of your debian system. I can only point you towards some areas that are suspect. /dev/tty01->/dev/ttyzz are terminals which are not of interest. It appears that the usb serial kernel module is not loading. That is usually in a directory like the following: /lib/modules/2.6.*/kernel/drivers/usb/serial modprobe is used to manually load the drivers. Your /dev/* may be created based upon the kernel modules loaded or MAKEDEV may be used to create the devices. /etc/modules.conf may be what is misconfigured though I'm not sure. One of the modules in usb/serial is probably responsible for representing your USB dongle as a tty. UDEV is probably responsible for creating ttyUSB01 once the kernel module is loaded. Perhaps someone has been through this before but basically this is a system configuration problem or a missing kernel driver. Once /dev/USB?? are present, rxtx should find the port. On Sun, 25 Nov 2007, manuj naman wrote: > Trent, > > dmesg | grep tty > gives nothing. however, greping for usb does. The output for that is below. > > touch /var/lock/test.lock file does not exist, the directory does exits though. > > tail -f /dev/ttyUSB0 gives nothing simply because ttyUSB0 does not exist. > > Seems as if USB ports are not there... however, numerous /dev/tty* exist starting from /dev/tty, /dev/tty0, /dev/tty1... to ... /dev/ttyzf. > > The result of dmesg | grep usb is as follows: > > [17179576.220000] usbcore: registered new driver usbfs > [17179576.220000] usbcore: registered new driver hub > [17179576.572000] usb 1-1: new low speed USB device using uhci_hcd and address 2 > [17179576.992000] usb 2-1: new full speed USB device using uhci_hcd and address 2 > [17179577.132000] usbcore: registered new driver hiddev > [17179577.188000] input: USB HID v1.11 Mouse [Microsoft Microsoft Wireless Optical Mouse� 1.00] on usb-0000:00:1f.2-1 > [17179577.188000] usbcore: registered new driver usbhid > [17179577.188000] drivers/usb/input/hid-core.c: v2.6:USB HID core driver > [17179577.192000] usb-storage: device found at 2 > [17179577.192000] usb-storage: waiting for device to settle before scanning > [17179577.192000] usbcore: registered new driver usb-storage > [17179582.192000] usb-storage: device scan complete > [17209993.728000] usb 1-2: new full speed USB device using uhci_hcd and address 3 > [17209994.816000] usbcore: registered new driver DS9490R > [17248016.760000] usb 1-1: USB disconnect, address 2 > [17302939.908000] usb 1-2: USB disconnect, address 3 > [17302944.856000] usb 1-2: new full speed USB device using uhci_hcd and address 4 > [17794170.232000] usb 1-2: USB disconnect, address 4 > > Does it help in diagnosis? The name of the 1-wire viewer device is DS9490 > > Best regards, > Manuj > > > Trent Jarvi wrote: On Wed, 21 Nov 2007, manuj naman wrote: > >> Hello, >> >> I am trying to use the RXTX library on Ubuntu (Debian) linux to read iButtons. It works perfectly on Windows. However on my linux machines it gives the following errors. I am using DS9490 (USB port adapter) to read the iButtons. >> >> I have followed your instructions on the Wiki. I recompiled the rxtx library to produce the .so and .jar files. But still it gives me this: >> >> manujnaman at sensor:~/iButton/onewireviewer$ java -cp $CLASSPATH:./OneWireAPI.jar:./OneWireViewer.jar OneWireViewer >> Experimental: JNI_OnLoad called. >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> Warning: serial communications API not setup properly, no ports in enumeration >> Pure-Java DS9097U adapter will not work, not added to adapter enum >> >> Standard drivers for 1-Wire are not found. >> Please download the latest drivers from http://www.ibutton.com >> Or install RXTX Serial Communications API from http://www.rxtx.org >> >> Do you know how to solve the "Serial communications API not setup properly, no ports in enumeration" problem? >> >> Also, how to detect which what /dev/* is the port to be used? On Windows this is simply USB1, on linux this is a bit unclear. > > > Hi Manuj > > What is the output of the following? > > dmesg |grep tty > > touch /var/lock/test.lock && rm -f /var/lock/test.lock > > If you see something like /dev/ttyUSB0 in the dmesg output, what happens > if you do something like > > tail -f /dev/ttyUSB0? > > These test each of the usual suspects. We are looking for missing USB > drivers, no permission to create a lockfile and no read permission for the > device. > > -- > Trent Jarvi > tjarvi at qbang.org > > > > --------------------------------- > Be a better sports nut! Let your teams follow you with Yahoo Mobile. Try it now. From netbeans at gatworks.com Mon Nov 26 06:53:02 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 26 Nov 2007 08:53:02 -0500 Subject: [Rxtx] #undef TIOCSERGETLSR on LINUX Message-ID: <474ACFBE.5050406@gatworks.com> So I undef'ed the define TIOCSERGETLSR on a linux box, I find that RXTX no longer works . this is a :{ It appears that the sigprocmask( SIG_SETMASK, &newmask, &oldmask ) at src/SerialImp.c:1427 seems to unblock more events than it should. On a linux box there are 2 other events that are blocked, and this code un-sets them, and the thread hangs. It also appears that this code is incomplete. Also, if you only add in the block for SIGCHLD ( which I think is what someone wanted ) , the code will (soon) core-dump ( or silently exit ). So has anyone run with this code ? From tjarvi at qbang.org Mon Nov 26 19:32:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 26 Nov 2007 19:32:54 -0700 (MST) Subject: [Rxtx] #undef TIOCSERGETLSR on LINUX In-Reply-To: <474ACFBE.5050406@gatworks.com> References: <474ACFBE.5050406@gatworks.com> Message-ID: On Mon, 26 Nov 2007, U. George wrote: > So I undef'ed the define TIOCSERGETLSR on a linux box, I find that RXTX > no longer works . this is a :{ > > It appears that the sigprocmask( SIG_SETMASK, &newmask, &oldmask ) at > src/SerialImp.c:1427 seems to unblock more events than it should. On a > linux box there are 2 other events that are blocked, and this code > un-sets them, and the thread hangs. > > It also appears that this code is incomplete. > Also, if you only add in the block for SIGCHLD ( which I think is what > someone wanted ) , the code will (soon) core-dump ( or silently exit ). > > So has anyone run with this code ? Hi George, The case when TIOCSERGETLSR is not defined is currently used on Solaris. Linux has used the TIOCSERGETLSR. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Nov 26 19:56:24 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 26 Nov 2007 21:56:24 -0500 Subject: [Rxtx] #undef TIOCSERGETLSR on LINUX In-Reply-To: References: <474ACFBE.5050406@gatworks.com> Message-ID: <474B8758.6010006@gatworks.com> Technically, with, or without TIOCSERGETLSR it *SHOULD* work the same. Still does not explain the SIGSEGV on the current development code Trent Jarvi wrote: > On Mon, 26 Nov 2007, U. George wrote: > >> So I undef'ed the define TIOCSERGETLSR on a linux box, I find that RXTX >> no longer works . this is a :{ From keithvz at verizon.net Thu Nov 1 08:08:58 2007 From: keithvz at verizon.net (Keith) Date: Thu, 01 Nov 2007 10:08:58 -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: <4729DDFA.7080206@verizon.net> Trent Jarvi wrote: > 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? Well, I honestly don't know how all this fits together. I think it's just a matter of enabling the right flow control option within the standard serial framework to tell the device driver, "HEY START USING DTR/DSR FOR FLOW CONTROL." If what UGeorge said,(about that type of nitty-gritty lead control being done within the device driver), is true, then this confirms my suspicion. I tried narrowing down within the Linux drivers what you are looking for, but I can't entirely tell wth I'm looking at. (virtual com port drivers -- they are included compiled by default with Ubuntu, source included) http://www.ftdichip.com/Drivers/VCP/Linux/ftdi_sio.tar.gz Hahahaa, they make a reference to DTR flow control being supported but say (UGH) in parenthesis. You can also use their direct device driver library on Ubuntu -- libftd2xx.so.0.4.13. No source code. http://www.ftdichip.com/Drivers/D2XX/Linux/libftd2xx0.4.13.tar.gz In that case, you make a call to their FT_SetFlowControl() function. FT_STATUS FT_SetFlowControl (FT_HANDLE ftHandle, USHORT usFlowControl, UCHAR uXon,UCHAR uXoff) Parameters ftHandle Handle of the device. usFlowControl Must be one of FT_FLOW_NONE, FT_FLOW_RTS_CTS, ****FT_FLOW_DTR_DSR**** or FT_FLOW_XON_XOFF. uXon Character used to signal Xon. Only used if flow control is FT_FLOW_XON_XOFF. uXoff Character used to signal Xoff. Only used if flow control is FT_FLOW_XON_XOFF. This is from their programming guide http://www.ftdichip.com/Documents/ProgramGuides/D2XXPG34.pdf I actually want to take this a step further and say that I think the flow control is actually handled right on the device itself in hardware/firmware. It's enabled through the device driver, but I think the maintaining of buffers, asserting/deasserting of leads, etc is handled by the device. For the time being, I've switched to jd2xx, https://jd2xx.dev.java.net/ and http://bleyer.org/jd2xx/ These are Java wrappers for the device driver libraries. It allows almost direct access to the well-documented device drivers from Java. I hope this helps Keith From tjarvi at qbang.org Thu Nov 1 11:09:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:09:51 -0600 (MDT) 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: Hi Martin, What I usually have done is allow changes that do not impact working software including changes to methods not documented in CommAPI (which remain undocumented in rxtx) and fixes to known problems in the documented portions. That way if you use the documented API, the releases should only become better with time. If you use the undocumented portions, the behavior is not as predictable but open for improvement. On Wed, 31 Oct 2007, 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 >> > From tjarvi at qbang.org Thu Nov 1 11:15:52 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:15:52 -0600 (MDT) 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: I too use rxtx in commercial products. The problem I've been trying to address while bringing the server back was how to make it possible for hobby folks to build the same software as companies so we can move rxtx along a little faster. Exposing internal tools is not an option at this time, the public rxtx builds have been done on my home machine which has drives hanging out of it all over the place dying one at a time. This isn't maintainable. I'm currently looking at the possibility of making an S3 image available on Amazon's EC. These are machines you can rent for ~10 cents an hour which is more than enough to build rxtx. The S3 image is not changed when people use it so everyone has the same starting point. With this, we could all build rxtx for ~20 platforms for a small price and eliminate tool issues. On Wed, 31 Oct 2007, Greg Johnson wrote: > 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 tjarvi at qbang.org Thu Nov 1 11:19:55 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:19:55 -0600 (MDT) 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: On Wed, 31 Oct 2007, 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. I was helping Dmitry do the Mac OS X port without access to a machine when we put that in. In the archives there is information (easily found with google on Apple's site) that describes how their API (and others) can determine if a port is used and ignore it. I think these changes are in CVS but need to confirm. The bottom line is that rxtx should not have used lock files on Mac. It was just ignorance of the system on my part. -- Trent Jarvi tjarvi at qbang.org From fabioanjos at gmail.com Thu Nov 1 12:35:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Thu, 1 Nov 2007 15:35:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Hi, I was using SerialEventListener in my project. But, as was said here, id doesnt work very well with virtual serial ports. So, I changed the strategy using the code posted here in this thread: try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > 0) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } The thing is that in my tests I could notice that in.read(buffer) never blocks. Even when there's nothing to read. Instead of blocking when there's nothing to read it returns 0. So, my questions are: 1. Am I doing something wrong? 2. If not, wouldnt this decrease performance? (the thread would be locked in a loop that does nothing.) 3. Is there a better way to do the job? Thanks in advance!! F?bio -------- On 10/31/07, Andre-John Mas wrote: > > > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/0aee59d0/attachment-0028.html From ajmas at sympatico.ca Thu Nov 1 16:07:55 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Nov 2007 18:07:55 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Message-ID: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From sarah_662005 at yahoo.com Thu Nov 1 17:10:05 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Thu, 1 Nov 2007 16:10:05 -0700 (PDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Message-ID: <351433.37166.qm@web55814.mail.re3.yahoo.com> Thank you very much for your help. Now the application works fine. the serialEvent gets triggered. Rxtx is cool! ----- Original Message ---- From: Andre-John Mas To: Sara Hugh ; RXTX Developers and Users Sent: Wednesday, October 31, 2007 9:55:45 AM Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered 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 __________________________________________________ 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/20071101/4a86bea6/attachment-0028.html From tjarvi at qbang.org Thu Nov 1 17:58:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 17:58:02 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx Message-ID: The rxtx.org site is primarily interested in the hobby aspects of rxtx. Obviously, there are some companies following the work too. These interests bring larger workflows and concerns about details hobby folks may not care about. They also bring many more users. I know the company I work for has a quality engineering effort going on which includes rxtx. While the server was down, I was contacted by another company that was missing the binaries for their testing. Several people have mentioned concerns about a stable release for like reasons. Would there be interest on the quality side of the coin to get together? It could be just sharing email's with each other or a seperate list for QE/QA. I can not say for sure, but we may be able to share some of our efforts/results that could help keep rxtx releases stable. -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Fri Nov 2 01:42:55 2007 From: scldad at sdc.com.au (Stephen Davies) Date: Fri, 2 Nov 2007 18:12:55 +1030 Subject: [Rxtx] Multiple modems Message-ID: <200711021812.56047.scldad@sdc.com.au> This may or may not be related to the Multiple Ports thread. I have an application which uses rxtx on Linux (via cron jobs) to connect multiple modems to remote sensing devices. The application works fine most of the time but occasionally fails to connect if two (or more) connection attempts happen at about the same time. When it fails, it looks as if it may get confused as to which port it is talking to. The app has a "base" component that looks for an available port, opens it and then creates an input thread and an output thread for the connection and data transfer. The "base" component uses this code: // loop round all known ports until one is available. Give up after three minutes Counter ptimeout = new Counter(); while(!portFound && ptimeout.elapsed() < 180000) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // special case. ttyS0 is not available to us on this server. if (!portId.isCurrentlyOwned() && !portId.getName().equals("/dev/ttyS0")) { gLog.debug(lognm + ": Found port " + portId.getName()); try { serialPort = (RXTXPort) portId.open("AguaModem", 10000); } catch (Exception e) { gLog.error(lognm + ": Port " + portId.getName() + " will not open."); gLog.error(e.getMessage()); continue; } AguaModem aguamodem = new AguaModem(); portFound = true; break; } gLog.debug(lognm + ": Port " + portId.getName() + " is busy"); } } } I am wondering about the isCurrentlyOwned method. Does this actually tell me whether a port is currently being used by another process? TIA, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From fabioanjos at gmail.com Fri Nov 2 04:59:58 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 07:59:58 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Message-ID: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/9009eb1d/attachment-0028.html From netbeans at gatworks.com Fri Nov 2 06:28:13 2007 From: netbeans at gatworks.com (U. George) Date: Fri, 02 Nov 2007 08:28:13 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <472B17DD.1050508@gatworks.com> It should normally block ( unless eof / event ) . so its a :{ whats the device ( to recreate if possible ) and how do u open. > My question is, is there a way to make in.read block the thead until > there's something to read? > From fabioanjos at gmail.com Fri Nov 2 06:34:46 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 09:34:46 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > On 11/1/07, Andre-John Mas wrote: > > > > Fabio, > > > > Turns out there was a small error in my example. The test should be: > > > > (numBytes = in.read(buffer)) > -1 > > > > This is because -1 indicates an end of file (end of data stream) > > > > Andre > > > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > > > Hi, > > > > > > I was using SerialEventListener in my project. But, as was said > > > here, id doesnt work very well with virtual serial ports. > > > So, I changed the strategy using the code posted here in this thread: > > > > > > try{ > > > in = port.getInputStream(); > > > out = port.getOutputStream(); > > > int numBytes = 0; > > > while(active){ > > > > > > byte[] buffer = new byte[10]; > > > > > > while ( (numBytes = in.read(buffer)) > 0) > > > { > > > String dataValue = new String(buffer,0,numBytes); > > > processInput(dataValue); > > > } > > > > > > if(numBytes==-1){ > > > break; > > > } > > > > > > Thread.sleep(50); > > > } > > > > > > }catch(IOException e){ > > > logger.info("falha de comunicacao "+ > > > getReceptor().getPort() ); > > > > > > }catch(InterruptedException e){ > > > logger.info ("Interrompendo leitura da porta "+ > > > getReceptor().getPort() ); > > > } > > > > > > The thing is that in my tests I could notice that in.read(buffer) > > > never blocks. Even when there's nothing to read. Instead of blocking > > > when there's nothing to read it returns 0. > > > > > > So, my questions are: > > > > > > 1. Am I doing something wrong? > > > 2. If not, wouldnt this decrease performance? (the thread would be > > > locked in a loop that does nothing.) > > > 3. Is there a better way to do the job? > > > > > > Thanks in advance!! > > > > > > F?bio > > > -------- > > > > > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > > 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 > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > > > > > -- > > > Atenciosamente, > > > F?bio Cristiano dos Anjos > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/5306c4b1/attachment-0028.html From nick.circelli at infrasafe.com Fri Nov 2 07:01:17 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Fri, 2 Nov 2007 08:01:17 -0500 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com><29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com><90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca><29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Message-ID: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> I'm pretty sure that not blocking has to do with you virtual ports. Cause it should block. Maybe you should try: while ((numBytes = in.available()) > 0) { If (numBytes > buffer.length) { numBytes = buffer.length; // in case you have buffer overflow } numBytes = in.read(buffer, 0 , numBytes)); String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } Also, just for optimization, I'd move that byte[] buffer = new byte[10]; out of the while since you don't need to reallocate it every iteration. ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of F?bio Cristiano dos Anjos Sent: Friday, November 02, 2007 8:35 AM To: RXTX Developers and Users Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream (); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas < ajmas at sympatico.ca > wrote: Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info ("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Atenciosamente, F?bio Cristiano dos Anjos -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/4de7f6a3/attachment-0028.html From fabioanjos at gmail.com Fri Nov 2 07:36:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 10:36:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> Message-ID: <29788b250711020636q1588c88fgaa5e27f5504164fb@mail.gmail.com> Hi Nick, Actually, it doesnt block for physical ports too. And, the method avaiable does not block either, so when there's nothing avaiable the loop ends and the thread stops lintening to the port. But I did some more test with serialEventListener, and now its working. I realy dont know what I've done to get it working. I just start woking as soon as I decided to test it again. It was said here that serialEventListener is not reliable for virtual serial ports. Is there another way to read it, without compromising performance? Tanks again!! F?bio ------- On 11/2/07, Nick Circelli wrote: > > I'm pretty sure that not blocking has to do with you virtual ports. > Cause it should block. > > Maybe you should try: > > > > while ((numBytes = in.available()) > 0) > > { > > If (numBytes > buffer.length) { > > numBytes = buffer.length; // in case you have buffer overflow > > } > > numBytes = in.read(buffer, 0 , numBytes)); > > String dataValue = new String(buffer,0,numBytes,"ASCII"); > > processInput(dataValue); > > } > > > > Also, just for optimization, I'd move that byte[] buffer = new > byte[10]; > > out of the while since you don't need to reallocate it every iteration. > > > ------------------------------ > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On Behalf > Of *F?bio Cristiano dos Anjos > *Sent:* Friday, November 02, 2007 8:35 AM > *To:* RXTX Developers and Users > *Subject:* Re: [Rxtx] serialEvent(SerialPortEvent event) never be > triggered > > > > Hi, > > I think i missunderstand something here. > The code you post here was meant to be used inside serialEvent method, > right? > > The think is, that i cannot user SerialEventListener to read serial ports, > because i need to read virual serial ports and id does not behaves well, as > said here before. serialEvent is never triggered. > > So what I quit using SerialEventListener and created a thread to listen to > the port: > > public void run(){ > try{ > in = port.getInputStream(); > out = port.getOutputStream (); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new > String(buffer,0,numBytes,"ASCII"); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ getReceptor().getPort() > ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > } > > > So, the problem is that in.read(buffer) always returns 0 when there is > nothing to read, instead of blocking the flow, and the thread becames locked > in the loop. > > I hope you can help me solve this. > > Thanks in advance! > > F?bio > -------- > > On 11/2/07, *F?bio Cristiano dos Anjos* wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > > > On 11/1/07, *Andre-John Mas* < ajmas at sympatico.ca> wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info ("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/571df6ea/attachment-0027.html From tjarvi at qbang.org Fri Nov 2 08:32:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Nov 2007 08:32:15 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: References: Message-ID: On Fri, 2 Nov 2007, Greg Johnson wrote: > Hi Trent, folks, > Having a single rxtx that is suitable for commercial uses and hobbyists both > would be a great idea? Perhaps it would be worth submitting rxtx as a > proposal to Codehaus - they not only provide excellent tools (Jira (bug > tracker), Confluence (wiki)) but also support build management ( > maestro, continuum, bamboo). Relying on your personal machine (btw, frii.com > / rxtx.org is down again?) seems like a burden you shouldn't have to shoulder > alone. Hi Greg, There may be a little confusion here. There is no need to have two seperate rxtx releases. What I'm trying to encourage is a discussion between some of the people responsible for making sure rxtx does not break their products each release. Usually these people are interested in testing a set of functionality their product depends upon. They do not work with rxtx code but rather traps to catch when rxtx developers break something. This goes on all the time in isolated labs. There are many services that offer to do various pieces of a project for you if you... Anyone is free to do the 'if you' portion with rxtx and see how it goes. I'm actually interested in doing less of that than more. The rxtx.org work I do just happens to overlap with other things I do for personal/family use. The reason I suggest the amazon solution is that anyone can take full control of the environment for a day and it costs less than a package of gum without causing harm to what anyone else is doing. I assume the down question was with respect to a mod_security setting that has been resolved. If not, please post a url to the problem. -- Trent Jarvi tjarvi at qbang.org From nsayer at kfu.com Sat Nov 3 20:17:49 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 19:17:49 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? Message-ID: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Has anyone got RXTX working with an app under Leopard? My app hangs on port open (it works fine with Tiger). The relevant thread looks like this in the activity monitor: 1536 JVM_InvokeMethod 1536 0x48ccd0 1536 0x46f8a0 1536 0x4c3ff4 1536 0x4c4284 1536 0x357d160 1536 0x357faac 1536 Java_gnu_io_RXTXPort_open 1536 open $NOCANCEL$UNIX2003 1536 open $NOCANCEL$UNIX2003 From ajmas at sympatico.ca Sat Nov 3 22:02:04 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 00:02:04 -0400 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> RXTX works for me with Leopard. I am currently using it communicate with a Bluetooth GPS. What computer and device are you trying to use? Is the driver for your serial device compatible with MacOS X 10.5? Andre On 3-Nov-07, at 22:17 , Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From nsayer at kfu.com Sat Nov 3 22:17:47 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 21:17:47 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> Message-ID: <1720F723-3643-438C-B3AB-E09A67536977@kfu.com> On Nov 3, 2007, at 9:02 PM, Andre-John Mas wrote: > RXTX works for me with Leopard. I am currently using it communicate > with a Bluetooth GPS. > > What computer and device are you trying to use? Is the driver for > your serial device compatible with MacOS X 10.5? An Intel mac mini The FTDI USB serial driver an XMPCR, which is just a fancy serial controlled radio and an FTDI usb-to-serial chip I've successfully used the FTDI driver with another FTDI device in another context. > > > Andre > > On 3-Nov-07, at 22:17 , Nick Sayer wrote: > >> Has anyone got RXTX working with an app under Leopard? >> >> My app hangs on port open (it works fine with Tiger). The relevant >> thread looks like this in the activity monitor: >> >> 1536 JVM_InvokeMethod >> 1536 0x48ccd0 >> 1536 0x46f8a0 >> 1536 0x4c3ff4 >> 1536 0x4c4284 >> 1536 0x357d160 >> 1536 0x357faac >> 1536 >> Java_gnu_io_RXTXPort_open >> 1536 open >> $NOCANCEL$UNIX2003 >> 1536 open >> $NOCANCEL$UNIX2003 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From racecar at gmail.com Sat Nov 3 22:25:53 2007 From: racecar at gmail.com (Kevin Mateo Lim) Date: Sat, 3 Nov 2007 21:25:53 -0700 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: Message-ID: I am alternating between two errors. After i run the macosx_setup.command, "everyone" is set to Read only in /var/lock. I notice in the terminal that the group for these perms is _uucp, not uucp. In that state, I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 check_group_uucp(): error testing lock file creation Error details:Permission deniedcheck_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException : Error inside Serial.() at processing.serial.Serial.errorMessage(Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.( Serial.java:102) at Temporary_829_3245.setup(Temporary_829_3245.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java :690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) Then, I hand edit the "everyone" permissions for /var/lock/ to Read and Write (note /var/spool/uucp is Read/Write in all cases, and doesn't change). I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX uucp_lock() /var/lock/LK.003.009.000 is there gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException: Error inside Serial.() at processing.serial.Serial.errorMessage (Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.(Serial.java:102) at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java:690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) See here: http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071103/f1a2c467/attachment-0026.html From greg.johnson at manchester.ac.uk Sun Nov 4 02:31:13 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sun, 4 Nov 2007 10:31:13 +0100 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <28B5E0A0-0802-4C74-AC21-87ED35F3B9A2@manchester.ac.uk> Hi Nick, I also had problems initially with Leopard, but it was resolved by reinstalling the serial USB driver (FTDI in my case). The symptoms were a non-detection of any ports (but I twigged when I tried ZTerm and it had the same problem). Good luck! Cheers, greg PS I did a "Archive and install" which may be the reason my FTDI driver had disappeared - I don't think the driver has changed for 10.5 ------------------------------------------------------------------------- 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 4 Nov 2007, at 03:17, Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Sun Nov 4 13:01:12 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 15:01:12 -0500 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: Message-ID: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Hi, You will need to get the 2.1-8 code from CVS. See the FAQ for more information: http://rxtx.qbang.org/wiki/index.php/FAQ Andre On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > I am alternating between two errors. > > After i run the macosx_setup.command, "everyone" is set to Read only > in /var/lock. I notice in the terminal that the group for these > perms is _uucp, not uucp. > > In that state, I get this error: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > check_group_uucp(): error testing lock file creation Error > details:Permission deniedcheck_lock_status: No permission to create > lock file. > please see: How can I use Lock Files with rxtx? in INSTALL > gnu.io.PortInUseException: Unknown Application > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > java.lang.RuntimeException : Error inside Serial.() > > at processing.serial.Serial.errorMessage(Serial.java:583) > > at processing.serial.Serial.(Serial.java:148) > > at processing.serial.Serial.( Serial.java:102) > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > at processing.core.PApplet.run(PApplet.java:1556) > > at java.lang.Thread.run(Thread.java:613) > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > and Write (note /var/spool/uucp is Read/Write in all cases, and > doesn't change). I get this error: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > gnu.io.PortInUseException: Unknown Application > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > java.lang.RuntimeException: Error inside Serial.() > > at processing.serial.Serial.errorMessage (Serial.java:583) > > at processing.serial.Serial.(Serial.java:148) > > at processing.serial.Serial.(Serial.java:102) > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > at processing.core.PApplet.run(PApplet.java:1556) > > at java.lang.Thread.run(Thread.java:613) > > See here: > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From netbeans at gatworks.com Sun Nov 4 14:33:35 2007 From: netbeans at gatworks.com (U. George) Date: Sun, 04 Nov 2007 16:33:35 -0500 Subject: [Rxtx] #ifndef TIOCSERGETLSR Message-ID: <472E3AAF.7050709@gatworks.com> For Linux, it seems that you need the code for both *having* a TIOCSERGETLSR, and *not having* a TIOCSERGETLSR. Maybe the ioctl exists system wide, but not necessarily for the device driver itself ( always returns -1 ) . Are there systems that have a *functioning* TIOCSERGETLSR for all their devices? Then this would be the case where the "#ifndef TIOCSERGETLSR" directive could be useful is eliminating the unnecessary code and tests. And for those systems that dont have a TIOCSERGETLSR, then the code for TIOCSERGETLSR can be eliminated. It would be a simple case to have, as a foundation, all the code to simulate the missing TIOCSERGETLSR ioctl. If the system does have the ioctl, then that code can be ifdef'd in, and co-exist with the functionality of the code that simulates the missing TIOCSERGETLSR ioctl. From racecar at gmail.com Sun Nov 4 17:30:19 2007 From: racecar at gmail.com (Kevin Mateo Lim) Date: Sun, 4 Nov 2007 17:30:19 -0700 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: the README.OSX reads: Put libSerial.jnilib in the directory of the application (the JavaVM will find it there). Add RXTXComm.jar to the application classpath or include the classes in the application jar. (Some applications already include the RXTX classes in their application jar, in which case only the file libSerial.jnilib is required). I can't find libSerial.jnilib I put librxtxSerial.jnilib into my Processing /libraries/serial/library/ directory. Yet it still sees the old version: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 On 11/4/07, Andre-John Mas wrote: > > Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > 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/20071104/c0a83f91/attachment-0025.html From ajmas at sympatico.ca Sun Nov 4 17:41:47 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 19:41:47 -0500 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> If you are wanting it to be available for all applications, - for all users: /Library/Java/Extensions - for your user: ~/Library/Java/Extensions Or just for your application, then it should be in the same directory from which yo are launching your application. If you are getting the 2.1-8 source, then the library built is called: librxtxSerial.jnilib despite what the docs say. Andre On 4-Nov-07, at 19:30 , Kevin Mateo Lim wrote: > > the README.OSX reads: > Put > libSerial.jnilib > in the directory of the application (the JavaVM will find it there). > Add > RXTXComm.jar > to the application classpath or include the classes in the > application jar. > (Some applications already include the RXTX classes in their > application jar, > in which case only the file libSerial.jnilib is required). > > > I can't find libSerial.jnilib > I put librxtxSerial.jnilib into my Processing /libraries/serial/ > library/ directory. > > Yet it still sees the old version: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > On 11/4/07, Andre-John Mas wrote: Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial .(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay (PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > From bschlining at gmail.com Sun Nov 4 19:46:23 2007 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 4 Nov 2007 18:46:23 -0800 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> Message-ID: > > Or just for your application, then it should be in the same directory > from which yo are launching your application. Just wanted to add one more way of specifying the native lib location... If you don't want to define it globally by putting it in /Library/Java/Extensions (and you don't, it's a very very bad practice) you can also specify the location of the native library when starting the JVM by specifying the 'java.library.path' property. For example: java -Djava.library.path=/Path/To/Directory/With/RXTX/Library YourMainClass -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071104/c5af6980/attachment-0025.html From greg.johnson at manchester.ac.uk Mon Nov 5 01:39:02 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Mon, 5 Nov 2007 09:39:02 +0100 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: The 2.1-8 code reports 2.1-7, hence your (and my) confusion. But as long as you've removed all traces of the old library, it really _is_ 2.1-8. And if you specify the library path to the VM, don't make my mistake (on OSX at least) - you need to respecify the entire library path it had by default, as the command line argument replaces the path, rather than appending to it. 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 5 Nov 2007, at 01:30, Kevin Mateo Lim wrote: > > the README.OSX reads: > Put > libSerial.jnilib > in the directory of the application (the JavaVM will find it there). > Add > RXTXComm.jar > to the application classpath or include the classes in the > application jar. > (Some applications already include the RXTX classes in their > application jar, > in which case only the file libSerial.jnilib is required). > > > I can't find libSerial.jnilib > I put librxtxSerial.jnilib into my Processing /libraries/serial/ > library/ directory. > > Yet it still sees the old version: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > On 11/4/07, Andre-John Mas wrote: > Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial .(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay (PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > 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 HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071105/7f50506d/attachment-0025.html From cyrille.dumont at tatexpress.fr Mon Nov 5 05:46:03 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 05 Nov 2007 13:46:03 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: References: <472727F1.1000704@tatexpress.fr> Message-ID: <472F108B.2090101@tatexpress.fr> Thanks a lot for your solution ... but I'm not a expert in JAVA ... (sorry) For the moment I've this function : """ public void serialEvent(SerialPortEvent e) { StringBuffer inputBuffer = new StringBuffer(); int newData = 0; switch (e.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } //-- Manag. Data from Scanner this.MngDataScanner(inputBuffer.toString()); break; case SerialPortEvent.BI:; //-- Break Received } } """ How can I do what you write ? ( maybe a simple ex ? ) PS : I don't know the PDF417 size (could be, for example, 338 char, or 500 ... ; what I know is that it can't be more than 800 char) Thanks in advance. Best regards. Trent Jarvi a ?crit : > 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 Martin.Oberhuber at windriver.com Mon Nov 5 08:47:50 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 5 Nov 2007 16:47:50 +0100 Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> Hi Trent, are the interestes of hobbyists really so different from commercial ones? Both should be interested in high quality and innovation the like. I haven't seen too many Open Source projects from the "inside" but those that I have seen did not have separate mailing lists for quality/testing/qa versus innovation/development. What I have seen with the Open Source projects that one would call "successful" is a good deal of process around automated builds, automated unit tests, predictable release dates and milestones, and policies around commiting/contributing/reviewing changes. I think that all of these benefit commercial users and hobbyists the like. If you were just asking about who's interested in discussing changes to foster more quality, count me in. I'm just not sure whether discussing these on a separate mailing list or other channel is the right thing to do. Cheers, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From toupsz at cs.tamu.edu Tue Nov 6 14:27:04 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 15:27:04 -0600 Subject: [Rxtx] reading TTL level signals from serial? Message-ID: Dear RXTX community- I've been using RXTX to handle communicating with several hardware devices in Java (a GPS and some custom audio circuitry for my dissertation work). I have a new, high-accuracy GPS which only communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there any way to communicate with this device using RXTX, perhaps by modding the native code for Windows? If so, does anyone have any tips on how to do it? Has it perhaps already been done? Another option is for me to invert / amplify the signal in hardware, but this is difficult for me to pull off due to the sensitivity of the electronics involved...I'll likely end up using a much less accurate piece of equipment rather than go that far! If anyone could help out, I'd really appreciate it! Thanks! -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/b6c59c2b/attachment-0023.html From netbeans at gatworks.com Tue Nov 6 14:55:22 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 06 Nov 2007 16:55:22 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: Message-ID: <4730E2CA.3090009@gatworks.com> This is really a hardware issue. Is there any device ( ie the serial port ) on your computer that will accept the voltage signals ( and load ) that your device produces? Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it happen safely ( ie u dont cook the GPS device ) I have a new, high-accuracy GPS which only > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there > any way to communicate with this device using RXTX, From toupsz at cs.tamu.edu Tue Nov 6 15:14:01 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 16:14:01 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4730E2CA.3090009@gatworks.com> References: <4730E2CA.3090009@gatworks.com> Message-ID: Actually, the device runs over USB, but shows up as a virtual serial port and is outputting these signals. The software that comes with the device (a u-blox ANTARIS 4 eval kit) is able to communicate. RXTX is able to detect and properly configure the port, but does not get any of the data from it. :-/ It seems like there must be some way to do it (obviously, ublox knows how)... -Zach On Nov 6, 2007 3:55 PM, U. George wrote: > This is really a hardware issue. > Is there any device ( ie the serial port ) on your computer that will > accept the voltage signals ( and load ) that your device produces? > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it > happen safely ( ie u dont cook the GPS device ) > > > I have a new, high-accuracy GPS which only > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there > > any way to communicate with this device using RXTX, > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/15ae7a0b/attachment-0023.html From keithvz at verizon.net Tue Nov 6 16:16:55 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 06 Nov 2007 18:16:55 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> Message-ID: <4730F5E7.1030704@verizon.net> Zach Toups wrote: > On Nov 6, 2007 3:55 PM, U. George > wrote: > > This is really a hardware issue. > Is there any device ( ie the serial port ) on your computer that will > accept the voltage signals ( and load ) that your device produces? > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it > happen safely ( ie u dont cook the GPS device ) > > > I have a new, high-accuracy GPS which only > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is > there > > any way to communicate with this device using RXTX, > _______________________________________________ As UGeorge intimated, it's a hardware issue. If your device outputs TTL level voltages, and your USB to serial converter is RS-232, then you've got a physical hardware differences. Inverted leads and voltage issues are mainly the problem. MAXIM makes a neat little chip called the MAX233 (better than the 232, no extern caps required) You can't solve this in software. Now, there are TTL level compatible USB to serial converters available, I happen to be using one right now. This unit below is from a UK company (there might be sources in the US) http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm Parallax makes one that does 3.3 and 5v http://www.parallax.com/detail.asp?product_id=32201 (but only supports RX, TX, GND, AND DTR towards device) (i've tested a variant of the unit above, and it works with RXTX) In both cases, you'll need some creative wiring depending on the interface on your GPS. Hope this helps Keith From toupsz at cs.tamu.edu Tue Nov 6 16:53:01 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 17:53:01 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4730F5E7.1030704@verizon.net> References: <4730E2CA.3090009@gatworks.com> <4730F5E7.1030704@verizon.net> Message-ID: Yeah...I used an FTDI chip to handle USB/serial conversion on the audio equipment I built. I'm leery of trying to build a board for this ublox GPS due to all the grounding/shielding issues around it. Anyway, I apreciate the help...just sad that I can't handle the problem in software! Ublox did send me the source code for their USB drivers...but as a Java programmer, it's a bit tough for me to sort out. ;) Thanks again! -Zach On Nov 6, 2007 5:16 PM, Keith Monahan wrote: > Zach Toups wrote: > > > On Nov 6, 2007 3:55 PM, U. George > > wrote: > > > > This is really a hardware issue. > > Is there any device ( ie the serial port ) on your computer that > will > > accept the voltage signals ( and load ) that your device produces? > > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make > it > > happen safely ( ie u dont cook the GPS device ) > > > > > > I have a new, high-accuracy GPS which only > > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is > > there > > > any way to communicate with this device using RXTX, > > _______________________________________________ > > As UGeorge intimated, it's a hardware issue. > > If your device outputs TTL level voltages, and your USB to serial > converter is RS-232, then you've got a physical hardware differences. > Inverted leads and voltage issues are mainly the problem. MAXIM makes a > neat little chip called the MAX233 (better than the 232, no extern caps > required) > > You can't solve this in software. > > Now, there are TTL level compatible USB to serial converters available, > I happen to be using one right now. > > This unit below is from a UK company (there might be sources in the US) > > http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm > > Parallax makes one that does 3.3 and 5v > > http://www.parallax.com/detail.asp?product_id=32201 > (but only supports RX, TX, GND, AND DTR towards device) > > (i've tested a variant of the unit above, and it works with RXTX) > > In both cases, you'll need some creative wiring depending on the > interface on your GPS. > > Hope this helps > > Keith > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/06e88ad4/attachment-0023.html From netbeans at gatworks.com Tue Nov 6 17:14:01 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 06 Nov 2007 19:14:01 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> <4730F5E7.1030704@verizon.net> Message-ID: <47310349.5000406@gatworks.com> what gps chipset do u have? > Ublox did send me the source code for their USB drivers...but as a Java > programmer, it's a bit tough for me to sort out. ;) From Steffen.DETTMER at ingenico.com Wed Nov 7 03:10:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 7 Nov 2007 11:10:01 +0100 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> Message-ID: <20071107101000.GN10978@elberon.bln.de.ingenico.com> * Zach Toups wrote on Tue, Nov 06, 2007 at 16:14 -0600: > Actually, the device runs over USB, but shows up as a virtual > serial port and is outputting these signals. Ahh, so what you want is to use rxtx on the serial port that is created by the driver and mapped maybe as some COM8 or whatever? I this case then IMHO it would be no hardware question but maybe a problem in your application, or some driver or indeed a rxtx issue. > The software that > comes with the device (a u-blox ANTARIS 4 eval kit) is able to > communicate. Is it sure that this software is really using the virtual serial port and only this port? oki, Steffen -- About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Wed Nov 7 04:59:10 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 06:59:10 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <20071107101000.GN10978@elberon.bln.de.ingenico.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> Message-ID: <4731A88E.6080705@gatworks.com> >> The software that >> comes with the device (a u-blox ANTARIS 4 eval kit) is able to >> communicate. > > Is it sure that this software is really using the virtual serial > port and only this port? > I have tried to read the docs. I have yet to find any explanation on a (windoz) device driver for this device ( the usb device ). That magic is not explained. For a developer thats important magic. Maybe a call to their support team is in order? From netbeans at gatworks.com Wed Nov 7 05:01:38 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 07:01:38 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <20071107101000.GN10978@elberon.bln.de.ingenico.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> Message-ID: <4731A922.7@gatworks.com> Steffen DETTMER wrote: > * Zach Toups wrote on Tue, Nov 06, 2007 at 16:14 -0600: >> Actually, the device runs over USB, but shows up as a virtual BTW: it seems that I am not getting all the Rxtx mail. Is there still a problem? From toupsz at cs.tamu.edu Wed Nov 7 07:36:20 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Wed, 7 Nov 2007 08:36:20 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4731A88E.6080705@gatworks.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> <4731A88E.6080705@gatworks.com> Message-ID: When I emailed them about this issue, they sent me their WinCE drivers, which are apparently based on this open source driver: http://www.yetanotherhomepage.com/j7xx/j7xx.html?/j7xx/software/util/usbdriver.html These include srcdll, and x86 subfolders, though it's not 100% clear to me that these are useful. The ublox communication suite appears to only communicate with serial ports...I've communicated with the ublox on two different comm ports (one with the serial adapter plugged into the serial port, one with the main USB connection), as well as a Garmin bluetooth GPS (which comes up as a bluetooth serial device). I'm not well versed in code this close to the hardware, but it seems to me that if you're running a virtual serial port, then you're virtually controlling the "voltages" that come in on this "port"...so why would they be "ttl level"? :-/ Shouldn't the USB driver be able to interpret the signals in whatever way it wants and just supply software with the binary interpretation? Thanks for all the help, guys, it's really appreciated! -Zach On Nov 7, 2007 5:59 AM, U. George wrote: > > >> The software that > >> comes with the device (a u-blox ANTARIS 4 eval kit) is able to > >> communicate. > > > > Is it sure that this software is really using the virtual serial > > port and only this port? > > > > I have tried to read the docs. I have yet to find any explanation on a > (windoz) device driver for this device ( the usb device ). That magic > is not explained. For a developer thats important magic. Maybe a call > to their support team is in order? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071107/18a13314/attachment-0022.html From netbeans at gatworks.com Wed Nov 7 08:55:55 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 10:55:55 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> <4731A88E.6080705@gatworks.com> Message-ID: <4731E00B.9030902@gatworks.com> There are 2 components to talking to hardware. There is the electrical specification, and then there is the software specification. there is the rs232 specification, parallel port specification, and the USB electrical specification. Generally these are used to plug in the various devices, and hook up electrically. Then there is the software side. There is the device driver, a software component that sits somewhere in the kernel that handles the USB ( in your case ) controller. The device driver generally does not care about the electrical component. There are various chips that handle USB signals, and these chips have I/O addresses so that signals and data can be properly routed. There is also the side that communicates to the user via the COM port device-name. The device driver that you mentioned is for the "Support PL2303 serial chip". This device driver, which hopefully works, handles the USB chip, and eventually recognzes the gps device, and hopefully creates an COM port so the user can open up and communicate. These are a lot of "HOPES". Since u have the web address of the device driver, and developer, I would think that the developer, and any docs, might be better able to help u to first determine if the GPS device is recognized, and the COM port ( maybe its called by another name ) is created, as per documentation. > > These include srcdll, and x86 subfolders, though it's not 100% clear to > me that these are useful. From tjarvi at qbang.org Sat Nov 10 17:46:13 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Nov 2007 17:46:13 -0700 (MST) Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 5 Nov 2007, Oberhuber, Martin wrote: > Hi Trent, > > are the interestes of hobbyists really so different > from commercial ones? Both should be interested in > high quality and innovation the like. > > I haven't seen too many Open Source projects from the > "inside" but those that I have seen did not have > separate mailing lists for quality/testing/qa > versus innovation/development. > > What I have seen with the Open Source projects that > one would call "successful" is a good deal of > process around automated builds, automated unit > tests, predictable release dates and milestones, > and policies around commiting/contributing/reviewing > changes. > > I think that all of these benefit commercial users > and hobbyists the like. > > If you were just asking about who's interested in > discussing changes to foster more quality, count > me in. I'm just not sure whether discussing these > on a separate mailing list or other channel is the > right thing to do. > Hi Martin, There are two issues I'm thinking about. The first is the generic unit testing and quality initiatives required to move rxtx forward. The second is the inevitable fact that rxtx connects to external hardware. The discussion deals with a different set of problems. Here is a simple example of what I'm getting at. We have the capability of setting custom baud rates in rxtx. We may be interested in seeing regressions in rxtx, the C library or the kernel. Some people may be doing some tests with loopback connections. These will always work even if the baud rate is not set to the expected value. Some people may use null modems between two ports. This may be able to catch the problem but not always. Will the build machines be able to test this? (no - for a few reasons) Will people be trying to catch these type of regressions? (yes) What type of coverage does the community have in the end? (?) We could include the discussions in the same list or another equally open list that may be of interest to some folks that deal with these types of problems on a regular basis. -- Trent Jarvi tjarvi at qbang.org From timlow84 at gmail.com Mon Nov 12 00:31:17 2007 From: timlow84 at gmail.com (Timothy Low) Date: Mon, 12 Nov 2007 15:31:17 +0800 Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> Message-ID: <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> ---------- Forwarded message ---------- From: Timothy Low Date: Nov 12, 2007 3:02 PM Subject: Building RXTX From Source To: taj at www.linux.org.uk Cc: ferdinand.tang at tangs.net, Timothy Low , chweehuat.ng at tangs.net Hi Trent, I tried building RXTX from source, and I got this error. I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm trying to get the necessary ".so" files to use for my serial port communication through java. My linux kernal information is: *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 x86_64 x86_64 x86_64 GNU/Linux* I'll most glad if you can provide me some direction on this. Thanks ! ---------------- [root at smsgateway rxtx-2.0-7pre1]# ./configure checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu configure: WARNING: Trying libtool. If the following fails install libtool checking for gcc... gcc checking for C compiler default output... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking for ld used by GCC... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking for a sed that does not truncate output... /bin/sed checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking command to parse /usr/bin/nm -B output... ok checking how to run the C preprocessor... gcc -E checking for egrep... grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for ranlib... ranlib checking for strip... strip checking for objdir... .libs checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.lo... yes checking if gcc supports -fno-rtti -fno-exceptions... yes checking whether the linker (/usr/bin/ld) supports shared libraries... yes checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking dynamic linker characteristics... GNU/Linux ld.so checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no checking whether -lc should be explicitly linked in... no creating libtool checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking for style of include used by make... GNU checking dependency style of gcc... none checking fcntl.h usability... yes checking fcntl.h presence... yes checking for fcntl.h... yes checking sys/fcntl.h usability... yes checking sys/fcntl.h presence... yes checking for sys/fcntl.h... yes checking sys/file.h usability... yes checking sys/file.h presence... yes checking for sys/file.h... yes checking sys/time.h usability... yes checking sys/time.h presence... yes checking for sys/time.h... yes checking sys/signal.h usability... yes checking sys/signal.h presence... yes checking for sys/signal.h... yes checking signal.h usability... yes checking signal.h presence... yes checking for signal.h.. . yes checking termios.h usability... yes checking termios.h presence... yes checking for termios.h... yes checking asm/termbits.h usability... yes checking asm/termbits.h presence... yes checking for asm/termbits.h... yes checking grp.h usability... yes checking grp.h presence... yes checking for grp.h... yes checking pwd.h usability... yes checking pwd.h presence... yes checking for pwd.h... yes checking whether gcc needs -traditional... no checking whether to enable maintainer-specific portions of Makefiles... no /usr/java/jdk1.5.0_13 configure: WARNING: using JAVA_HOME environmental variable adjusted java.home is /usr/java/jdk1.5.0_13 checking os.name Linux checking os.arch i386 checking java.vendor Sun Microsystems Inc. checking java.version 1.5.0_13 checking os.version 2.6.18-8.el5xen comm.jar appears to be installed already. conftest.c: In function 'main': conftest.c:6: warning: incompatible implicit declaration of built-in function 'printf' conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:6: error: (Each undeclared identifier is reported only once conftest.c:6: error: for each function it appears in.) conftest.c:6: error: expected ')' before string constant conftest.c:7: warning: incompatible implicit declaration of built-in function 'exit' ./configure: line 9649: ./conftest: No such file or directory ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected conftest.c: In function 'main': conftest.c:5: warning: incompatible implicit declaration of built-in function 'printf' conftest.c:10: warning: incompatible implicit declaration of built-in function 'exit' configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status : config.h is unchanged config.status: executing depfiles commands [root at smsgateway rxtx-2.0-7pre1]# make install /usr/java/jdk1.5.0_13/bin/javac -classpath .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d /home/jboss/sources/rxtx- 2.0-7pre1/ -O /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java /home/jboss/sources/rxtx-2.0-7pre1/./src/UnSupportedLoggerException.java /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o /home/jboss/sources/rxtx-2.0-7pre1/x86_64-unknown-linux-gnu/SerialImp.lo /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'init_threads': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: cast from pointer to integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_nativeDrain': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: cast to pointer from integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'read_byte_array': /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: cast to pointer from integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_readArray': /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: comparison is always false due to limited range of data type /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_readTerminatedArray': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: comparison is always false due to limited range of data type mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial- 2.0.7pre1.* gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so -o .libs/librxtxSerial-2.0.7pre1.so (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.0.7pre1.so librxtxSerial.so) creating librxtxSerial.la (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la librxtxSerial.la) gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/ParallelImp.lo /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function 'Java_javax_comm_LPRPort_readArray': /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: comparison is always false due to limited range of data type rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* .libs/librxtxParallel-2.0.7pre1.* gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so -o .libs/librxtxParallel- 2.0.7pre1.so (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.0.7pre1.so librxtxParallel.so) creating librxtxParallel.la (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la librxtxParallel.la) make all-am make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' libtool: install: `x86_64-unknown-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 ------------- Regards, Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071112/27758c3c/attachment-0018.html From tjarvi at qbang.org Mon Nov 12 01:02:09 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Nov 2007 01:02:09 -0700 (MST) Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> Message-ID: On Mon, 12 Nov 2007, Timothy Low wrote: > > Hi Trent, Hi Tim, Comments are inline. As I mentioned off the list, rxtx 2.0 is on the edge of deprecation. We can get it working but this is not the path of least resistance for future work. You will probably need to bounce another round of questions off the list. The following is intended to isolate the problem. > > I tried building RXTX from source, and I got this error. > > > I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm trying > to get the necessary ".so" files to use for my serial port communication > through java. > My linux kernal information is: > > *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 x86_64 > x86_64 x86_64 GNU/Linux* > > I'll most glad if you can provide me some direction on this. Thanks ! > > ---------------- > [root at smsgateway rxtx-2.0-7pre1]# ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > checking for C compiler default output... a.out > checking whether the C compiler works... yes > checking whether we are cross compiling... no > checking for suffix of executables... > checking for suffix of object files... o > checking whether we are using the GNU C compiler... yes > checking whether gcc accepts -g... yes > checking for gcc option to accept ANSI C... none needed > checking for ld used by GCC... /usr/bin/ld > checking if the linker (/usr/bin/ld) is GNU ld... yes > checking for /usr/bin/ld option to reload object files... -r > checking for BSD-compatible nm... /usr/bin/nm -B > checking for a sed that does not truncate output... /bin/sed > checking whether ln -s works... yes > checking how to recognise dependent libraries... pass_all > checking command to parse /usr/bin/nm -B output... ok > checking how to run the C preprocessor... gcc -E > checking for egrep... grep -E > checking for ANSI C header files... yes > checking for sys/types.h... yes > checking for sys/stat.h... yes > checking for stdlib.h... yes > checking for string.h... yes > checking for memory.h... yes > checking for strings.h... yes > checking for inttypes.h... yes > checking for stdint.h... yes > checking for unistd.h... yes > checking dlfcn.h usability... yes > checking dlfcn.h presence... yes > checking for dlfcn.h... yes > checking for ranlib... ranlib > checking for strip... strip > checking for objdir... .libs > checking for gcc option to produce PIC... -fPIC > checking if gcc PIC flag -fPIC works... yes > checking if gcc static flag -static works... yes > checking if gcc supports -c -o file.o... yes > checking if gcc supports -c -o file.lo... yes > checking if gcc supports -fno-rtti -fno-exceptions... yes > checking whether the linker (/usr/bin/ld) supports shared libraries... yes > checking how to hardcode library paths into programs... immediate > checking whether stripping libraries is possible... yes > checking dynamic linker characteristics... GNU/Linux ld.so > checking if libtool supports shared libraries... yes > checking whether to build shared libraries... yes > checking whether to build static libraries... no > checking whether -lc should be explicitly linked in... no > creating libtool > checking for a BSD-compatible install... /usr/bin/install -c > checking whether build environment is sane... yes > checking for gawk... gawk > checking whether make sets $(MAKE)... yes > checking for style of include used by make... GNU > checking dependency style of gcc... none > checking fcntl.h usability... yes > checking fcntl.h presence... yes > checking for fcntl.h... yes > checking sys/fcntl.h usability... yes > checking sys/fcntl.h presence... yes > checking for sys/fcntl.h... yes > checking sys/file.h usability... yes > checking sys/file.h presence... yes > checking for sys/file.h... yes > checking sys/time.h usability... yes > checking sys/time.h presence... yes > checking for sys/time.h... yes > checking sys/signal.h usability... yes > checking sys/signal.h presence... yes > checking for sys/signal.h... yes > checking signal.h usability... yes > checking signal.h presence... yes > checking for signal.h.. . yes > checking termios.h usability... yes > checking termios.h presence... yes > checking for termios.h... yes > checking asm/termbits.h usability... yes > checking asm/termbits.h presence... yes > checking for asm/termbits.h... yes > checking grp.h usability... yes > checking grp.h presence... yes > checking for grp.h... yes > checking pwd.h usability... yes > checking pwd.h presence... yes > checking for pwd.h... yes > checking whether gcc needs -traditional... no > checking whether to enable maintainer-specific portions of Makefiles... no > /usr/java/jdk1.5.0_13 > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /usr/java/jdk1.5.0_13 > checking os.name Linux > checking os.arch i386 > checking java.vendor Sun Microsystems Inc. > checking java.version 1.5.0_13 > checking os.version 2.6.18-8.el5xen > comm.jar appears to be installed already. > conftest.c: In function 'main': > conftest.c:6: warning: incompatible implicit declaration of built-in > function 'printf' > conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:6: error: (Each undeclared identifier is reported only once > conftest.c:6: error: for each function it appears in.) > conftest.c:6: error: expected ')' before string constant This is an outdated kernel version check for when headers and kernels could cause problems for rxtx. If we made it past this, then you are OK. > conftest.c:7: warning: incompatible implicit declaration of built-in > function 'exit' > ./configure: line 9649: ./conftest: No such file or directory > ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected It blew up but continues.. > conftest.c: In function 'main': > conftest.c:5: warning: incompatible implicit declaration of built-in > function 'printf' > conftest.c:10: warning: incompatible implicit declaration of built-in > function 'exit' > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status : config.h is unchanged > config.status: executing depfiles commands > [root at smsgateway rxtx-2.0-7pre1]# make install > /usr/java/jdk1.5.0_13/bin/javac -classpath > .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d > /home/jboss/sources/rxtx- 2.0-7pre1/ -O > /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java > /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/UnSupportedLoggerException.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java > Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or > overrides a deprecated API. > Note: Recompile with -Xlint:deprecation for details. > /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* The java jar should be fine now. You may need to change the source files as mentioned below. > gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. > -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g > -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o > /home/jboss/sources/rxtx-2.0-7pre1/x86_64-unknown-linux-gnu/SerialImp.lo > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'init_threads': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: cast > from pointer to integer of different size > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_nativeDrain': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: cast to > pointer from integer of different size > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'read_byte_array': > /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: cast to > pointer from integer of different size As I recall, this was caused by pointers (now 64 bit rather than 32 bit) being stored in java ints (jints). I would look at the diff between the CVS 2.1 SerialImp.c and RXTXPort.java files against 2.0. We did fix those issues. You have a .so file but the different pointer sizes will cause runtime errors. > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_readArray': > /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: > comparison is always false due to limited range of data type > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_readTerminatedArray': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: > comparison is always false due to limited range of data type > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial- > 2.0.7pre1.* > gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so -o > .libs/librxtxSerial-2.0.7pre1.so > (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.0.7pre1.so > librxtxSerial.so) > creating librxtxSerial.la > (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la > librxtxSerial.la) > gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. > -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g > -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o > /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/ParallelImp.lo > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function > 'Java_javax_comm_LPRPort_readArray': > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: > comparison is always false due to limited range of data type > rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* > .libs/librxtxParallel-2.0.7pre1.* > gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so -o > .libs/librxtxParallel- 2.0.7pre1.so > (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.0.7pre1.so > librxtxParallel.so) > creating librxtxParallel.la > (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la > librxtxParallel.la) > make all-am > make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' > make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' > libtool: install: `x86_64-unknown-linux-gnu' must be an absolute directory > name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 A libtool change? Assuming you ran configure && make install in /home/jboss/sources/rxtx- 2.0-7pre1, libtool is looking for /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/.libs/librxtxSerial-2.0.7pre1.so. I think you have this? The file is just being copied to ~JAVA/jre/lib/$(JAVA_ARCH). -- Trent Jarvi tjarvi at qbang.org From sarah_662005 at yahoo.com Mon Nov 12 16:10:28 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Mon, 12 Nov 2007 15:10:28 -0800 (PST) Subject: [Rxtx] [urgent] device's power off detection Message-ID: <766782.10076.qm@web55803.mail.re3.yahoo.com> Hello all, I have a small application built on top of rxtx api. This application can retrieve the incoming data from a device through a port. The device can be powered off after the port get closed from the application. I have been trying a couple of hours to find a way to detect the power switching from device. If anyone knows how to handle it through rxtx, could you please give me a help? Thank you very much. r, Sara ____________________________________________________________________________________ Get easy, one-click access to your favorites. Make Yahoo! your homepage. http://www.yahoo.com/r/hs -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071112/4599f3ec/attachment-0017.html From netbeans at gatworks.com Mon Nov 12 17:52:22 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 12 Nov 2007 19:52:22 -0500 Subject: [Rxtx] [urgent] device's power off detection In-Reply-To: <766782.10076.qm@web55803.mail.re3.yahoo.com> References: <766782.10076.qm@web55803.mail.re3.yahoo.com> Message-ID: <4738F546.5010101@gatworks.com> Not sure what u are asking for. Are u asking for a way to detect if the device is OFF? Are u asking how to power off the device - via software ? Is it a Serial device? is it a parallel device? is it a usb device? Sara Hugh wrote: > Hello all, > I have a small application built on top of rxtx api. This application > can retrieve the incoming data from a device through a port. The device > can be powered off after the port get closed from the application. I > have been trying a couple of hours to find a way to detect the power > switching from device. If anyone knows how to handle it through rxtx, > could you please give me a help? Thank you very much. From tjarvi at qbang.org Mon Nov 12 22:48:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Nov 2007 22:48:11 -0700 (MST) Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711120225x562db8cbxb750767ade3b0d73@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> <900c6ba90711120031p66edc001ted76f7ba24e34b98@mail.gmail.com> <900c6ba90711120225x562db8cbxb750767ade3b0d73@mail.gmail.com> Message-ID: Hi Tim, The gnu.io namespace looks just like the javax.comm 2.0 namespace. There are additional (discouraged) undocumented methods in gnu.io that you need not use. We just used the different namespace to avoid poluting Sun's by mistake and to make sure we stayed off any potential licensing related radar. Usuaully, you just change your imports and make sure you do not use the javax.comm namespace for anything like exception handling. As I mentioned off the list, there are no issues with rxtx going through the JSR process to be more Sun friendly other than time. rxtx has no hidden intentions there; anything that does not work like CommAPI 2.0 documented is a bug. The reason we do not support CommAPI 2.1 is technical in nature and is in the list archives as well as the front page of www.rxtx.org. On Mon, 12 Nov 2007, Timothy Low wrote: > Hi Trent, > > I'll move to use a JDK1.5 64-bit version... but do I need to make any source > code changes to use the package (gnu.io) in the RTXTcomm.jar instead of the > ones from the javacomm api ? > > > Regards, > Tim > > On Nov 12, 2007 5:22 PM, Trent Jarvi wrote: > >> >> Hi Tim, >> >> I see a couple things here. >> >> First your jdk is for i686 yet the library is compiled on a x86_64 >> machine. You may try passing configure the --target=i686-unknown-linux to >> try using the i686 backend to gcc if it is available. Or move to the 64 >> bit jdk. >> >> The other error I see is again the moved UTF_RELEASE define that we need >> to fix. You can probably get around that with: >> >> make -DUTF_RELEASE=`uname -r` >> >> even more simple would be to just specify the serial library which should >> be in configure --help. >> >> You can remove the UTF_RELEASE check from configure by editing >> configure.in, searching for the simple C program check and deleting it. >> Running autoconf after that will regenerate a new configure without the >> check. >> >> Note that you should remove the previous native libraries >> (librxtxSerial.so) when moving from rxtx 2.0 to 2.1. These are compiled >> for different namespaces (javax.comm/gnu.io). >> >> On Mon, 12 Nov 2007, Timothy Low wrote: >> >>> *Hi Trent, >>> >>> I moved on to rxtx 2.1.7r2, and updated my jre to 1.6.0 (64-bit)... I >> tried >>> the following 2 methods: >>> >>> (1) using the rxtx 2.1.7 binaries from the RXTX website* >>> *Are these binaries suitable for a 64-bit OS ? There mentioning of the >>> gnu.io that you've talked about previously...* >>> ------ >>> [root at smsgateway sources]# java -Djava.library.path=/usr/lib PortLister >>> Experimental: JNI_OnLoad called. >>> >>> java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion >>> ()Ljava/lang/String; >>> at gnu.io.RXTXCommDriver.nativeGetVersion(Native Method) >>> at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:85) >>> at java.lang.Class.forName0(Native Method) >>> at java.lang.Class.forName(Unknown Source) >>> at javax.comm.CommPortIdentifier.loadDriver( >> CommPortIdentifier.java >>> :237) >>> at javax.comm.CommPortIdentifier.(CommPortIdentifier.java >>> :109) >>> at PortLister.(PortLister.java:6) >>> at PortLister.main(PortLister.java:25) >>> Exception in thread "main" java.lang.UnsatisfiedLinkError: >>> com.sun.comm.SunrayInfo.isSessionActive()Z >>> at com.sun.comm.SunrayInfo.isSessionActive(Native Method) >>> at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java >> :155) >>> at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java >>> :100) >>> at javax.comm.CommPortIdentifier.(CommPortIdentifier.java >>> :138) >>> at PortLister.(PortLister.java:6) >>> at PortLister.main(PortLister.java:25) >>> >>> ------ >>> >>> (2) compiling the rxtx 2.1.7 from source >>> *but i got the following error while running ./configure and make all* >>> >>> ------ >>> [root at smsgateway rxtx-2.1-7r2]# ./configure >>> checking build system type... x86_64-unknown-linux-gnu >>> checking host system type... x86_64-unknown-linux-gnu >>> checking target system type... x86_64-unknown-linux-gnu >>> configure: WARNING: Trying libtool. If the following fails install >> libtool >>> checking for gcc... gcc >>> checking for C compiler default output file name... a.out >>> checking whether the C compiler works... yes >>> checking whether we are cross compiling... no >>> checking for suffix of executables... >>> checking for suffix of object files... o >>> checking whether we are using the GNU C compiler... yes >>> checking whether gcc accepts -g... yes >>> checking for gcc option to accept ANSI C... none needed >>> checking for a sed that does not truncate output... /bin/sed >>> checking for egrep... grep -E >>> checking for ld used by gcc... /usr/bin/ld >>> checking if the linker (/usr/bin/ld) is GNU ld... yes >>> checking for /usr/bin/ld option to reload object files... -r >>> checking for BSD-compatible nm... /usr/bin/nm -B >>> checking whether ln -s works... yes >>> checking how to recognise dependent libraries... pass_all >>> checking how to run the C preprocessor... gcc -E >>> checking for ANSI C header files... yes >>> checking for sys/types.h... yes >>> checking for sys/stat.h... yes >>> checking for stdlib.h... yes >>> checking for string.h... yes >>> checking for memory.h... yes >>> checking for strings.h... yes >>> checking for inttypes.h... yes >>> checking for stdint.h... yes >>> checking for unistd.h... yes >>> checking dlfcn.h usability... yes >>> checking dlfcn.h presence... yes >>> checking for dlfcn.h... yes >>> checking for g++... g++ >>> checking whether we are using the GNU C++ compiler... yes >>> checking whether g++ accepts -g... yes >>> checking how to run the C++ preprocessor... g++ -E >>> checking for g77... no >>> checking for f77... no >>> checking for xlf... no >>> checking for frt... no >>> checking for pgf77... no >>> checking for fort77... no >>> checking for fl32... no >>> checking for af77... no >>> checking for f90... no >>> checking for xlf90... no >>> checking for pgf90... no >>> checking for epcf90... no >>> checking for f95... f95 >>> checking whether we are using the GNU Fortran 77 compiler... yes >>> checking whether f95 accepts -g... yes >>> checking the maximum length of command line arguments... 32768 >>> checking command to parse /usr/bin/nm -B output from gcc object... ok >>> checking for objdir... .libs >>> checking for ar... ar >>> checking for ranlib... ranlib >>> checking for strip... strip >>> checking if gcc static flag works... yes >>> checking if gcc supports -fno-rtti -fno-exceptions... no >>> checking for gcc option to produce PIC... -fPIC >>> checking if gcc PIC flag -fPIC works... yes >>> checking if gcc supports -c -o file.o... yes >>> checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking whether -lc should be explicitly linked in... no >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> checking if libtool supports shared libraries... yes >>> checking whether to build shared libraries... yes >>> checking whether to build static libraries... no >>> configure: creating libtool >>> appending configuration tag "CXX" to libtool >>> checking for ld used by g++... /usr/bin/ld -m elf_x86_64 >>> checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes >>> checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking for g++ option to produce PIC... -fPIC >>> checking if g++ PIC flag -fPIC works... yes >>> checking if g++ supports -c -o file.o... yes >>> checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> appending configuration tag "F77" to libtool >>> checking if libtool supports shared libraries... yes >>> checking whether to build shared libraries... yes >>> checking whether to build static libraries... no >>> checking for f95 option to produce PIC... -fPIC >>> checking if f95 PIC flag -fPIC works... yes >>> checking if f95 supports -c -o file.o... yes >>> checking whether the f95 linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> checking for a BSD-compatible install... /usr/bin/install -c >>> checking whether build environment is sane... yes >>> checking for gawk... gawk >>> checking whether make sets $(MAKE)... yes >>> checking for style of include used by make... GNU >>> checking dependency style of gcc... none >>> checking dependency style of g++... none >>> checking fcntl.h usability... yes >>> checking fcntl.h presence... yes >>> checking for fcntl.h... yes >>> checking sys/fcntl.h usability... yes >>> checking sys/fcntl.h presence... yes >>> checking for sys/fcntl.h... yes >>> checking sys/file.h usability... yes >>> checking sys/file.h presence... yes >>> checking for sys/file.h... yes >>> checking sys/time.h usability... yes >>> checking sys/time.h presence... yes >>> checking for sys/time.h... yes >>> checking sys/signal.h usability... yes >>> checking sys/signal.h presence... yes >>> checking for sys/signal.h... yes >>> checking signal.h usability... yes >>> checking signal.h presence... yes >>> checking for signal.h... yes >>> checking termios.h usability... yes >>> checking termios.h presence... yes >>> checking for termios.h... yes >>> checking grp.h usability... yes >>> checking grp.h presence... yes >>> checking for grp.h... yes >>> checking pwd.h usability... yes >>> checking pwd.h presence... yes >>> checking for pwd.h... yes >>> checking whether gcc needs -traditional... no >>> checking whether to enable maintainer-specific portions of Makefiles... >> no >>> /usr/java/jdk1.5.0_13 >>> configure: WARNING: using JAVA_HOME environmental variable >>> adjusted java.home is /usr/java/jdk1.5.0_13 >>> checking os.name Linux >>> checking os.arch i386 >>> checking java.vendor Sun Microsystems Inc. >>> checking java.version 1.5.0_13 >>> checking os.version 2.6.18-8.el5xen >>> conftest.c: In function 'main': >>> conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this >> function) >>> conftest.c:8: error: (Each undeclared identifier is reported only once >>> conftest.c:8: error: for each function it appears in.) >>> conftest.c:8: error: expected ')' before string constant >>> ./configure: line 21462: ./conftest: No such file or directory >>> ./configure: line 21462: test: 2.6.18-8.el5xen: unary operator expected >>> configure: creating ./config.status >>> config.status: creating Makefile >>> config.status: creating config.h >>> config.status: executing depfiles commands >>> [root at smsgateway rxtx-2.1-7r2]# make install >>> /usr/java/jdk1.5.0_13/bin/javac -classpath .:/home/jboss/sources/rxtx- >>> >> 2.1-7r2:/home/jboss/sources/rxtx-2.1-7r2/src:/usr/java/jdk1.5.0_13/jre/lib/ext/RXTXcomm.jar-d >>> /home/jboss/sources/rxtx- >>> 2.1-7r2/ -O -source 1.3 -target 1.3 >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommDriver.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortEnumerator.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortIdentifier.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortOwnershipListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Configure.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2C.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/I2CPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/LPRPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/NoSuchPortException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/PortInUseException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Raw.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/RawPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RawPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RawPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/RS485PortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485PortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485Port.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXCommDriver.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXVersion.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPort.java >>> /home/jboss/sources/rxtx-2.1-7r2 >> /./src/UnsupportedCommOperationException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/UnSupportedLoggerException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Zystem.java >>> /usr/java/jdk1.5.0_13/bin/javah -classpath .:/home/jboss/sources/rxtx- >>> >> 2.1-7r2:/home/jboss/sources/rxtx-2.1-7r2/src:/usr/java/jdk1.5.0_13/jre/lib/ext/RXTXcomm.jar-d >>> x86_64-unknown-linux-gnu -jni `(for i in CommDriver CommPortEnumerator >>> CommPortIdentifier CommPort CommPortOwnershipListener Configure I2C >>> I2CPortEvent I2CPortEventListener I2CPort LPRPort NoSuchPortException >>> ParallelPortEvent ParallelPortEventListener ParallelPort >> PortInUseException >>> Raw RawPortEvent RawPortEventListener RawPort RS485 RS485PortEvent >>> RS485PortEventListener RS485Port RXTXCommDriver RXTXPort RXTXVersion >>> SerialPortEvent SerialPortEventListener SerialPort >>> UnsupportedCommOperationException UnSupportedLoggerException Zystem;do \ >>> if grep > /dev/null native.*\( /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/$i.java; then \ >>> echo gnu.io.$i; \ >>> fi; \ >>> done)` >>> /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialImp.c -o >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo; >>> \ >>> if [ "Serial" = "Serial" ]; >>> then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxSerial.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxSerial.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo; >> \ >>> fi; \ >>> ) >>> mkdir /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/.libs >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/SerialImp.o >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/fuserImp.o >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c: In function >> 'show_user': >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c:238: warning: cast >> from >>> pointer to integer of different size >>> gcc -shared /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/SerialImp.o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/fuserImp.o >>> -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7.so -o >> .libs/librxtxSerial- >>> 2.1-7.so >>> (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.1-7.so >>> librxtxSerial.so) >>> creating librxtxSerial.la >>> (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la >>> librxtxSerial.la) >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelImp.c -o >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/ParallelImp.lo; >>> \ >>> if [ "Parallel" = "Serial" ]; >>> then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxParallel.la -rpath >>> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/ParallelImp.lo >>> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxParallel.la -rpath >>> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/ParallelImp.lo; >>> \ >>> fi; \ >>> ) >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >>> /x86_64-unknown-linux-gnu/.libs/ParallelImp.o >>> gcc -shared /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/ParallelImp.o >>> -lpthread -Wl,-soname -Wl,librxtxParallel-2.1-7.so -o >>> .libs/librxtxParallel-2.1-7.so >>> (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.1-7.so >>> librxtxParallel.so) >>> creating librxtxParallel.la >>> (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la >>> librxtxParallel.la) >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo; >>> \ >>> if [ "I2C" = "Serial" ]; then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxI2C.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo >>> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxI2C.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo; >>> \ >>> fi; \ >>> ) >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/.libs/I2CImp.o >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c: In function >>> 'Java_gnu_io_I2CPort_Initialize': >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: 'UTS_RELEASE' >>> undeclared (first use in this function) >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: (Each >> undeclared >>> identifier is reported only once >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: for each >> function >>> it appears in.) >>> libtool: link: `/home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/I2CImp.lo' >>> is not a valid libtool object >>> make: *** [x86_64-unknown-linux-gnu/librxtxI2C.la] Error 1 >>> >>> ------ >>> >>> >>> >>> On Nov 12, 2007 4:02 PM, Trent Jarvi wrote: >>> >>>> On Mon, 12 Nov 2007, Timothy Low wrote: >>>>> >>>>> Hi Trent, >>>> >>>> Hi Tim, >>>> >>>> Comments are inline. As I mentioned off the list, rxtx 2.0 is on the >> edge >>>> of deprecation. We can get it working but this is not the path of >> least >>>> resistance for future work. >>>> >>>> You will probably need to bounce another round of questions off the >> list. >>>> The following is intended to isolate the problem. >>>> >>>>> >>>>> I tried building RXTX from source, and I got this error. >>>>> >>>>> >>>>> I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm >>>> trying >>>>> to get the necessary ".so" files to use for my serial port >> communication >>>>> through java. >>>>> My linux kernal information is: >>>>> >>>>> *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 >>>> x86_64 >>>>> x86_64 x86_64 GNU/Linux* >>>>> >>>>> I'll most glad if you can provide me some direction on this. Thanks ! >>>>> >>>>> ---------------- >>>>> [root at smsgateway rxtx-2.0-7pre1]# ./configure >>>>> checking build system type... x86_64-unknown-linux-gnu >>>>> checking host system type... x86_64-unknown-linux-gnu >>>>> checking target system type... x86_64-unknown-linux-gnu >>>>> configure: WARNING: Trying libtool. If the following fails install >>>> libtool >>>>> checking for gcc... gcc >>>>> checking for C compiler default output... a.out >>>>> checking whether the C compiler works... yes >>>>> checking whether we are cross compiling... no >>>>> checking for suffix of executables... >>>>> checking for suffix of object files... o >>>>> checking whether we are using the GNU C compiler... yes >>>>> checking whether gcc accepts -g... yes >>>>> checking for gcc option to accept ANSI C... none needed >>>>> checking for ld used by GCC... /usr/bin/ld >>>>> checking if the linker (/usr/bin/ld) is GNU ld... yes >>>>> checking for /usr/bin/ld option to reload object files... -r >>>>> checking for BSD-compatible nm... /usr/bin/nm -B >>>>> checking for a sed that does not truncate output... /bin/sed >>>>> checking whether ln -s works... yes >>>>> checking how to recognise dependent libraries... pass_all >>>>> checking command to parse /usr/bin/nm -B output... ok >>>>> checking how to run the C preprocessor... gcc -E >>>>> checking for egrep... grep -E >>>>> checking for ANSI C header files... yes >>>>> checking for sys/types.h... yes >>>>> checking for sys/stat.h... yes >>>>> checking for stdlib.h... yes >>>>> checking for string.h... yes >>>>> checking for memory.h... yes >>>>> checking for strings.h... yes >>>>> checking for inttypes.h... yes >>>>> checking for stdint.h... yes >>>>> checking for unistd.h... yes >>>>> checking dlfcn.h usability... yes >>>>> checking dlfcn.h presence... yes >>>>> checking for dlfcn.h... yes >>>>> checking for ranlib... ranlib >>>>> checking for strip... strip >>>>> checking for objdir... .libs >>>>> checking for gcc option to produce PIC... -fPIC >>>>> checking if gcc PIC flag -fPIC works... yes >>>>> checking if gcc static flag -static works... yes >>>>> checking if gcc supports -c -o file.o... yes >>>>> checking if gcc supports -c -o file.lo... yes >>>>> checking if gcc supports -fno-rtti -fno-exceptions... yes >>>>> checking whether the linker (/usr/bin/ld) supports shared libraries... >>>> yes >>>>> checking how to hardcode library paths into programs... immediate >>>>> checking whether stripping libraries is possible... yes >>>>> checking dynamic linker characteristics... GNU/Linux ld.so >>>>> checking if libtool supports shared libraries... yes >>>>> checking whether to build shared libraries... yes >>>>> checking whether to build static libraries... no >>>>> checking whether -lc should be explicitly linked in... no >>>>> creating libtool >>>>> checking for a BSD-compatible install... /usr/bin/install -c >>>>> checking whether build environment is sane... yes >>>>> checking for gawk... gawk >>>>> checking whether make sets $(MAKE)... yes >>>>> checking for style of include used by make... GNU >>>>> checking dependency style of gcc... none >>>>> checking fcntl.h usability... yes >>>>> checking fcntl.h presence... yes >>>>> checking for fcntl.h... yes >>>>> checking sys/fcntl.h usability... yes >>>>> checking sys/fcntl.h presence... yes >>>>> checking for sys/fcntl.h... yes >>>>> checking sys/file.h usability... yes >>>>> checking sys/file.h presence... yes >>>>> checking for sys/file.h... yes >>>>> checking sys/time.h usability... yes >>>>> checking sys/time.h presence... yes >>>>> checking for sys/time.h... yes >>>>> checking sys/signal.h usability... yes >>>>> checking sys/signal.h presence... yes >>>>> checking for sys/signal.h... yes >>>>> checking signal.h usability... yes >>>>> checking signal.h presence... yes >>>>> checking for signal.h.. . yes >>>>> checking termios.h usability... yes >>>>> checking termios.h presence... yes >>>>> checking for termios.h... yes >>>>> checking asm/termbits.h usability... yes >>>>> checking asm/termbits.h presence... yes >>>>> checking for asm/termbits.h... yes >>>>> checking grp.h usability... yes >>>>> checking grp.h presence... yes >>>>> checking for grp.h... yes >>>>> checking pwd.h usability... yes >>>>> checking pwd.h presence... yes >>>>> checking for pwd.h... yes >>>>> checking whether gcc needs -traditional... no >>>>> checking whether to enable maintainer-specific portions of >> Makefiles... >>>> no >>>>> /usr/java/jdk1.5.0_13 >>>>> configure: WARNING: using JAVA_HOME environmental variable >>>>> adjusted java.home is /usr/java/jdk1.5.0_13 >>>>> checking os.name Linux >>>>> checking os.arch i386 >>>>> checking java.vendor Sun Microsystems Inc. >>>>> checking java.version 1.5.0_13 >>>>> checking os.version 2.6.18-8.el5xen >>>>> comm.jar appears to be installed already. >>>>> conftest.c: In function 'main': >>>>> conftest.c:6: warning: incompatible implicit declaration of built-in >>>>> function 'printf' >>>>> conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this >>>> function) >>>>> conftest.c:6: error: (Each undeclared identifier is reported only once >>>>> conftest.c:6: error: for each function it appears in.) >>>>> conftest.c:6: error: expected ')' before string constant >>>> >>>> >>>> This is an outdated kernel version check for when headers and kernels >>>> could cause problems for rxtx. If we made it past this, then you are >> OK. >>>> >>>> >>>>> conftest.c:7: warning: incompatible implicit declaration of built-in >>>>> function 'exit' >>>>> ./configure: line 9649: ./conftest: No such file or directory >>>>> ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected >>>> >>>> It blew up but continues.. >>>> >>>>> conftest.c: In function 'main': >>>>> conftest.c:5: warning: incompatible implicit declaration of built-in >>>>> function 'printf' >>>>> conftest.c:10: warning: incompatible implicit declaration of built-in >>>>> function 'exit' >>>>> configure: creating ./config.status >>>>> config.status: creating Makefile >>>>> config.status: creating config.h >>>>> config.status : config.h is unchanged >>>>> config.status: executing depfiles commands >>>>> [root at smsgateway rxtx-2.0-7pre1]# make install >>>>> /usr/java/jdk1.5.0_13/bin/javac -classpath >>>>> .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/ -O >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1 >> /./src/UnSupportedLoggerException.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java >>>>> Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or >>>>> overrides a deprecated API. >>>>> Note: Recompile with -Xlint:deprecation for details. >>>>> /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* >>>> >>>> >>>> The java jar should be fine now. You may need to change the source >> files >>>> as mentioned below. >>>> >>>>> gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu >> -I. >>>>> -I/usr/java/jdk1.5.0_13/include >> -I/usr/java/jdk1.5.0_13/include/./linux/ >>>> -g >>>>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o >>>>> /home/jboss/sources/rxtx-2.0-7pre1 >> /x86_64-unknown-linux-gnu/SerialImp.lo >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'init_threads': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: >>>> cast >>>>> from pointer to integer of different size >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_nativeDrain': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: >>>> cast to >>>>> pointer from integer of different size >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'read_byte_array': >>>>> /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: >>>> cast to >>>>> pointer from integer of different size >>>> >>>> >>>> As I recall, this was caused by pointers (now 64 bit rather than 32 >> bit) >>>> being stored in java ints (jints). I would look at the diff between >> the >>>> CVS 2.1 SerialImp.c and RXTXPort.java files against 2.0. We >>>> did fix those issues. >>>> >>>> You have a .so file but the different pointer sizes will cause runtime >>>> errors. >>>> >>>> >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_readArray': >>>>> /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: >>>>> comparison is always false due to limited range of data type >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_readTerminatedArray': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: >>>>> comparison is always false due to limited range of data type >>>>> mkdir .libs >>>>> rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* >> .libs/librxtxSerial- >>>>> 2.0.7pre1.* >>>>> gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so-o >>>>> .libs/librxtxSerial-2.0.7pre1.so >>>>> (cd .libs && rm -f librxtxSerial.so && ln -s >> librxtxSerial-2.0.7pre1.so >>>>> librxtxSerial.so) >>>>> creating librxtxSerial.la >>>>> (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la >>>>> librxtxSerial.la) >>>>> gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu >> -I. >>>>> -I/usr/java/jdk1.5.0_13/include >> -I/usr/java/jdk1.5.0_13/include/./linux/ >>>> -g >>>>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o >>>>> /home/jboss/sources/rxtx- 2.0-7pre1 >>>> /x86_64-unknown-linux-gnu/ParallelImp.lo >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function >>>>> 'Java_javax_comm_LPRPort_readArray': >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: >>>>> comparison is always false due to limited range of data type >>>>> rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* >>>>> .libs/librxtxParallel-2.0.7pre1.* >>>>> gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so-o >>>>> .libs/librxtxParallel- 2.0.7pre1.so >>>>> (cd .libs && rm -f librxtxParallel.so && ln -s >>>> librxtxParallel-2.0.7pre1.so >>>>> librxtxParallel.so) >>>>> creating librxtxParallel.la >>>>> (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la >>>>> librxtxParallel.la) >>>>> make all-am >>>>> make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' >>>>> make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' >>>>> libtool: install: `x86_64-unknown-linux-gnu' must be an absolute >>>> directory >>>>> name >>>>> Try `libtool --help --mode=install' for more information. >>>>> make: *** [install] Error 1 >>>> >>>> A libtool change? Assuming you ran configure && make install in >>>> /home/jboss/sources/rxtx- 2.0-7pre1, libtool is looking for >>>> /home/jboss/sources/rxtx- >>>> 2.0-7pre1/x86_64-unknown-linux-gnu/.libs/librxtxSerial-2.0.7pre1.so. >>>> >>>> I think you have this? The file is just being copied to >>>> ~JAVA/jre/lib/$(JAVA_ARCH). >>>> >>>> -- >>>> Trent Jarvi >>>> tjarvi at qbang.org >>>> >>> >> > From guido.vogt at celsi.ch Tue Nov 13 00:28:01 2007 From: guido.vogt at celsi.ch (Guido Vogt) Date: Tue, 13 Nov 2007 08:28:01 +0100 Subject: [Rxtx] RTS Line can't be set Message-ID: <47395201.1050400@celsi.ch> I'm working on an Windows XP /SP2 System. Version of RXTX: 2.1.7. The serial line is connected to a modem. As I can see, the RTS-Line of the serial Port is inactive, when the port is opened (flowcontrol=none). Obviously, no data is coming from the modem. If I use the setRTS(true) command after open, the comport does not send out my data any more. This behaviour is regardless of flowcontrol. Anybody has an idea what do do? Thanks for help. From Martin.Oberhuber at windriver.com Tue Nov 13 08:58:23 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 13 Nov 2007 16:58:23 +0100 Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803880918@ism-mail03.corp.ad.wrs.com> Hi Trent, as said before, I like the idea of discussing such quality engineering issues, but why hide these away from the rest of the public? Anyways, if you do want to create a new mailing list for these kinds of things I'll happily subscribe. 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: Sunday, November 11, 2007 1:46 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: RE: [Rxtx] Quality Engineering with rxtx > > On Mon, 5 Nov 2007, Oberhuber, Martin wrote: > > > Hi Trent, > > > > are the interestes of hobbyists really so different > > from commercial ones? Both should be interested in > > high quality and innovation the like. > > > > I haven't seen too many Open Source projects from the > > "inside" but those that I have seen did not have > > separate mailing lists for quality/testing/qa > > versus innovation/development. > > > > What I have seen with the Open Source projects that > > one would call "successful" is a good deal of > > process around automated builds, automated unit > > tests, predictable release dates and milestones, > > and policies around commiting/contributing/reviewing > > changes. > > > > I think that all of these benefit commercial users > > and hobbyists the like. > > > > If you were just asking about who's interested in > > discussing changes to foster more quality, count > > me in. I'm just not sure whether discussing these > > on a separate mailing list or other channel is the > > right thing to do. > > > > Hi Martin, > > There are two issues I'm thinking about. The first is the > generic unit > testing and quality initiatives required to move rxtx > forward. The second > is the inevitable fact that rxtx connects to external hardware. The > discussion deals with a different set of problems. > > Here is a simple example of what I'm getting at. > > We have the capability of setting custom baud rates in rxtx. > We may be > interested in seeing regressions in rxtx, the C library or > the kernel. > Some people may be doing some tests with loopback > connections. These will > always work even if the baud rate is not set to the expected > value. Some > people may use null modems between two ports. This may be > able to catch > the problem but not always. > > Will the build machines be able to test this? (no - for a few reasons) > Will people be trying to catch these type of regressions? (yes) > What type of coverage does the community have in the end? (?) > > We could include the discussions in the same list or another > equally open > list that may be of interest to some folks that deal with > these types of > problems on a regular basis. > > -- > Trent Jarvi > tjarvi at qbang.org > From toupsz at cs.tamu.edu Tue Nov 13 10:33:03 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 13 Nov 2007 11:33:03 -0600 Subject: [Rxtx] [urgent] device's power off detection In-Reply-To: <4738F546.5010101@gatworks.com> References: <766782.10076.qm@web55803.mail.re3.yahoo.com> <4738F546.5010101@gatworks.com> Message-ID: Lacking any other specification on it...but can you set up the device to notify your software when it turns off? Send a message or somesuch? Maybe it can signal using RTS or DTR? -Zach On Nov 12, 2007 6:52 PM, U. George wrote: > Not sure what u are asking for. Are u asking for a way to detect if the > device is OFF? Are u asking how to power off the device - via software ? > Is it a Serial device? > is it a parallel device? > is it a usb device? > > Sara Hugh wrote: > > Hello all, > > I have a small application built on top of rxtx api. This application > > can retrieve the incoming data from a device through a port. The device > > can be powered off after the port get closed from the application. I > > have been trying a couple of hours to find a way to detect the power > > switching from device. If anyone knows how to handle it through rxtx, > > could you please give me a help? Thank you very much. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071113/e5859e4d/attachment-0016.html From tjarvi at qbang.org Tue Nov 13 20:02:03 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 13 Nov 2007 20:02:03 -0700 (MST) Subject: [Rxtx] #ifndef TIOCSERGETLSR In-Reply-To: <472E3AAF.7050709@gatworks.com> References: <472E3AAF.7050709@gatworks.com> Message-ID: On Sun, 4 Nov 2007, U. George wrote: > For Linux, it seems that you need the code for both *having* a > TIOCSERGETLSR, and *not having* a TIOCSERGETLSR. Maybe the ioctl exists > system wide, but not necessarily for the device driver itself ( always > returns -1 ) . > > Are there systems that have a *functioning* TIOCSERGETLSR for all their > devices? Then this would be the case where the "#ifndef TIOCSERGETLSR" > directive could be useful is eliminating the unnecessary code and tests. > > And for those systems that dont have a TIOCSERGETLSR, then the code for > TIOCSERGETLSR can be eliminated. > > It would be a simple case to have, as a foundation, all the code to > simulate the missing TIOCSERGETLSR ioctl. If the system does have the > ioctl, then that code can be ifdef'd in, and co-exist with the > functionality of the code that simulates the missing TIOCSERGETLSR ioctl. > Ah, there is the post. Sorry I was on vacation. Hi George, Yes there are systems that have functioning TIOCSERGETLSR for all of their devices. These are machines that just use traditional UARTs. If you mean operating systems, then probably not. Let me explain a bit about the history of those #ifdefs to help clear up a mess. RXTX aims to follow POSIX. TIOCSERGETLSR turns out to not be POSIX at all as I understand. It isn't in BSD, Solaris, AIX or HP-UX. It certainly provides access to important information. I assumed it was standard when I coded rxtx on a Linux system. Ya, laugh. Then I looked at Win32.. Oh you are still laughing? ..I could not navigate msft's web site at the time [still can't really find anything today]. So google pointed me to someones 'reverse documentation' of the w32 API and an example msft put together back in the win3.0 days. It was enough but maybe not 100% correct. They covered overlapped IO which was important for events in rxtx. Looking at Win32 and Linux, it made sense to implement TIOCSERGETLSR for win32 with the way rxtx works. That was how things matched up. But when I got feedback about other systems, it didn't match up. When people used multiport cards with money saving designs in Linux, it didn't match up. And today, there are drivers for unusual serial ports that don't match up. Now we have some ugly logic that mostly works for most serial ports. It isn't right though. The important aspect of TIOSERGETLSR is knowing when the output is really gone. But POSIX tcdrain tells us the same thing. So there is logic in the ifdefs to match that up as you suggest. Perhaps a more formal solution along those lines would be worth looking into. I would suggest the roles should be switched though. We should use POSIX calls on all systems and hide things that don't work on everything like we have with other undocumented calls. TIOSERGETLSR is nice and would be great if it was standard. It isn't as far as I can tell. In the end, many people write Java code because they want portability. The TIOSERGETLSR does not really fit. In someways, this is limiting to the least common denominator which is Solaris if you have seen it's serial kernel driver code. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 15 09:10:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 15 Nov 2007 17:10:59 +0100 Subject: [Rxtx] RXTX blocking on unconnected virtual port Message-ID: <460801A4097E3D4CA04CC64EE648584803919080@ism-mail03.corp.ad.wrs.com> Hello, we came across the following issue: * Set up a virtual serial port, e.g. with com0com: http://com0com.sourceforge.net/ * Connect RXTX to one end, e.g. cnc1a * Do not connect the other end, e.g. cnc1b * Have RXTX write data to the port --> Since the data is not being read, RXTX blocks - RXTXPort.SerialOutputStream.write increases the RXTXPort.IOLocked variable - it then calls the native writeByte or writeArray method (which blocks) closing the RXTXPort hangs for ever too: - RXTXPort.close() has a while( IOLocked > 0 ) {..Thread.sleep(500);...} which spins for ever ==> once the communication hangs, it cannot recover. Has anybody else seen such a problem before, or even got an idea how to solve it? When I connect Hyperterminal to the same half-open port, and type a character, it hangs for about 3 seconds but then times out and is available again. I guess that's what I'd like to see in RXTX as well, with a (configurable) timeout. Our big problem with the current situation is that once RXTX gets stuck, there is nothing at all we can do to make it go live again - that's why our original workaround of writing to the port in a background thread is not good enough. For more background information, the issue is being tracked in https://bugs.eclipse.org/bugs/show_bug.cgi?id=208185 Thanks for any hints or ideas, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Sun Nov 18 09:43:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 09:43:26 -0700 (MST) Subject: [Rxtx] PortInUseException - Cannot close and reopen serial port In-Reply-To: <460801A4097E3D4CA04CC64EE64858480351C711@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858480351C711@ism-mail03.corp.ad.wrs.com> Message-ID: These have been submitted to CVS and the bugzilla entries have been changed to reflect the changes. ChangeLog: find ports which were added after program startup on Mac OS X. Martin Oberhuber http://bugzilla.qbang.org/show_bug.cgi?id=48 Clean up CommPort Ownership code, avoid possible deadlocks, fix lost commport ownership events. http://bugzilla.qbang.org/show_bug.cgi?id=83 Martin Oberhuber On Wed, 24 Oct 2007, Oberhuber, Martin wrote: > 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) > > > > > > > > > > > > > > > From tjarvi at qbang.org Sun Nov 18 09:45:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 09:45:39 -0700 (MST) Subject: [Rxtx] PortInUseException - Cannot close and reopen serial port In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848020CAF26@ism-mail03.corp.ad.wrs.com> Message-ID: The current CVS code should have all the entries. With version information, I usually do not change the version until we tag and release a zip file. Any feedback would be appreciated. On Wed, 27 Jun 2007, Greg Johnson wrote: > 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) >> >> >> >> >> > From tjarvi at qbang.org Sun Nov 18 13:51:27 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 13:51:27 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs Message-ID: The following bugs have been closed and CVS updated as needed: CommPortIdentifier.getPortIdentifier throws NoSuchPortException http://bugzilla.qbang.org/show_bug.cgi?id=48 CommPortOwnership events not sent http://bugzilla.qbang.org/show_bug.cgi?id=83 JVM 1.6 builds http://bugzilla.qbang.org/show_bug.cgi?id=84 I'd like to give Martin Oberhuber CVS write access. He has been doing a great job of pushing safe patches into rxtx. I'll be preparing seperate patches for the changes I have and submitting them to the list. I'll need to work with George to do a couple things: 1) break the patch into smaller pieces to isolate issues for discussion. 2) work through the Line Status Register changes so it does not cause problems on other systems. George: If you could do the first one, it would be greatly appreciated. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Nov 18 15:33:36 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 15:33:36 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: Message-ID: I'm not running any tests at this point, I'm trying to apply the small safe patches and make sure everything is compiling. As mentioned at the bottom, there are 3 patches + the USB fix posted here that need more review before accepting. The following bugs have been closed and CVS updated as needed. Most of these are already in CVS. The diff will be small. configure script failed at line UTS_RELEASE megov http://bugzilla.qbang.org/show_bug.cgi?id=80 code cleanup patch (extra ';' creates bug for if statements + new String() calls removed) Xavier Le Vourch http://bugzilla.qbang.org/show_bug.cgi?id=77 Wont compile on linux ppc with glibc 2.5 - no sys/io.h Brian Johnson http://bugzilla.qbang.org/show_bug.cgi?id=72 rxtx overwrites System properties Andrew Gillett Nektarios K. Papadopoulos Neboj??a http://bugzilla.qbang.org/show_bug.cgi?id=64 Solaris ACM port support Dave Cleal http://bugzilla.qbang.org/show_bug.cgi?id=59 Setting of non-standard baud rate fails. Andrew Prunicki http://bugzilla.qbang.org/show_bug.cgi?id=58 RXTX uses lockfiles on MacOS X (instead of ioctl TIOCEXCL) Joachim Buechse http://bugzilla.qbang.org/show_bug.cgi?id=50 JavaDoc fixes Joachim Buechse http://bugzilla.qbang.org/show_bug.cgi?id=49 I need to further review the following: http://bugzilla.qbang.org/show_bug.cgi?id=53 http://bugzilla.qbang.org/show_bug.cgi?id=46 http://bugzilla.qbang.org/show_bug.cgi?id=41 On Sun, 18 Nov 2007, Trent Jarvi wrote: > > The following bugs have been closed and CVS updated as needed: > > CommPortIdentifier.getPortIdentifier throws NoSuchPortException > http://bugzilla.qbang.org/show_bug.cgi?id=48 > CommPortOwnership events not sent > http://bugzilla.qbang.org/show_bug.cgi?id=83 > JVM 1.6 builds > http://bugzilla.qbang.org/show_bug.cgi?id=84 > > I'd like to give Martin Oberhuber CVS write access. He has been doing a > great job of pushing safe patches into rxtx. > > I'll be preparing seperate patches for the changes I have and submitting > them to the list. > > I'll need to work with George to do a couple things: > > 1) break the patch into smaller pieces to isolate issues for discussion. > 2) work through the Line Status Register changes so it does not cause > problems on other systems. > > George: If you could do the first one, it would be greatly appreciated. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From netbeans at gatworks.com Sun Nov 18 16:20:02 2007 From: netbeans at gatworks.com (U. George) Date: Sun, 18 Nov 2007 18:20:02 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: Message-ID: <4740C8A2.6030908@gatworks.com> > I'll need to work with George to do a couple things: > > 1) break the patch into smaller pieces to isolate issues for discussion. > 2) work through the Line Status Register changes so it does not cause > problems on other systems. > > George: If you could do the first one, it would be greatly appreciated. there are ( probably ) 3 pieces: 1) the select() failure when the USB-serial device is unceremoniously unplugged ( causes rxtx to spin ) 2) TIOCSERGETLSR, need to have the simulation of it available for all os's . If the system has the capability, don't simulate for devices that have the capability. For devices that dont have the capability, but the OS still defines TIOCSERGETLSR, fall back to simulation. 3) I rearranged DEBUG ifdef's. This is probably the bulk of the patches. From tjarvi at qbang.org Sun Nov 18 18:26:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 18:26:26 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <4740C8A2.6030908@gatworks.com> References: <4740C8A2.6030908@gatworks.com> Message-ID: On Sun, 18 Nov 2007, U. George wrote: > >> I'll need to work with George to do a couple things: >> >> 1) break the patch into smaller pieces to isolate issues for discussion. >> 2) work through the Line Status Register changes so it does not cause >> problems on other systems. >> >> George: If you could do the first one, it would be greatly appreciated. > > there are ( probably ) 3 pieces: > 1) the select() failure when the USB-serial device is unceremoniously > unplugged ( causes rxtx to spin ) > 2) TIOCSERGETLSR, need to have the simulation of it available for all os's . > If the system has the capability, don't simulate for devices that have the > capability. For devices that dont have the capability, but the OS still > defines TIOCSERGETLSR, fall back to simulation. > 3) I rearranged DEBUG ifdef's. This is probably the bulk of the patches. > Hi George, I suspect if you do cvs update, there will be very few conflicts if any. While the list of fixes is fairly long, the changes are small. -- Trent Jarvi tjarvi at qbang.org From EdwardRF at xtremax.com Mon Nov 19 03:32:29 2007 From: EdwardRF at xtremax.com (Edward) Date: Mon, 19 Nov 2007 18:32:29 +0800 Subject: [Rxtx] Cannot Read under Windows XP Message-ID: <4741663D.4070200@xtremax.com> Hi Guys, I have a iTegno 3000 usb GSM modem, it is an usb-serial device. I am trying to use RXTX with it under Windows XP. The problem is it seems RXTX cannot read any data from it, but writing to it seems successful. I blindly issue a series of command to send off a SMS, it is successfully delivered, but neither the echo from the modem nor the "OK" response was received. I tried to connect to the modem directly using hyper terminal, there was no problem reading or writing. So can i assume it is not the driver problem? Then i turned to Serial Port Monitor for help, when I use hyper terminal, monitor shows both way traffic, and nothing abnormal, but when I connect using RXTX, only the data I sent to the modem is being detected, no input was detected. Does anyone else experience similar problem? Best Regards Edward From tjarvi at qbang.org Mon Nov 19 03:38:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Nov 2007 03:38:02 -0700 (MST) Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: <4741663D.4070200@xtremax.com> References: <4741663D.4070200@xtremax.com> Message-ID: On Mon, 19 Nov 2007, Edward wrote: > Hi Guys, > > I have a iTegno 3000 usb GSM modem, it is an usb-serial device. I am > trying to use RXTX with it under Windows XP. > The problem is it seems RXTX cannot read any data from it, but writing > to it seems successful. I blindly issue a series of command to send off > a SMS, it is successfully delivered, but neither the echo from the modem > nor the "OK" response was received. > > I tried to connect to the modem directly using hyper terminal, there was > no problem reading or writing. So can i assume it is not the driver problem? > > Then i turned to Serial Port Monitor for help, when I use hyper > terminal, monitor shows both way traffic, and nothing abnormal, but when > I connect using RXTX, only the data I sent to the modem is being > detected, no input was detected. > > Does anyone else experience similar problem? > Hi Edward, A common mistake is to send Strings to the modem which are i18n. You want to send the bytes. Examples of doing this are in the contrib directory with the sourcecode. ie SimpleSnuV1.java -- Trent Jarvi tjarvi at qbang.org From EdwardRF at xtremax.com Mon Nov 19 04:42:16 2007 From: EdwardRF at xtremax.com (Edward) Date: Mon, 19 Nov 2007 19:42:16 +0800 Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: References: <4741663D.4070200@xtremax.com> Message-ID: <47417698.3060705@xtremax.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071119/b0f08ba9/attachment-0011.html From netbeans at gatworks.com Mon Nov 19 06:31:30 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 19 Nov 2007 08:31:30 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: <4740C8A2.6030908@gatworks.com> Message-ID: <47419032.8080406@gatworks.com> Did the "make install". The install does not want to go to or use Makefiles's prefix = /usr/local/rxtx-devel Not terribly happy that it installed in /home/gat/JAVA/JDK14/j2sdk1.4.2_08/jre/lib/i386 Trent Jarvi wrote: > > I suspect if you do cvs update, there will be very few conflicts if any. > While the list of fixes is fairly long, the changes are small. > > -- > Trent Jarvi > tjarvi at qbang.org > > From Martin.Oberhuber at windriver.com Mon Nov 19 07:00:48 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 19 Nov 2007 15:00:48 +0100 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE6485848039986E6@ism-mail03.corp.ad.wrs.com> It's great to see things progressing - thanks Trent! I checked CVS, and it seems that most of the patch authors are yet missing from the AUTHORS file, is this intentional? The issues areound RXTXPort.close() are interesting for us in the context of Eclipse as well: https://bugs.eclipse.org/bugs/show_bug.cgi?id=208185#c3 I did a quick review and found some issues / comments: http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 http://bugzilla.qbang.org/show_bug.cgi?id=53#c9 Thanks for proposing CVS write access for me. I promise to use these thoughtfully, and discuss potential fixes openly (on bugzilla) before applying them [unless it's really trivial issues only like obvious Javadoc syntax or spelling errors]. Cheers, -- 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 Mon Nov 19 07:24:16 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 19 Nov 2007 15:24:16 +0100 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803998711@ism-mail03.corp.ad.wrs.com> Hi all, I think I've got a better version for RXTXCommDriver.checkSolaris(): http://bugzilla.qbang.org/show_bug.cgi?id=77#c3 Cheers, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From netbeans at gatworks.com Mon Nov 19 09:01:22 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 19 Nov 2007 11:01:22 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <47419032.8080406@gatworks.com> References: <4740C8A2.6030908@gatworks.com> <47419032.8080406@gatworks.com> Message-ID: <4741B352.8070205@gatworks.com> U. George wrote: > Did the "make install". The install does not want to go to or use > Makefiles's prefix = /usr/local/rxtx-devel > > Not terribly happy that it installed in > /home/gat/JAVA/JDK14/j2sdk1.4.2_08/jre/lib/i386 > Put libs and jar in MY preferential places. Ran application. And it loves to spin. Deja gnu all over again. :-/ It did find the avail /dev/ttyUSB0 port connected to LINUX usbserial/pl2303 device driver. Now to find the spin. and apply simpler set of patches From tjarvi at qbang.org Mon Nov 19 10:14:38 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Nov 2007 10:14:38 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <4741B352.8070205@gatworks.com> References: <4740C8A2.6030908@gatworks.com> <47419032.8080406@gatworks.com> <4741B352.8070205@gatworks.com> Message-ID: On Mon, 19 Nov 2007, U. George wrote: > U. George wrote: >> Did the "make install". The install does not want to go to or use >> Makefiles's prefix = /usr/local/rxtx-devel >> >> Not terribly happy that it installed in >> /home/gat/JAVA/JDK14/j2sdk1.4.2_08/jre/lib/i386 >> > Put libs and jar in MY preferential places. Ran application. And it loves to > spin. Deja gnu all over again. :-/ > > It did find the avail /dev/ttyUSB0 port connected to LINUX usbserial/pl2303 > device driver. > > Now to find the spin. and apply simpler set of patches > Hi George, When the prefix code was stomped on and the library was installed in the jre, It wasnt clear how the layout would end up looking. I'm still not sure. My usual attack was to dump a jdk onto the filesystem, set JAVA_HOME and install. When I was done, I would nuke the jdk. Obviously that may not be what people want but I'm not sure a prefix is enough to let us know what they do want. For a shared library prefix /usr/local means the library goes in /usr/local/lib. What would it mean for the jar and shared library in Java? -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Nov 19 10:24:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Nov 2007 10:24:08 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <460801A4097E3D4CA04CC64EE6485848039986E6@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848039986E6@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 19 Nov 2007, Oberhuber, Martin wrote: > > I checked CVS, and it seems that most of the patch > authors are yet missing from the AUTHORS file, > is this intentional? > There isn't a hard rule covering who goes into AUTHORS. If I recognize a person from previous patches, I try to make sure they are in. Everyone contributing (authors) is in the ChangeLog with what they did going all the way back to the first release. AUTHORS is more of a summary of what they did after a few submissions. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Nov 19 11:39:51 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 19 Nov 2007 13:39:51 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: <4740C8A2.6030908@gatworks.com> <47419032.8080406@gatworks.com> <4741B352.8070205@gatworks.com> Message-ID: <4741D877.80203@gatworks.com> For me, the makefile/prefix = /usr/local sorta suggest thats where the libs/bins/jars/... should eventually wind up. If a user does not like /usr/local, then a quick change would put it somewhere else. At this moment I dont care where the jar winds up ( in lib, or a jar directory ). So I like to keep the jre/sdk directory protected from meddling, and changes. But if a user has a penchant to use 'java -jar', then the RXTXcomm.jar file should be stuffed with the other jre/sdk jar files. From ajmas at sympatico.ca Mon Nov 19 11:54:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 19 Nov 2007 13:54:29 -0500 Subject: [Rxtx] CVS updates and closed bugs Message-ID: <20071119185429.SPYK18413.tomts22-srv.bellnexxia.net@smtp1.sympatico.ca> On this day in November "U. George" wrote: > > For me, the makefile/prefix = /usr/local sorta suggest thats where the > libs/bins/jars/... should eventually wind up. > If a user does not like /usr/local, then a quick change would put it > somewhere else. At this moment I dont care where the jar winds up ( in > lib, or a jar directory ). > So I like to keep the jre/sdk directory protected from meddling, and > changes. > But if a user has a penchant to use 'java -jar', then the RXTXcomm.jar > file should be stuffed with the other jre/sdk jar files. It should be noted that some platforms, such as MacOS X might have different conventions. In the case of MacOS X there are two 'correct' places for Java libraries that aren't part of an application: - /Library/Java/Extensions/ - ~/Library/Java/Extensions/ Andre From ajmas at sympatico.ca Mon Nov 19 18:15:37 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 19 Nov 2007 20:15:37 -0500 Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: <47417698.3060705@xtremax.com> References: <4741663D.4070200@xtremax.com> <47417698.3060705@xtremax.com> Message-ID: <3D24B671-06CA-4709-AE3C-BCDB542F427F@sympatico.ca> On 19-Nov-07, at 06:42 , Edward wrote: > Hi Trent, > > First of all, I did sent them as bytes, eg, > > output.write("at\r\n".getBytes()); > > And if writing is every the problem, it wouldn't be able to explain > why i could send out a sms successfully using RXTX. > If you have the section of code that does the communicating, could you share it with us? This should help us tell whether it is a coding issue or something more fundamental with RXTX. Andre From EdwardRF at xtremax.com Mon Nov 19 19:39:36 2007 From: EdwardRF at xtremax.com (EdwardRF) Date: Tue, 20 Nov 2007 10:39:36 +0800 Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: <3D24B671-06CA-4709-AE3C-BCDB542F427F@sympatico.ca> References: <4741663D.4070200@xtremax.com> <47417698.3060705@xtremax.com> <3D24B671-06CA-4709-AE3C-BCDB542F427F@sympatico.ca> Message-ID: <474248E8.7070002@xtremax.com> Hi Guys, Thanks for the help, i've finally found out the problem. It was a flow control issue, i did not set the flow control properly. Btw, what is the default flow control behavior for rxtx2.1.7? was it the same as 2.0? Because i remember i did not need to set the flow control when I use rxtx 2.0 2 years back. Best Regards Edward Andre-John Mas wrote: > > On 19-Nov-07, at 06:42 , Edward wrote: > >> Hi Trent, >> >> First of all, I did sent them as bytes, eg, >> >> output.write("at\r\n".getBytes()); >> >> And if writing is every the problem, it wouldn't be able to explain >> why i could send out a sms successfully using RXTX. >> > > If you have the section of code that does the communicating, could you > share it with us? This should help us tell whether it is a coding > issue or something more fundamental with RXTX. > > Andre > From netbeans at gatworks.com Tue Nov 20 06:23:26 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 20 Nov 2007 08:23:26 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: <4740C8A2.6030908@gatworks.com> Message-ID: <4742DFCE.5070504@gatworks.com> Here is the small subset of diffs just for TIOCSERGETLSR :) Next I'll pull out the usb device, and see if that also causes rxtx to spin. >> 2) TIOCSERGETLSR, need to have the simulation of it available for all >> os's . If the system has the capability, don't simulate for devices >> that have the capability. For devices that dont have the capability, >> but the OS still defines TIOCSERGETLSR, fall back to simulation. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: a Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20071120/2c5c8ee7/attachment-0008.pl From tjarvi at qbang.org Tue Nov 20 08:20:21 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Nov 2007 08:20:21 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <4742DFCE.5070504@gatworks.com> References: <4740C8A2.6030908@gatworks.com> <4742DFCE.5070504@gatworks.com> Message-ID: On Tue, 20 Nov 2007, U. George wrote: > Here is the small subset of diffs just for TIOCSERGETLSR :) > > Next I'll pull out the usb device, and see if that also causes rxtx to spin. > >>> 2) TIOCSERGETLSR, need to have the simulation of it available for all os's >>> . If the system has the capability, don't simulate for devices that have >>> the capability. For devices that dont have the capability, but the OS >>> still defines TIOCSERGETLSR, fall back to simulation. > Hi George, I'll be looking through this patch in detail tonight. I just wanted to make sure you are aware of this line in win32termios.h. The ifdef logic is messy as you noticed. That is combined with the later addition of support for it to windows. #define TIOCSERGETLSR 0x5459 (this is by far the strangest code in rxtx in retrospect) I'll be able to do extensive automated testing once we get to that point. I'm confident we can get something in that has a low probability of causing regressions. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Tue Nov 20 08:42:08 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 20 Nov 2007 10:42:08 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: <4740C8A2.6030908@gatworks.com> <4742DFCE.5070504@gatworks.com> Message-ID: <47430050.1010203@gatworks.com> It is of no difference. 1) If the define does not exist, then it should be as before. 2) If it does exist, then it should also be as before. 3) If it does exist, but the ioctl fails, then it will fallback as if it did not exist in the first place. Trent Jarvi wrote: > On Tue, 20 Nov 2007, U. George wrote: > >> Here is the small subset of diffs just for TIOCSERGETLSR :) >> >> Next I'll pull out the usb device, and see if that also causes rxtx to >> spin. >> >>>> 2) TIOCSERGETLSR, need to have the simulation of it available for >>>> all os's . If the system has the capability, don't simulate for >>>> devices that have the capability. For devices that dont have the >>>> capability, but the OS still defines TIOCSERGETLSR, fall back to >>>> simulation. >> > > Hi George, > > I'll be looking through this patch in detail tonight. I just wanted to > make sure you are aware of this line in win32termios.h. The ifdef logic > is messy as you noticed. That is combined with the later addition of > support for it to windows. > > #define TIOCSERGETLSR 0x5459 > > (this is by far the strangest code in rxtx in retrospect) > > I'll be able to do extensive automated testing once we get to that > point. I'm confident we can get something in that has a low probability > of causing regressions. > > -- > Trent Jarvi > tjarvi at qbang.org > > From netbeans at gatworks.com Tue Nov 20 08:36:56 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 20 Nov 2007 10:36:56 -0500 Subject: [Rxtx] Unplugged Opened USB devices In-Reply-To: <4742DFCE.5070504@gatworks.com> References: <4740C8A2.6030908@gatworks.com> <4742DFCE.5070504@gatworks.com> Message-ID: <4742FF18.3050005@gatworks.com> > Next I'll pull out the usb device, and see if that also causes rxtx to > spin. This is the error on a read. The select() should have failed, as well as the read(). java.io.IOException: Input/output error in nativeavailable at gnu.io.RXTXPort.nativeavailable(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1420) at jGPS.GpsData.DeviceDrivers.SerialPort.SerialPort_NMEA_GNU.serialEvent (SerialPort_NMEA_GNU.java:449) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:771) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1622) But for java program, it sees( when USB device is unplugged ) : 1) event: SerialPortEvent.DATA_AVAILABLE 2) read (non-existant) data. I think that its bad form to say DATA_AVAILABLE, when there is no data to be obtained. There does not seem to be an I/O error event. So basically, I think, and IMHO, that no events should be sent. Rather a thread timeout ( ie no data in X seconds ) AND recovery from user code should be instantiated. From manujnaman at yahoo.com Wed Nov 21 12:35:46 2007 From: manujnaman at yahoo.com (manuj naman) Date: Wed, 21 Nov 2007 11:35:46 -0800 (PST) Subject: [Rxtx] Problem reading 1-wire device using RXTX on Linux Message-ID: <371969.66249.qm@web37911.mail.mud.yahoo.com> Hello, I am trying to use the RXTX library on Ubuntu (Debian) linux to read iButtons. It works perfectly on Windows. However on my linux machines it gives the following errors. I am using DS9490 (USB port adapter) to read the iButtons. I have followed your instructions on the Wiki. I recompiled the rxtx library to produce the .so and .jar files. But still it gives me this: manujnaman at sensor:~/iButton/onewireviewer$ java -cp $CLASSPATH:./OneWireAPI.jar:./OneWireViewer.jar OneWireViewer Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Warning: serial communications API not setup properly, no ports in enumeration Pure-Java DS9097U adapter will not work, not added to adapter enum Standard drivers for 1-Wire are not found. Please download the latest drivers from http://www.ibutton.com Or install RXTX Serial Communications API from http://www.rxtx.org Do you know how to solve the "Serial communications API not setup properly, no ports in enumeration" problem? Also, how to detect which what /dev/* is the port to be used? On Windows this is simply USB1, on linux this is a bit unclear. Many thanks for your advice, Manuj Naman Dallas, TX, US manujnaman at yahoo.com --------------------------------- Be a better pen pal. Text or chat with friends inside Yahoo! Mail. See how. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071121/2760f691/attachment-0007.html From Martin.Oberhuber at windriver.com Wed Nov 21 13:55:25 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 21 Nov 2007 21:55:25 +0100 Subject: [Rxtx] Should RXTX Lixense link to LGPL-2.1 be changed? In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803A21160@ism-mail03.corp.ad.wrs.com> Hi Trent and all, In all the RXTX source files as well as http://users.frii.com/jarvi/rxtx/license.html there is the following lines: | A copy of the LGPL v 2.1 may be found at | http://www.gnu.org/licenses/lgpl.txt on March 4th 2007. A copy is | here for your convenience. But, as of today, at the link provided there is only a copy of the LGPL v3.0. I think there should be a link to the LGPL v2.1, e.g. http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html What do you think? Cheers, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Nov 21 20:46:18 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Nov 2007 20:46:18 -0700 (MST) Subject: [Rxtx] Problem reading 1-wire device using RXTX on Linux In-Reply-To: <371969.66249.qm@web37911.mail.mud.yahoo.com> References: <371969.66249.qm@web37911.mail.mud.yahoo.com> Message-ID: On Wed, 21 Nov 2007, manuj naman wrote: > Hello, > > I am trying to use the RXTX library on Ubuntu (Debian) linux to read iButtons. It works perfectly on Windows. However on my linux machines it gives the following errors. I am using DS9490 (USB port adapter) to read the iButtons. > > I have followed your instructions on the Wiki. I recompiled the rxtx library to produce the .so and .jar files. But still it gives me this: > > manujnaman at sensor:~/iButton/onewireviewer$ java -cp $CLASSPATH:./OneWireAPI.jar:./OneWireViewer.jar OneWireViewer > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > Warning: serial communications API not setup properly, no ports in enumeration > Pure-Java DS9097U adapter will not work, not added to adapter enum > > Standard drivers for 1-Wire are not found. > Please download the latest drivers from http://www.ibutton.com > Or install RXTX Serial Communications API from http://www.rxtx.org > > Do you know how to solve the "Serial communications API not setup properly, no ports in enumeration" problem? > > Also, how to detect which what /dev/* is the port to be used? On Windows this is simply USB1, on linux this is a bit unclear. Hi Manuj What is the output of the following? dmesg |grep tty touch /var/lock/test.lock && rm -f /var/lock/test.lock If you see something like /dev/ttyUSB0 in the dmesg output, what happens if you do something like tail -f /dev/ttyUSB0? These test each of the usual suspects. We are looking for missing USB drivers, no permission to create a lockfile and no read permission for the device. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Nov 21 21:05:23 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Nov 2007 21:05:23 -0700 (MST) Subject: [Rxtx] Should RXTX Lixense link to LGPL-2.1 be changed? In-Reply-To: <460801A4097E3D4CA04CC64EE648584803A21160@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803A21160@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 21 Nov 2007, Oberhuber, Martin wrote: > Hi Trent and all, > > In all the RXTX source files as well as > http://users.frii.com/jarvi/rxtx/license.html > there is the following lines: > > | A copy of the LGPL v 2.1 may be found at > | http://www.gnu.org/licenses/lgpl.txt on March 4th 2007. A copy is > | here for your convenience. > > But, as of today, at the link provided there is only > a copy of the LGPL v3.0. I think there should be a link > to the LGPL v2.1, e.g. > http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html > > What do you think? > Hi Martin, Thanks. I updated the link. Changing licences is a heavy process for me as a free software developer and an employee so I'd rather stay with 2.1 unless the current license becomes a show stopper. I figured that would happen someday so I put the date in to be clear. -- Trent Jarvi tjarvi at qbang.org From beat.arnet at gmail.com Thu Nov 22 08:45:45 2007 From: beat.arnet at gmail.com (Beat Arnet) Date: Thu, 22 Nov 2007 10:45:45 -0500 Subject: [Rxtx] Dual Core Problem Message-ID: <4745A429.9060604@gmail.com> Dear All, I am struggling with an application that uses RXTX 2.1.7 and has been working reliably in the past. When this program runs on a dual-core DELL (Intel T2500), strange things happen with the RS232 communication. The application is missing incoming characters and also often freezes when trying to close the serial port. I highly suspect a threading problem and was wondering if a) anybody had run into a similar problem with dual core processors and b) if there is a list of does and dont's when it comes to RXTX and threads. Regards, Beat From tjarvi at qbang.org Thu Nov 22 13:22:43 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 22 Nov 2007 13:22:43 -0700 (MST) Subject: [Rxtx] Dual Core Problem In-Reply-To: <4745A429.9060604@gmail.com> References: <4745A429.9060604@gmail.com> Message-ID: On Thu, 22 Nov 2007, Beat Arnet wrote: > Dear All, > I am struggling with an application that uses RXTX 2.1.7 and has been > working reliably in the past. When this program runs on a dual-core DELL > (Intel T2500), strange things happen with the RS232 communication. The > application is missing incoming characters and also often freezes when > trying to close the serial port. I highly suspect a threading problem > and was wondering if a) anybody had run into a similar problem with dual > core processors and b) if there is a list of does and dont's when it > comes to RXTX and threads. > I've used rxtx with SMP systems but have not experimented very much with threading and rxtx. One red flag rxtx raises is it stores pointers to java objects in SerialImp.c. If the JVM decides to move things around, rxtx becomes confused. Missing incomming characters is usually caused by someone running two applications. They then fight over the incomming data. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Fri Nov 23 03:12:28 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 23 Nov 2007 11:12:28 +0100 Subject: [Rxtx] Dual Core Problem In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803A84C59@ism-mail03.corp.ad.wrs.com> > Missing incomming characters is usually caused by someone running two > applications. They then fight over the incomming data. I've seen exactly this scenario on Linux with Lockfiles disabled. Usually, port locking (through Lockfiles or Ioctl method) should avoid exactly this problem. I know that on Mac, port locking through Kernel/Ioctl method has been added for the upcoming RXTX 2.1-8. What's the status of this feature for Linux and other Unixes? Cheers, Martin From chris.paton at red61.com Fri Nov 23 05:26:10 2007 From: chris.paton at red61.com (Chris Paton) Date: Fri, 23 Nov 2007 12:26:10 +0000 Subject: [Rxtx] RXTX parallel port issues Message-ID: <4746C6E2.3000304@red61.com> Hi there, I've been happily using RXTX to communicate with a serial based point-of-sale printer for a several months. I've recently received a parallel based printer and have been trying to get RXTX to talk to this too. I've encountered a few problems along the way and just wanted to check if I'm doing anything wrong, or if I've found any bugs. Writing ------- Writing to the parallel port using ParallelPort.getOutputStream works well, except when I use OutputStream.write(byte[]) to write a multiple of 8 bytes (!). Doing this causes the JVM to crash with an EXCEPTION_PRIV_INSTRUCTION on Windows. I worked around this in my application by adding an additional byte if bytesToWrite % 8 == 0. I guess I could also have called write(byte) repeatedly. This also generated a SIGSEGV on Linux but I was unable to reproduce it today using the CVS version of RXTX and a recent kernel. Reading status pins ------------------- On Linux, I've found that ParallelPort.isPaperOut and ParallelPort.isPrinterSelected appear to be inverted; i.e. when the paper is out ParallelPort.isPaperOut returns false, and when there is paper ParallelPort.isPaperOut returns true! I've tested this in both Sun JDK5 and JDK6 on machines running Linux 2.6.21 and 2.6.23. Fortunately it's easy to use a conditional based on System.getProperty("os.name") to hack around this. Reading from InputStream ------------------------ I've had more serious issues trying to read from ParallelPort.getInputStream. On Windows, readByte seems to return -1 (end of stream) any time data isn't available. On Linux, I got a kernel oops, even with a recent 2.6.23.1 kernel. I was able to stop this using a kernel patch that I found via Google. Although this stopped the oops, I still get frequent IOExceptions when calling InputStream.readByte. It appears that instead of blocking, readByte throws an IOException with message "Resource temporarily unavailable in readByte" any time it is called when no data is available. Occasionally, I get an exception instead of the data I was expecting to read, e.g when asking my printer for a version string I get "VER: S3306 * 06.03* 10/*6/06" where the *s indicate that an exception occurred and data was missed. Any advice that anyone can offer would be much appreciated. If you need any more details or debugging information about any of these problems then let me know. Cheers -- Chris Paton Technical Developer Red61 -- Transaction Marketing Software http://www.red61.com -------------- next part -------------- A non-text attachment was scrubbed... Name: chris.paton.vcf Type: text/x-vcard Size: 230 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20071123/00a747b6/attachment-0012.vcf From chris.paton at red61.com Fri Nov 23 05:26:10 2007 From: chris.paton at red61.com (Chris Paton) Date: Fri, 23 Nov 2007 12:26:10 +0000 Subject: [Rxtx] RXTX parallel port issues Message-ID: <4746C6E2.3000304@red61.com> Hi there, I've been happily using RXTX to communicate with a serial based point-of-sale printer for a several months. I've recently received a parallel based printer and have been trying to get RXTX to talk to this too. I've encountered a few problems along the way and just wanted to check if I'm doing anything wrong, or if I've found any bugs. Writing ------- Writing to the parallel port using ParallelPort.getOutputStream works well, except when I use OutputStream.write(byte[]) to write a multiple of 8 bytes (!). Doing this causes the JVM to crash with an EXCEPTION_PRIV_INSTRUCTION on Windows. I worked around this in my application by adding an additional byte if bytesToWrite % 8 == 0. I guess I could also have called write(byte) repeatedly. This also generated a SIGSEGV on Linux but I was unable to reproduce it today using the CVS version of RXTX and a recent kernel. Reading status pins ------------------- On Linux, I've found that ParallelPort.isPaperOut and ParallelPort.isPrinterSelected appear to be inverted; i.e. when the paper is out ParallelPort.isPaperOut returns false, and when there is paper ParallelPort.isPaperOut returns true! I've tested this in both Sun JDK5 and JDK6 on machines running Linux 2.6.21 and 2.6.23. Fortunately it's easy to use a conditional based on System.getProperty("os.name") to hack around this. Reading from InputStream ------------------------ I've had more serious issues trying to read from ParallelPort.getInputStream. On Windows, readByte seems to return -1 (end of stream) any time data isn't available. On Linux, I got a kernel oops, even with a recent 2.6.23.1 kernel. I was able to stop this using a kernel patch that I found via Google. Although this stopped the oops, I still get frequent IOExceptions when calling InputStream.readByte. It appears that instead of blocking, readByte throws an IOException with message "Resource temporarily unavailable in readByte" any time it is called when no data is available. Occasionally, I get an exception instead of the data I was expecting to read, e.g when asking my printer for a version string I get "VER: S3306 * 06.03* 10/*6/06" where the *s indicate that an exception occurred and data was missed. Any advice that anyone can offer would be much appreciated. If you need any more details or debugging information about any of these problems then let me know. Cheers -- Chris Paton Technical Developer Red61 -- Transaction Marketing Software http://www.red61.com -------------- next part -------------- A non-text attachment was scrubbed... Name: chris.paton.vcf Type: text/x-vcard Size: 230 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20071123/00a747b6/attachment-0013.vcf From hho at bibliotheca.dk Fri Nov 23 06:45:36 2007 From: hho at bibliotheca.dk (Hans Hvelplund Odborg) Date: Fri, 23 Nov 2007 14:45:36 +0100 Subject: [Rxtx] RXTX parallel port issues In-Reply-To: <4746C6E2.3000304@red61.com> References: <4746C6E2.3000304@red61.com> Message-ID: <001201c82dd7$21c6e2c0$6a37a8c0@HANSLAPTOP> I've experienced similar crashes in JVM when writing to the parallel port in windows (with rxtx). Unfortunately I did not save the data sent to the parallel port so cannot say anything about the length. Furthermore, I recall having problems with .write(byte) (would never exit if I recall correctly), but I do not recall if this was with serial or parallel or both. In the end, we ended printing through Java's support of the windows driver. Unfortunately I currently don?t have the time to investigate these issues further. I just wanted to let you know that currently there are bugs in rxtx. Med venlig hilsen / Best regards / Med v?nliga h?lsningar Hans Hvelplund Odborg BIBLIOTHECA A/S Vallensb?kvej 20B ? 2605 Br?ndby ? Denmark Tel.: +45 70271008 Fax: +45 70271009 hho at bibliotheca.dk www.bibliotheca.dk -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Chris Paton Sent: 23. november 2007 13:26 To: rxtx at qbang.org Subject: [Rxtx] RXTX parallel port issues Hi there, I've been happily using RXTX to communicate with a serial based point-of-sale printer for a several months. I've recently received a parallel based printer and have been trying to get RXTX to talk to this too. I've encountered a few problems along the way and just wanted to check if I'm doing anything wrong, or if I've found any bugs. Writing ------- Writing to the parallel port using ParallelPort.getOutputStream works well, except when I use OutputStream.write(byte[]) to write a multiple of 8 bytes (!). Doing this causes the JVM to crash with an EXCEPTION_PRIV_INSTRUCTION on Windows. I worked around this in my application by adding an additional byte if bytesToWrite % 8 == 0. I guess I could also have called write(byte) repeatedly. This also generated a SIGSEGV on Linux but I was unable to reproduce it today using the CVS version of RXTX and a recent kernel. Reading status pins ------------------- On Linux, I've found that ParallelPort.isPaperOut and ParallelPort.isPrinterSelected appear to be inverted; i.e. when the paper is out ParallelPort.isPaperOut returns false, and when there is paper ParallelPort.isPaperOut returns true! I've tested this in both Sun JDK5 and JDK6 on machines running Linux 2.6.21 and 2.6.23. Fortunately it's easy to use a conditional based on System.getProperty("os.name") to hack around this. Reading from InputStream ------------------------ I've had more serious issues trying to read from ParallelPort.getInputStream. On Windows, readByte seems to return -1 (end of stream) any time data isn't available. On Linux, I got a kernel oops, even with a recent 2.6.23.1 kernel. I was able to stop this using a kernel patch that I found via Google. Although this stopped the oops, I still get frequent IOExceptions when calling InputStream.readByte. It appears that instead of blocking, readByte throws an IOException with message "Resource temporarily unavailable in readByte" any time it is called when no data is available. Occasionally, I get an exception instead of the data I was expecting to read, e.g when asking my printer for a version string I get "VER: S3306 * 06.03* 10/*6/06" where the *s indicate that an exception occurred and data was missed. Any advice that anyone can offer would be much appreciated. If you need any more details or debugging information about any of these problems then let me know. Cheers -- Chris Paton Technical Developer Red61 -- Transaction Marketing Software http://www.red61.com From tjarvi at qbang.org Fri Nov 23 16:28:23 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 23 Nov 2007 16:28:23 -0700 (MST) Subject: [Rxtx] RXTX parallel port issues In-Reply-To: <001201c82dd7$21c6e2c0$6a37a8c0@HANSLAPTOP> References: <4746C6E2.3000304@red61.com> <001201c82dd7$21c6e2c0$6a37a8c0@HANSLAPTOP> Message-ID: It would be good to create a bug report for this so others can either look into it or find the report to confirm their suspicions. Currently, there is only one parallel port bug report. http://bugzilla.qbang.org/show_bug.cgi?id=40 As we do update the reports when bugs are fixed, it gives people a chance to put themselves on the CC list and get notification of fixes they are interested in. On Fri, 23 Nov 2007, Hans Hvelplund Odborg wrote: > > I've experienced similar crashes in JVM when writing to the parallel port in > windows (with rxtx). > > Unfortunately I did not save the data sent to the parallel port so cannot > say anything about the length. > > Furthermore, I recall having problems with .write(byte) (would never exit if > I recall correctly), but I do not recall if this was with serial or parallel > or both. > > In the end, we ended printing through Java's support of the windows driver. > > Unfortunately I currently don?t have the time to investigate these issues > further. I just wanted to let you know that currently there are bugs in > rxtx. > > > Med venlig hilsen / Best regards / Med v?nliga h?lsningar > Hans Hvelplund Odborg > > BIBLIOTHECA A/S > Vallensb?kvej 20B ? 2605 Br?ndby ? Denmark > Tel.: +45 70271008 > Fax: +45 70271009 > hho at bibliotheca.dk > www.bibliotheca.dk > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Chris Paton > Sent: 23. november 2007 13:26 > To: rxtx at qbang.org > Subject: [Rxtx] RXTX parallel port issues > > Hi there, > > I've been happily using RXTX to communicate with a serial based > point-of-sale printer for a several months. I've recently received a > parallel based printer and have been trying to get RXTX to talk to this > too. I've encountered a few problems along the way and just wanted to > check if I'm doing anything wrong, or if I've found any bugs. > > Writing > ------- > Writing to the parallel port using ParallelPort.getOutputStream works > well, except when I use OutputStream.write(byte[]) to write a multiple > of 8 bytes (!). Doing this causes the JVM to crash with an > EXCEPTION_PRIV_INSTRUCTION on Windows. I worked around this in my > application by adding an additional byte if bytesToWrite % 8 == 0. I > guess I could also have called write(byte) repeatedly. > > This also generated a SIGSEGV on Linux but I was unable to reproduce it > today using the CVS version of RXTX and a recent kernel. > > Reading status pins > ------------------- > On Linux, I've found that ParallelPort.isPaperOut and > ParallelPort.isPrinterSelected appear to be inverted; i.e. when the > paper is out ParallelPort.isPaperOut returns false, and when there is > paper ParallelPort.isPaperOut returns true! I've tested this in both Sun > JDK5 and JDK6 on machines running Linux 2.6.21 and 2.6.23. Fortunately > it's easy to use a conditional based on System.getProperty("os.name") to > hack around this. > > Reading from InputStream > ------------------------ > > I've had more serious issues trying to read from > ParallelPort.getInputStream. On Windows, readByte seems to return -1 > (end of stream) any time data isn't available. > > On Linux, I got a kernel oops, even with a recent 2.6.23.1 > kernel. I was able to stop this using a kernel patch > > that I found via Google. Although this stopped the oops, I still get > frequent IOExceptions when calling InputStream.readByte. It appears that > instead of blocking, readByte throws an IOException with message > "Resource temporarily unavailable in readByte" any time it is called > when no data is available. Occasionally, I get an exception instead of > the data I was expecting to read, e.g when asking my printer for a > version string I get "VER: S3306 * 06.03* 10/*6/06" where the *s > indicate that an exception occurred and data was missed. > > > Any advice that anyone can offer would be much appreciated. If you need > any more details or debugging information about any of these problems > then let me know. > > Cheers > From manujnaman at yahoo.com Sun Nov 25 14:59:21 2007 From: manujnaman at yahoo.com (manuj naman) Date: Sun, 25 Nov 2007 13:59:21 -0800 (PST) Subject: [Rxtx] Problem reading 1-wire device using RXTX on Linux In-Reply-To: Message-ID: <104159.48942.qm@web37909.mail.mud.yahoo.com> Trent, dmesg | grep tty gives nothing. however, greping for usb does. The output for that is below. touch /var/lock/test.lock file does not exist, the directory does exits though. tail -f /dev/ttyUSB0 gives nothing simply because ttyUSB0 does not exist. Seems as if USB ports are not there... however, numerous /dev/tty* exist starting from /dev/tty, /dev/tty0, /dev/tty1... to ... /dev/ttyzf. The result of dmesg | grep usb is as follows: [17179576.220000] usbcore: registered new driver usbfs [17179576.220000] usbcore: registered new driver hub [17179576.572000] usb 1-1: new low speed USB device using uhci_hcd and address 2 [17179576.992000] usb 2-1: new full speed USB device using uhci_hcd and address 2 [17179577.132000] usbcore: registered new driver hiddev [17179577.188000] input: USB HID v1.11 Mouse [Microsoft Microsoft Wireless Optical Mouse� 1.00] on usb-0000:00:1f.2-1 [17179577.188000] usbcore: registered new driver usbhid [17179577.188000] drivers/usb/input/hid-core.c: v2.6:USB HID core driver [17179577.192000] usb-storage: device found at 2 [17179577.192000] usb-storage: waiting for device to settle before scanning [17179577.192000] usbcore: registered new driver usb-storage [17179582.192000] usb-storage: device scan complete [17209993.728000] usb 1-2: new full speed USB device using uhci_hcd and address 3 [17209994.816000] usbcore: registered new driver DS9490R [17248016.760000] usb 1-1: USB disconnect, address 2 [17302939.908000] usb 1-2: USB disconnect, address 3 [17302944.856000] usb 1-2: new full speed USB device using uhci_hcd and address 4 [17794170.232000] usb 1-2: USB disconnect, address 4 Does it help in diagnosis? The name of the 1-wire viewer device is DS9490 Best regards, Manuj Trent Jarvi wrote: On Wed, 21 Nov 2007, manuj naman wrote: > Hello, > > I am trying to use the RXTX library on Ubuntu (Debian) linux to read iButtons. It works perfectly on Windows. However on my linux machines it gives the following errors. I am using DS9490 (USB port adapter) to read the iButtons. > > I have followed your instructions on the Wiki. I recompiled the rxtx library to produce the .so and .jar files. But still it gives me this: > > manujnaman at sensor:~/iButton/onewireviewer$ java -cp $CLASSPATH:./OneWireAPI.jar:./OneWireViewer.jar OneWireViewer > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > Warning: serial communications API not setup properly, no ports in enumeration > Pure-Java DS9097U adapter will not work, not added to adapter enum > > Standard drivers for 1-Wire are not found. > Please download the latest drivers from http://www.ibutton.com > Or install RXTX Serial Communications API from http://www.rxtx.org > > Do you know how to solve the "Serial communications API not setup properly, no ports in enumeration" problem? > > Also, how to detect which what /dev/* is the port to be used? On Windows this is simply USB1, on linux this is a bit unclear. Hi Manuj What is the output of the following? dmesg |grep tty touch /var/lock/test.lock && rm -f /var/lock/test.lock If you see something like /dev/ttyUSB0 in the dmesg output, what happens if you do something like tail -f /dev/ttyUSB0? These test each of the usual suspects. We are looking for missing USB drivers, no permission to create a lockfile and no read permission for the device. -- Trent Jarvi tjarvi at qbang.org --------------------------------- Be a better sports nut! Let your teams follow you with Yahoo Mobile. Try it now. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071125/ef4f80c4/attachment-0002.html From tjarvi at qbang.org Sun Nov 25 16:43:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 25 Nov 2007 16:43:04 -0700 (MST) Subject: [Rxtx] Problem reading 1-wire device using RXTX on Linux In-Reply-To: <104159.48942.qm@web37909.mail.mud.yahoo.com> References: <104159.48942.qm@web37909.mail.mud.yahoo.com> Message-ID: Hi Manuj, This does help diagnose the problem. Sadly the answer is in the system configuration of your debian system. I can only point you towards some areas that are suspect. /dev/tty01->/dev/ttyzz are terminals which are not of interest. It appears that the usb serial kernel module is not loading. That is usually in a directory like the following: /lib/modules/2.6.*/kernel/drivers/usb/serial modprobe is used to manually load the drivers. Your /dev/* may be created based upon the kernel modules loaded or MAKEDEV may be used to create the devices. /etc/modules.conf may be what is misconfigured though I'm not sure. One of the modules in usb/serial is probably responsible for representing your USB dongle as a tty. UDEV is probably responsible for creating ttyUSB01 once the kernel module is loaded. Perhaps someone has been through this before but basically this is a system configuration problem or a missing kernel driver. Once /dev/USB?? are present, rxtx should find the port. On Sun, 25 Nov 2007, manuj naman wrote: > Trent, > > dmesg | grep tty > gives nothing. however, greping for usb does. The output for that is below. > > touch /var/lock/test.lock file does not exist, the directory does exits though. > > tail -f /dev/ttyUSB0 gives nothing simply because ttyUSB0 does not exist. > > Seems as if USB ports are not there... however, numerous /dev/tty* exist starting from /dev/tty, /dev/tty0, /dev/tty1... to ... /dev/ttyzf. > > The result of dmesg | grep usb is as follows: > > [17179576.220000] usbcore: registered new driver usbfs > [17179576.220000] usbcore: registered new driver hub > [17179576.572000] usb 1-1: new low speed USB device using uhci_hcd and address 2 > [17179576.992000] usb 2-1: new full speed USB device using uhci_hcd and address 2 > [17179577.132000] usbcore: registered new driver hiddev > [17179577.188000] input: USB HID v1.11 Mouse [Microsoft Microsoft Wireless Optical Mouse� 1.00] on usb-0000:00:1f.2-1 > [17179577.188000] usbcore: registered new driver usbhid > [17179577.188000] drivers/usb/input/hid-core.c: v2.6:USB HID core driver > [17179577.192000] usb-storage: device found at 2 > [17179577.192000] usb-storage: waiting for device to settle before scanning > [17179577.192000] usbcore: registered new driver usb-storage > [17179582.192000] usb-storage: device scan complete > [17209993.728000] usb 1-2: new full speed USB device using uhci_hcd and address 3 > [17209994.816000] usbcore: registered new driver DS9490R > [17248016.760000] usb 1-1: USB disconnect, address 2 > [17302939.908000] usb 1-2: USB disconnect, address 3 > [17302944.856000] usb 1-2: new full speed USB device using uhci_hcd and address 4 > [17794170.232000] usb 1-2: USB disconnect, address 4 > > Does it help in diagnosis? The name of the 1-wire viewer device is DS9490 > > Best regards, > Manuj > > > Trent Jarvi wrote: On Wed, 21 Nov 2007, manuj naman wrote: > >> Hello, >> >> I am trying to use the RXTX library on Ubuntu (Debian) linux to read iButtons. It works perfectly on Windows. However on my linux machines it gives the following errors. I am using DS9490 (USB port adapter) to read the iButtons. >> >> I have followed your instructions on the Wiki. I recompiled the rxtx library to produce the .so and .jar files. But still it gives me this: >> >> manujnaman at sensor:~/iButton/onewireviewer$ java -cp $CLASSPATH:./OneWireAPI.jar:./OneWireViewer.jar OneWireViewer >> Experimental: JNI_OnLoad called. >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> Warning: serial communications API not setup properly, no ports in enumeration >> Pure-Java DS9097U adapter will not work, not added to adapter enum >> >> Standard drivers for 1-Wire are not found. >> Please download the latest drivers from http://www.ibutton.com >> Or install RXTX Serial Communications API from http://www.rxtx.org >> >> Do you know how to solve the "Serial communications API not setup properly, no ports in enumeration" problem? >> >> Also, how to detect which what /dev/* is the port to be used? On Windows this is simply USB1, on linux this is a bit unclear. > > > Hi Manuj > > What is the output of the following? > > dmesg |grep tty > > touch /var/lock/test.lock && rm -f /var/lock/test.lock > > If you see something like /dev/ttyUSB0 in the dmesg output, what happens > if you do something like > > tail -f /dev/ttyUSB0? > > These test each of the usual suspects. We are looking for missing USB > drivers, no permission to create a lockfile and no read permission for the > device. > > -- > Trent Jarvi > tjarvi at qbang.org > > > > --------------------------------- > Be a better sports nut! Let your teams follow you with Yahoo Mobile. Try it now. From netbeans at gatworks.com Mon Nov 26 06:53:02 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 26 Nov 2007 08:53:02 -0500 Subject: [Rxtx] #undef TIOCSERGETLSR on LINUX Message-ID: <474ACFBE.5050406@gatworks.com> So I undef'ed the define TIOCSERGETLSR on a linux box, I find that RXTX no longer works . this is a :{ It appears that the sigprocmask( SIG_SETMASK, &newmask, &oldmask ) at src/SerialImp.c:1427 seems to unblock more events than it should. On a linux box there are 2 other events that are blocked, and this code un-sets them, and the thread hangs. It also appears that this code is incomplete. Also, if you only add in the block for SIGCHLD ( which I think is what someone wanted ) , the code will (soon) core-dump ( or silently exit ). So has anyone run with this code ? From tjarvi at qbang.org Mon Nov 26 19:32:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 26 Nov 2007 19:32:54 -0700 (MST) Subject: [Rxtx] #undef TIOCSERGETLSR on LINUX In-Reply-To: <474ACFBE.5050406@gatworks.com> References: <474ACFBE.5050406@gatworks.com> Message-ID: On Mon, 26 Nov 2007, U. George wrote: > So I undef'ed the define TIOCSERGETLSR on a linux box, I find that RXTX > no longer works . this is a :{ > > It appears that the sigprocmask( SIG_SETMASK, &newmask, &oldmask ) at > src/SerialImp.c:1427 seems to unblock more events than it should. On a > linux box there are 2 other events that are blocked, and this code > un-sets them, and the thread hangs. > > It also appears that this code is incomplete. > Also, if you only add in the block for SIGCHLD ( which I think is what > someone wanted ) , the code will (soon) core-dump ( or silently exit ). > > So has anyone run with this code ? Hi George, The case when TIOCSERGETLSR is not defined is currently used on Solaris. Linux has used the TIOCSERGETLSR. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Nov 26 19:56:24 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 26 Nov 2007 21:56:24 -0500 Subject: [Rxtx] #undef TIOCSERGETLSR on LINUX In-Reply-To: References: <474ACFBE.5050406@gatworks.com> Message-ID: <474B8758.6010006@gatworks.com> Technically, with, or without TIOCSERGETLSR it *SHOULD* work the same. Still does not explain the SIGSEGV on the current development code Trent Jarvi wrote: > On Mon, 26 Nov 2007, U. George wrote: > >> So I undef'ed the define TIOCSERGETLSR on a linux box, I find that RXTX >> no longer works . this is a :{ From Joshua.Gerdes at xerox.com Tue Nov 27 16:00:07 2007 From: Joshua.Gerdes at xerox.com (Gerdes, Joshua) Date: Tue, 27 Nov 2007 15:00:07 -0800 Subject: [Rxtx] Trying to use RXTX Message-ID: Hello, I've been using Java for a little while, but am no master. This is my story: I'm trying to write a simple program that will use RXTX to open a serial port on com4, read from it and write to it. I must be doing something wrong because this doesn't seem to be working - I sort of hodge-podged this together from an example that was on the rxtx website. Basically I call the connect method I wrote, that seems to work (no exceptions atleast), I call writeSerial method, and though I don't know for sure if this works it doesn't throw any exceptions, but then I try calling readSerial and never get anything. Can anyone tell me why this isn't working? I must just be doing something flat out wrong. I know that my serial device responds fine when communicated to - I've checked it on a serial terminal. Also, what is considered the end of the input stream? I nabbed this from an example and wonder when the while loop in readSerial will end. /******************************************** * name: readSerial * description: reads from serial port until \0? * arguments: none * returns: read bytes from serial port *******************************************/ private byte [] readSerial() throws IOException{ byte [] buffer = new byte [128]; //read until end of stream. whats considered the end? int len = -1; while ( ( len = serialIn.read(buffer)) > -1 ); return(buffer); } /******************************************** * name: writeSerial * description: writes to serial port until * arguments: String to write * returns: none *******************************************/ private void writeSerial(String data) throws IOException{ byte [] buffer = data.getBytes(); serialOut.write(buffer); } /******************************************** * name: connect * description: opens serial port. * arguments: Com port name * returns: none *******************************************/ void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(9600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE); serialIn = serialPort.getInputStream(); serialOut = serialPort.getOutputStream(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } /******************************************** * name: closeSerial * description: close serial port. * arguments: none * returns: none *******************************************/ private void closeSerial() throws IOException{ serialIn.close(); serialOut.close(); } //some globals private InputStream serialIn; private OutputStream serialOut; -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071127/b9b8cae8/attachment-0001.html From tjarvi at qbang.org Tue Nov 27 21:45:07 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Nov 2007 21:45:07 -0700 (MST) Subject: [Rxtx] Trying to use RXTX In-Reply-To: References: Message-ID: On Tue, 27 Nov 2007, Gerdes, Joshua wrote: > Hello, > > I've been using Java for a little while, but am no master. This is my > story: > > I'm trying to write a simple program that will use RXTX to open a serial > port on com4, read from it and write to it. I must be doing something > wrong because this doesn't seem to be working - I sort of hodge-podged > this together from an example that was on the rxtx website. Basically I > call the connect method I wrote, that seems to work (no exceptions > atleast), I call writeSerial method, and though I don't know for sure if > this works it doesn't throw any exceptions, but then I try calling > readSerial and never get anything. Can anyone tell me why this isn't > working? I must just be doing something flat out wrong. I know that my > serial device responds fine when communicated to - I've checked it on a > serial terminal. Also, what is considered the end of the input stream? I > nabbed this from an example and wonder when the while loop in readSerial > will end. > It is hard to tell for sure without seeing main(). Here are a few hints. Sometimes when you try to communicate with a device, the white space is important. Perhaps the device knows that you are done transmitting a message when it reads a new line. Maybe it is a null character. Maybe you typed the same string into the terminal and then hit not thinking that was a character too. Serial communication can now go 3 Mb/sec with the right hardware but most of use don't have that :). Don't read right after you right. You can look at the bytes available with tha API. You can wait for bytes available events. Give the electrons a running head start if in doubt; they have been doing this since the 1960's and need a break now and then. The exact behavior of read depends upon the timeout and threshold. A 0 timeout and 0 threshold should block. There is no end of to a stream. Some terminals consider control-d the EOF and close. That is always the interesting part of serial communication. Often you end up creating some sort of packet based communication to know when you are done reading. Other times, you eat a byte at a time and make some decision. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 27 22:40:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Nov 2007 22:40:41 -0700 (MST) Subject: [Rxtx] #undef TIOCSERGETLSR on LINUX In-Reply-To: <474B8758.6010006@gatworks.com> References: <474ACFBE.5050406@gatworks.com> <474B8758.6010006@gatworks.com> Message-ID: Hi George, The last time I saw a segv it was related to 64 bit processors and how we stored pointers. Could you describe your system a bit and the serial device being used? I might just make sure I have access to one before the next release. I agree that doing an undef on TIOCSERGETLSR is a good thing to try. But given the afterthought/reaction nature of the ifdefs in rxtx, I would not put it past silly preprocessing mistakes that may be as simple as you don't have a Solaris machine or have a Linux machine and we didn't handle that case right. The ifdefs go both ways there. It is possible to attach gdb to the jvm. HP and IBM have published some info on that that google can find. Usually when rxtx segv's it is so blatant, the eventThread does not even start. I've usually just sprinkled some debug messages then stared at the sillyness. The Linux code should not be hard to figure out with an example system. The w32 issues have been what takes me time to figure out. On Mon, 26 Nov 2007, U. George wrote: > Technically, with, or without TIOCSERGETLSR it *SHOULD* work the same. > Still does not explain the SIGSEGV on the current development code > > Trent Jarvi wrote: >> On Mon, 26 Nov 2007, U. George wrote: >> >>> So I undef'ed the define TIOCSERGETLSR on a linux box, I find that RXTX >>> no longer works . this is a :{ > From keithvz at verizon.net Thu Nov 1 08:08:58 2007 From: keithvz at verizon.net (Keith) Date: Thu, 01 Nov 2007 10:08:58 -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: <4729DDFA.7080206@verizon.net> Trent Jarvi wrote: > 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? Well, I honestly don't know how all this fits together. I think it's just a matter of enabling the right flow control option within the standard serial framework to tell the device driver, "HEY START USING DTR/DSR FOR FLOW CONTROL." If what UGeorge said,(about that type of nitty-gritty lead control being done within the device driver), is true, then this confirms my suspicion. I tried narrowing down within the Linux drivers what you are looking for, but I can't entirely tell wth I'm looking at. (virtual com port drivers -- they are included compiled by default with Ubuntu, source included) http://www.ftdichip.com/Drivers/VCP/Linux/ftdi_sio.tar.gz Hahahaa, they make a reference to DTR flow control being supported but say (UGH) in parenthesis. You can also use their direct device driver library on Ubuntu -- libftd2xx.so.0.4.13. No source code. http://www.ftdichip.com/Drivers/D2XX/Linux/libftd2xx0.4.13.tar.gz In that case, you make a call to their FT_SetFlowControl() function. FT_STATUS FT_SetFlowControl (FT_HANDLE ftHandle, USHORT usFlowControl, UCHAR uXon,UCHAR uXoff) Parameters ftHandle Handle of the device. usFlowControl Must be one of FT_FLOW_NONE, FT_FLOW_RTS_CTS, ****FT_FLOW_DTR_DSR**** or FT_FLOW_XON_XOFF. uXon Character used to signal Xon. Only used if flow control is FT_FLOW_XON_XOFF. uXoff Character used to signal Xoff. Only used if flow control is FT_FLOW_XON_XOFF. This is from their programming guide http://www.ftdichip.com/Documents/ProgramGuides/D2XXPG34.pdf I actually want to take this a step further and say that I think the flow control is actually handled right on the device itself in hardware/firmware. It's enabled through the device driver, but I think the maintaining of buffers, asserting/deasserting of leads, etc is handled by the device. For the time being, I've switched to jd2xx, https://jd2xx.dev.java.net/ and http://bleyer.org/jd2xx/ These are Java wrappers for the device driver libraries. It allows almost direct access to the well-documented device drivers from Java. I hope this helps Keith From tjarvi at qbang.org Thu Nov 1 11:09:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:09:51 -0600 (MDT) 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: Hi Martin, What I usually have done is allow changes that do not impact working software including changes to methods not documented in CommAPI (which remain undocumented in rxtx) and fixes to known problems in the documented portions. That way if you use the documented API, the releases should only become better with time. If you use the undocumented portions, the behavior is not as predictable but open for improvement. On Wed, 31 Oct 2007, 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 >> > From tjarvi at qbang.org Thu Nov 1 11:15:52 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:15:52 -0600 (MDT) 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: I too use rxtx in commercial products. The problem I've been trying to address while bringing the server back was how to make it possible for hobby folks to build the same software as companies so we can move rxtx along a little faster. Exposing internal tools is not an option at this time, the public rxtx builds have been done on my home machine which has drives hanging out of it all over the place dying one at a time. This isn't maintainable. I'm currently looking at the possibility of making an S3 image available on Amazon's EC. These are machines you can rent for ~10 cents an hour which is more than enough to build rxtx. The S3 image is not changed when people use it so everyone has the same starting point. With this, we could all build rxtx for ~20 platforms for a small price and eliminate tool issues. On Wed, 31 Oct 2007, Greg Johnson wrote: > 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 tjarvi at qbang.org Thu Nov 1 11:19:55 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:19:55 -0600 (MDT) 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: On Wed, 31 Oct 2007, 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. I was helping Dmitry do the Mac OS X port without access to a machine when we put that in. In the archives there is information (easily found with google on Apple's site) that describes how their API (and others) can determine if a port is used and ignore it. I think these changes are in CVS but need to confirm. The bottom line is that rxtx should not have used lock files on Mac. It was just ignorance of the system on my part. -- Trent Jarvi tjarvi at qbang.org From fabioanjos at gmail.com Thu Nov 1 12:35:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Thu, 1 Nov 2007 15:35:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Hi, I was using SerialEventListener in my project. But, as was said here, id doesnt work very well with virtual serial ports. So, I changed the strategy using the code posted here in this thread: try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > 0) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } The thing is that in my tests I could notice that in.read(buffer) never blocks. Even when there's nothing to read. Instead of blocking when there's nothing to read it returns 0. So, my questions are: 1. Am I doing something wrong? 2. If not, wouldnt this decrease performance? (the thread would be locked in a loop that does nothing.) 3. Is there a better way to do the job? Thanks in advance!! F?bio -------- On 10/31/07, Andre-John Mas wrote: > > > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/0aee59d0/attachment-0029.html From ajmas at sympatico.ca Thu Nov 1 16:07:55 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Nov 2007 18:07:55 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Message-ID: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From sarah_662005 at yahoo.com Thu Nov 1 17:10:05 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Thu, 1 Nov 2007 16:10:05 -0700 (PDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Message-ID: <351433.37166.qm@web55814.mail.re3.yahoo.com> Thank you very much for your help. Now the application works fine. the serialEvent gets triggered. Rxtx is cool! ----- Original Message ---- From: Andre-John Mas To: Sara Hugh ; RXTX Developers and Users Sent: Wednesday, October 31, 2007 9:55:45 AM Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered 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 __________________________________________________ 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/20071101/4a86bea6/attachment-0029.html From tjarvi at qbang.org Thu Nov 1 17:58:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 17:58:02 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx Message-ID: The rxtx.org site is primarily interested in the hobby aspects of rxtx. Obviously, there are some companies following the work too. These interests bring larger workflows and concerns about details hobby folks may not care about. They also bring many more users. I know the company I work for has a quality engineering effort going on which includes rxtx. While the server was down, I was contacted by another company that was missing the binaries for their testing. Several people have mentioned concerns about a stable release for like reasons. Would there be interest on the quality side of the coin to get together? It could be just sharing email's with each other or a seperate list for QE/QA. I can not say for sure, but we may be able to share some of our efforts/results that could help keep rxtx releases stable. -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Fri Nov 2 01:42:55 2007 From: scldad at sdc.com.au (Stephen Davies) Date: Fri, 2 Nov 2007 18:12:55 +1030 Subject: [Rxtx] Multiple modems Message-ID: <200711021812.56047.scldad@sdc.com.au> This may or may not be related to the Multiple Ports thread. I have an application which uses rxtx on Linux (via cron jobs) to connect multiple modems to remote sensing devices. The application works fine most of the time but occasionally fails to connect if two (or more) connection attempts happen at about the same time. When it fails, it looks as if it may get confused as to which port it is talking to. The app has a "base" component that looks for an available port, opens it and then creates an input thread and an output thread for the connection and data transfer. The "base" component uses this code: // loop round all known ports until one is available. Give up after three minutes Counter ptimeout = new Counter(); while(!portFound && ptimeout.elapsed() < 180000) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // special case. ttyS0 is not available to us on this server. if (!portId.isCurrentlyOwned() && !portId.getName().equals("/dev/ttyS0")) { gLog.debug(lognm + ": Found port " + portId.getName()); try { serialPort = (RXTXPort) portId.open("AguaModem", 10000); } catch (Exception e) { gLog.error(lognm + ": Port " + portId.getName() + " will not open."); gLog.error(e.getMessage()); continue; } AguaModem aguamodem = new AguaModem(); portFound = true; break; } gLog.debug(lognm + ": Port " + portId.getName() + " is busy"); } } } I am wondering about the isCurrentlyOwned method. Does this actually tell me whether a port is currently being used by another process? TIA, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From fabioanjos at gmail.com Fri Nov 2 04:59:58 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 07:59:58 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Message-ID: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/9009eb1d/attachment-0029.html From netbeans at gatworks.com Fri Nov 2 06:28:13 2007 From: netbeans at gatworks.com (U. George) Date: Fri, 02 Nov 2007 08:28:13 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <472B17DD.1050508@gatworks.com> It should normally block ( unless eof / event ) . so its a :{ whats the device ( to recreate if possible ) and how do u open. > My question is, is there a way to make in.read block the thead until > there's something to read? > From fabioanjos at gmail.com Fri Nov 2 06:34:46 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 09:34:46 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > On 11/1/07, Andre-John Mas wrote: > > > > Fabio, > > > > Turns out there was a small error in my example. The test should be: > > > > (numBytes = in.read(buffer)) > -1 > > > > This is because -1 indicates an end of file (end of data stream) > > > > Andre > > > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > > > Hi, > > > > > > I was using SerialEventListener in my project. But, as was said > > > here, id doesnt work very well with virtual serial ports. > > > So, I changed the strategy using the code posted here in this thread: > > > > > > try{ > > > in = port.getInputStream(); > > > out = port.getOutputStream(); > > > int numBytes = 0; > > > while(active){ > > > > > > byte[] buffer = new byte[10]; > > > > > > while ( (numBytes = in.read(buffer)) > 0) > > > { > > > String dataValue = new String(buffer,0,numBytes); > > > processInput(dataValue); > > > } > > > > > > if(numBytes==-1){ > > > break; > > > } > > > > > > Thread.sleep(50); > > > } > > > > > > }catch(IOException e){ > > > logger.info("falha de comunicacao "+ > > > getReceptor().getPort() ); > > > > > > }catch(InterruptedException e){ > > > logger.info ("Interrompendo leitura da porta "+ > > > getReceptor().getPort() ); > > > } > > > > > > The thing is that in my tests I could notice that in.read(buffer) > > > never blocks. Even when there's nothing to read. Instead of blocking > > > when there's nothing to read it returns 0. > > > > > > So, my questions are: > > > > > > 1. Am I doing something wrong? > > > 2. If not, wouldnt this decrease performance? (the thread would be > > > locked in a loop that does nothing.) > > > 3. Is there a better way to do the job? > > > > > > Thanks in advance!! > > > > > > F?bio > > > -------- > > > > > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > > 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 > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > > > > > -- > > > Atenciosamente, > > > F?bio Cristiano dos Anjos > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/5306c4b1/attachment-0029.html From nick.circelli at infrasafe.com Fri Nov 2 07:01:17 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Fri, 2 Nov 2007 08:01:17 -0500 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com><29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com><90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca><29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Message-ID: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> I'm pretty sure that not blocking has to do with you virtual ports. Cause it should block. Maybe you should try: while ((numBytes = in.available()) > 0) { If (numBytes > buffer.length) { numBytes = buffer.length; // in case you have buffer overflow } numBytes = in.read(buffer, 0 , numBytes)); String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } Also, just for optimization, I'd move that byte[] buffer = new byte[10]; out of the while since you don't need to reallocate it every iteration. ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of F?bio Cristiano dos Anjos Sent: Friday, November 02, 2007 8:35 AM To: RXTX Developers and Users Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream (); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas < ajmas at sympatico.ca > wrote: Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info ("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Atenciosamente, F?bio Cristiano dos Anjos -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/4de7f6a3/attachment-0029.html From fabioanjos at gmail.com Fri Nov 2 07:36:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 10:36:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> Message-ID: <29788b250711020636q1588c88fgaa5e27f5504164fb@mail.gmail.com> Hi Nick, Actually, it doesnt block for physical ports too. And, the method avaiable does not block either, so when there's nothing avaiable the loop ends and the thread stops lintening to the port. But I did some more test with serialEventListener, and now its working. I realy dont know what I've done to get it working. I just start woking as soon as I decided to test it again. It was said here that serialEventListener is not reliable for virtual serial ports. Is there another way to read it, without compromising performance? Tanks again!! F?bio ------- On 11/2/07, Nick Circelli wrote: > > I'm pretty sure that not blocking has to do with you virtual ports. > Cause it should block. > > Maybe you should try: > > > > while ((numBytes = in.available()) > 0) > > { > > If (numBytes > buffer.length) { > > numBytes = buffer.length; // in case you have buffer overflow > > } > > numBytes = in.read(buffer, 0 , numBytes)); > > String dataValue = new String(buffer,0,numBytes,"ASCII"); > > processInput(dataValue); > > } > > > > Also, just for optimization, I'd move that byte[] buffer = new > byte[10]; > > out of the while since you don't need to reallocate it every iteration. > > > ------------------------------ > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On Behalf > Of *F?bio Cristiano dos Anjos > *Sent:* Friday, November 02, 2007 8:35 AM > *To:* RXTX Developers and Users > *Subject:* Re: [Rxtx] serialEvent(SerialPortEvent event) never be > triggered > > > > Hi, > > I think i missunderstand something here. > The code you post here was meant to be used inside serialEvent method, > right? > > The think is, that i cannot user SerialEventListener to read serial ports, > because i need to read virual serial ports and id does not behaves well, as > said here before. serialEvent is never triggered. > > So what I quit using SerialEventListener and created a thread to listen to > the port: > > public void run(){ > try{ > in = port.getInputStream(); > out = port.getOutputStream (); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new > String(buffer,0,numBytes,"ASCII"); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ getReceptor().getPort() > ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > } > > > So, the problem is that in.read(buffer) always returns 0 when there is > nothing to read, instead of blocking the flow, and the thread becames locked > in the loop. > > I hope you can help me solve this. > > Thanks in advance! > > F?bio > -------- > > On 11/2/07, *F?bio Cristiano dos Anjos* wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > > > On 11/1/07, *Andre-John Mas* < ajmas at sympatico.ca> wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info ("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/571df6ea/attachment-0028.html From tjarvi at qbang.org Fri Nov 2 08:32:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Nov 2007 08:32:15 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: References: Message-ID: On Fri, 2 Nov 2007, Greg Johnson wrote: > Hi Trent, folks, > Having a single rxtx that is suitable for commercial uses and hobbyists both > would be a great idea? Perhaps it would be worth submitting rxtx as a > proposal to Codehaus - they not only provide excellent tools (Jira (bug > tracker), Confluence (wiki)) but also support build management ( > maestro, continuum, bamboo). Relying on your personal machine (btw, frii.com > / rxtx.org is down again?) seems like a burden you shouldn't have to shoulder > alone. Hi Greg, There may be a little confusion here. There is no need to have two seperate rxtx releases. What I'm trying to encourage is a discussion between some of the people responsible for making sure rxtx does not break their products each release. Usually these people are interested in testing a set of functionality their product depends upon. They do not work with rxtx code but rather traps to catch when rxtx developers break something. This goes on all the time in isolated labs. There are many services that offer to do various pieces of a project for you if you... Anyone is free to do the 'if you' portion with rxtx and see how it goes. I'm actually interested in doing less of that than more. The rxtx.org work I do just happens to overlap with other things I do for personal/family use. The reason I suggest the amazon solution is that anyone can take full control of the environment for a day and it costs less than a package of gum without causing harm to what anyone else is doing. I assume the down question was with respect to a mod_security setting that has been resolved. If not, please post a url to the problem. -- Trent Jarvi tjarvi at qbang.org From nsayer at kfu.com Sat Nov 3 20:17:49 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 19:17:49 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? Message-ID: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Has anyone got RXTX working with an app under Leopard? My app hangs on port open (it works fine with Tiger). The relevant thread looks like this in the activity monitor: 1536 JVM_InvokeMethod 1536 0x48ccd0 1536 0x46f8a0 1536 0x4c3ff4 1536 0x4c4284 1536 0x357d160 1536 0x357faac 1536 Java_gnu_io_RXTXPort_open 1536 open $NOCANCEL$UNIX2003 1536 open $NOCANCEL$UNIX2003 From ajmas at sympatico.ca Sat Nov 3 22:02:04 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 00:02:04 -0400 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> RXTX works for me with Leopard. I am currently using it communicate with a Bluetooth GPS. What computer and device are you trying to use? Is the driver for your serial device compatible with MacOS X 10.5? Andre On 3-Nov-07, at 22:17 , Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From nsayer at kfu.com Sat Nov 3 22:17:47 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 21:17:47 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> Message-ID: <1720F723-3643-438C-B3AB-E09A67536977@kfu.com> On Nov 3, 2007, at 9:02 PM, Andre-John Mas wrote: > RXTX works for me with Leopard. I am currently using it communicate > with a Bluetooth GPS. > > What computer and device are you trying to use? Is the driver for > your serial device compatible with MacOS X 10.5? An Intel mac mini The FTDI USB serial driver an XMPCR, which is just a fancy serial controlled radio and an FTDI usb-to-serial chip I've successfully used the FTDI driver with another FTDI device in another context. > > > Andre > > On 3-Nov-07, at 22:17 , Nick Sayer wrote: > >> Has anyone got RXTX working with an app under Leopard? >> >> My app hangs on port open (it works fine with Tiger). The relevant >> thread looks like this in the activity monitor: >> >> 1536 JVM_InvokeMethod >> 1536 0x48ccd0 >> 1536 0x46f8a0 >> 1536 0x4c3ff4 >> 1536 0x4c4284 >> 1536 0x357d160 >> 1536 0x357faac >> 1536 >> Java_gnu_io_RXTXPort_open >> 1536 open >> $NOCANCEL$UNIX2003 >> 1536 open >> $NOCANCEL$UNIX2003 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From racecar at gmail.com Sat Nov 3 22:25:53 2007 From: racecar at gmail.com (Kevin Mateo Lim) Date: Sat, 3 Nov 2007 21:25:53 -0700 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: Message-ID: I am alternating between two errors. After i run the macosx_setup.command, "everyone" is set to Read only in /var/lock. I notice in the terminal that the group for these perms is _uucp, not uucp. In that state, I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 check_group_uucp(): error testing lock file creation Error details:Permission deniedcheck_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException : Error inside Serial.() at processing.serial.Serial.errorMessage(Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.( Serial.java:102) at Temporary_829_3245.setup(Temporary_829_3245.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java :690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) Then, I hand edit the "everyone" permissions for /var/lock/ to Read and Write (note /var/spool/uucp is Read/Write in all cases, and doesn't change). I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX uucp_lock() /var/lock/LK.003.009.000 is there gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException: Error inside Serial.() at processing.serial.Serial.errorMessage (Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.(Serial.java:102) at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java:690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) See here: http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071103/f1a2c467/attachment-0027.html From greg.johnson at manchester.ac.uk Sun Nov 4 02:31:13 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sun, 4 Nov 2007 10:31:13 +0100 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <28B5E0A0-0802-4C74-AC21-87ED35F3B9A2@manchester.ac.uk> Hi Nick, I also had problems initially with Leopard, but it was resolved by reinstalling the serial USB driver (FTDI in my case). The symptoms were a non-detection of any ports (but I twigged when I tried ZTerm and it had the same problem). Good luck! Cheers, greg PS I did a "Archive and install" which may be the reason my FTDI driver had disappeared - I don't think the driver has changed for 10.5 ------------------------------------------------------------------------- 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 4 Nov 2007, at 03:17, Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Sun Nov 4 13:01:12 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 15:01:12 -0500 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: Message-ID: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Hi, You will need to get the 2.1-8 code from CVS. See the FAQ for more information: http://rxtx.qbang.org/wiki/index.php/FAQ Andre On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > I am alternating between two errors. > > After i run the macosx_setup.command, "everyone" is set to Read only > in /var/lock. I notice in the terminal that the group for these > perms is _uucp, not uucp. > > In that state, I get this error: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > check_group_uucp(): error testing lock file creation Error > details:Permission deniedcheck_lock_status: No permission to create > lock file. > please see: How can I use Lock Files with rxtx? in INSTALL > gnu.io.PortInUseException: Unknown Application > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > java.lang.RuntimeException : Error inside Serial.() > > at processing.serial.Serial.errorMessage(Serial.java:583) > > at processing.serial.Serial.(Serial.java:148) > > at processing.serial.Serial.( Serial.java:102) > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > at processing.core.PApplet.run(PApplet.java:1556) > > at java.lang.Thread.run(Thread.java:613) > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > and Write (note /var/spool/uucp is Read/Write in all cases, and > doesn't change). I get this error: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > gnu.io.PortInUseException: Unknown Application > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > java.lang.RuntimeException: Error inside Serial.() > > at processing.serial.Serial.errorMessage (Serial.java:583) > > at processing.serial.Serial.(Serial.java:148) > > at processing.serial.Serial.(Serial.java:102) > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > at processing.core.PApplet.run(PApplet.java:1556) > > at java.lang.Thread.run(Thread.java:613) > > See here: > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From netbeans at gatworks.com Sun Nov 4 14:33:35 2007 From: netbeans at gatworks.com (U. George) Date: Sun, 04 Nov 2007 16:33:35 -0500 Subject: [Rxtx] #ifndef TIOCSERGETLSR Message-ID: <472E3AAF.7050709@gatworks.com> For Linux, it seems that you need the code for both *having* a TIOCSERGETLSR, and *not having* a TIOCSERGETLSR. Maybe the ioctl exists system wide, but not necessarily for the device driver itself ( always returns -1 ) . Are there systems that have a *functioning* TIOCSERGETLSR for all their devices? Then this would be the case where the "#ifndef TIOCSERGETLSR" directive could be useful is eliminating the unnecessary code and tests. And for those systems that dont have a TIOCSERGETLSR, then the code for TIOCSERGETLSR can be eliminated. It would be a simple case to have, as a foundation, all the code to simulate the missing TIOCSERGETLSR ioctl. If the system does have the ioctl, then that code can be ifdef'd in, and co-exist with the functionality of the code that simulates the missing TIOCSERGETLSR ioctl. From racecar at gmail.com Sun Nov 4 17:30:19 2007 From: racecar at gmail.com (Kevin Mateo Lim) Date: Sun, 4 Nov 2007 17:30:19 -0700 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: the README.OSX reads: Put libSerial.jnilib in the directory of the application (the JavaVM will find it there). Add RXTXComm.jar to the application classpath or include the classes in the application jar. (Some applications already include the RXTX classes in their application jar, in which case only the file libSerial.jnilib is required). I can't find libSerial.jnilib I put librxtxSerial.jnilib into my Processing /libraries/serial/library/ directory. Yet it still sees the old version: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 On 11/4/07, Andre-John Mas wrote: > > Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > 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/20071104/c0a83f91/attachment-0026.html From ajmas at sympatico.ca Sun Nov 4 17:41:47 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 19:41:47 -0500 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> If you are wanting it to be available for all applications, - for all users: /Library/Java/Extensions - for your user: ~/Library/Java/Extensions Or just for your application, then it should be in the same directory from which yo are launching your application. If you are getting the 2.1-8 source, then the library built is called: librxtxSerial.jnilib despite what the docs say. Andre On 4-Nov-07, at 19:30 , Kevin Mateo Lim wrote: > > the README.OSX reads: > Put > libSerial.jnilib > in the directory of the application (the JavaVM will find it there). > Add > RXTXComm.jar > to the application classpath or include the classes in the > application jar. > (Some applications already include the RXTX classes in their > application jar, > in which case only the file libSerial.jnilib is required). > > > I can't find libSerial.jnilib > I put librxtxSerial.jnilib into my Processing /libraries/serial/ > library/ directory. > > Yet it still sees the old version: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > On 11/4/07, Andre-John Mas wrote: Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial .(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay (PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > From bschlining at gmail.com Sun Nov 4 19:46:23 2007 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 4 Nov 2007 18:46:23 -0800 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> Message-ID: > > Or just for your application, then it should be in the same directory > from which yo are launching your application. Just wanted to add one more way of specifying the native lib location... If you don't want to define it globally by putting it in /Library/Java/Extensions (and you don't, it's a very very bad practice) you can also specify the location of the native library when starting the JVM by specifying the 'java.library.path' property. For example: java -Djava.library.path=/Path/To/Directory/With/RXTX/Library YourMainClass -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071104/c5af6980/attachment-0026.html From greg.johnson at manchester.ac.uk Mon Nov 5 01:39:02 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Mon, 5 Nov 2007 09:39:02 +0100 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: The 2.1-8 code reports 2.1-7, hence your (and my) confusion. But as long as you've removed all traces of the old library, it really _is_ 2.1-8. And if you specify the library path to the VM, don't make my mistake (on OSX at least) - you need to respecify the entire library path it had by default, as the command line argument replaces the path, rather than appending to it. 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 5 Nov 2007, at 01:30, Kevin Mateo Lim wrote: > > the README.OSX reads: > Put > libSerial.jnilib > in the directory of the application (the JavaVM will find it there). > Add > RXTXComm.jar > to the application classpath or include the classes in the > application jar. > (Some applications already include the RXTX classes in their > application jar, > in which case only the file libSerial.jnilib is required). > > > I can't find libSerial.jnilib > I put librxtxSerial.jnilib into my Processing /libraries/serial/ > library/ directory. > > Yet it still sees the old version: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > On 11/4/07, Andre-John Mas wrote: > Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial .(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay (PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > 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 HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071105/7f50506d/attachment-0026.html From cyrille.dumont at tatexpress.fr Mon Nov 5 05:46:03 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 05 Nov 2007 13:46:03 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: References: <472727F1.1000704@tatexpress.fr> Message-ID: <472F108B.2090101@tatexpress.fr> Thanks a lot for your solution ... but I'm not a expert in JAVA ... (sorry) For the moment I've this function : """ public void serialEvent(SerialPortEvent e) { StringBuffer inputBuffer = new StringBuffer(); int newData = 0; switch (e.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } //-- Manag. Data from Scanner this.MngDataScanner(inputBuffer.toString()); break; case SerialPortEvent.BI:; //-- Break Received } } """ How can I do what you write ? ( maybe a simple ex ? ) PS : I don't know the PDF417 size (could be, for example, 338 char, or 500 ... ; what I know is that it can't be more than 800 char) Thanks in advance. Best regards. Trent Jarvi a ?crit : > 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 Martin.Oberhuber at windriver.com Mon Nov 5 08:47:50 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 5 Nov 2007 16:47:50 +0100 Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> Hi Trent, are the interestes of hobbyists really so different from commercial ones? Both should be interested in high quality and innovation the like. I haven't seen too many Open Source projects from the "inside" but those that I have seen did not have separate mailing lists for quality/testing/qa versus innovation/development. What I have seen with the Open Source projects that one would call "successful" is a good deal of process around automated builds, automated unit tests, predictable release dates and milestones, and policies around commiting/contributing/reviewing changes. I think that all of these benefit commercial users and hobbyists the like. If you were just asking about who's interested in discussing changes to foster more quality, count me in. I'm just not sure whether discussing these on a separate mailing list or other channel is the right thing to do. Cheers, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From toupsz at cs.tamu.edu Tue Nov 6 14:27:04 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 15:27:04 -0600 Subject: [Rxtx] reading TTL level signals from serial? Message-ID: Dear RXTX community- I've been using RXTX to handle communicating with several hardware devices in Java (a GPS and some custom audio circuitry for my dissertation work). I have a new, high-accuracy GPS which only communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there any way to communicate with this device using RXTX, perhaps by modding the native code for Windows? If so, does anyone have any tips on how to do it? Has it perhaps already been done? Another option is for me to invert / amplify the signal in hardware, but this is difficult for me to pull off due to the sensitivity of the electronics involved...I'll likely end up using a much less accurate piece of equipment rather than go that far! If anyone could help out, I'd really appreciate it! Thanks! -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/b6c59c2b/attachment-0024.html From netbeans at gatworks.com Tue Nov 6 14:55:22 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 06 Nov 2007 16:55:22 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: Message-ID: <4730E2CA.3090009@gatworks.com> This is really a hardware issue. Is there any device ( ie the serial port ) on your computer that will accept the voltage signals ( and load ) that your device produces? Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it happen safely ( ie u dont cook the GPS device ) I have a new, high-accuracy GPS which only > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there > any way to communicate with this device using RXTX, From toupsz at cs.tamu.edu Tue Nov 6 15:14:01 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 16:14:01 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4730E2CA.3090009@gatworks.com> References: <4730E2CA.3090009@gatworks.com> Message-ID: Actually, the device runs over USB, but shows up as a virtual serial port and is outputting these signals. The software that comes with the device (a u-blox ANTARIS 4 eval kit) is able to communicate. RXTX is able to detect and properly configure the port, but does not get any of the data from it. :-/ It seems like there must be some way to do it (obviously, ublox knows how)... -Zach On Nov 6, 2007 3:55 PM, U. George wrote: > This is really a hardware issue. > Is there any device ( ie the serial port ) on your computer that will > accept the voltage signals ( and load ) that your device produces? > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it > happen safely ( ie u dont cook the GPS device ) > > > I have a new, high-accuracy GPS which only > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there > > any way to communicate with this device using RXTX, > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/15ae7a0b/attachment-0024.html From keithvz at verizon.net Tue Nov 6 16:16:55 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 06 Nov 2007 18:16:55 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> Message-ID: <4730F5E7.1030704@verizon.net> Zach Toups wrote: > On Nov 6, 2007 3:55 PM, U. George > wrote: > > This is really a hardware issue. > Is there any device ( ie the serial port ) on your computer that will > accept the voltage signals ( and load ) that your device produces? > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it > happen safely ( ie u dont cook the GPS device ) > > > I have a new, high-accuracy GPS which only > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is > there > > any way to communicate with this device using RXTX, > _______________________________________________ As UGeorge intimated, it's a hardware issue. If your device outputs TTL level voltages, and your USB to serial converter is RS-232, then you've got a physical hardware differences. Inverted leads and voltage issues are mainly the problem. MAXIM makes a neat little chip called the MAX233 (better than the 232, no extern caps required) You can't solve this in software. Now, there are TTL level compatible USB to serial converters available, I happen to be using one right now. This unit below is from a UK company (there might be sources in the US) http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm Parallax makes one that does 3.3 and 5v http://www.parallax.com/detail.asp?product_id=32201 (but only supports RX, TX, GND, AND DTR towards device) (i've tested a variant of the unit above, and it works with RXTX) In both cases, you'll need some creative wiring depending on the interface on your GPS. Hope this helps Keith From toupsz at cs.tamu.edu Tue Nov 6 16:53:01 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 17:53:01 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4730F5E7.1030704@verizon.net> References: <4730E2CA.3090009@gatworks.com> <4730F5E7.1030704@verizon.net> Message-ID: Yeah...I used an FTDI chip to handle USB/serial conversion on the audio equipment I built. I'm leery of trying to build a board for this ublox GPS due to all the grounding/shielding issues around it. Anyway, I apreciate the help...just sad that I can't handle the problem in software! Ublox did send me the source code for their USB drivers...but as a Java programmer, it's a bit tough for me to sort out. ;) Thanks again! -Zach On Nov 6, 2007 5:16 PM, Keith Monahan wrote: > Zach Toups wrote: > > > On Nov 6, 2007 3:55 PM, U. George > > wrote: > > > > This is really a hardware issue. > > Is there any device ( ie the serial port ) on your computer that > will > > accept the voltage signals ( and load ) that your device produces? > > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make > it > > happen safely ( ie u dont cook the GPS device ) > > > > > > I have a new, high-accuracy GPS which only > > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is > > there > > > any way to communicate with this device using RXTX, > > _______________________________________________ > > As UGeorge intimated, it's a hardware issue. > > If your device outputs TTL level voltages, and your USB to serial > converter is RS-232, then you've got a physical hardware differences. > Inverted leads and voltage issues are mainly the problem. MAXIM makes a > neat little chip called the MAX233 (better than the 232, no extern caps > required) > > You can't solve this in software. > > Now, there are TTL level compatible USB to serial converters available, > I happen to be using one right now. > > This unit below is from a UK company (there might be sources in the US) > > http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm > > Parallax makes one that does 3.3 and 5v > > http://www.parallax.com/detail.asp?product_id=32201 > (but only supports RX, TX, GND, AND DTR towards device) > > (i've tested a variant of the unit above, and it works with RXTX) > > In both cases, you'll need some creative wiring depending on the > interface on your GPS. > > Hope this helps > > Keith > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/06e88ad4/attachment-0024.html From netbeans at gatworks.com Tue Nov 6 17:14:01 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 06 Nov 2007 19:14:01 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> <4730F5E7.1030704@verizon.net> Message-ID: <47310349.5000406@gatworks.com> what gps chipset do u have? > Ublox did send me the source code for their USB drivers...but as a Java > programmer, it's a bit tough for me to sort out. ;) From Steffen.DETTMER at ingenico.com Wed Nov 7 03:10:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 7 Nov 2007 11:10:01 +0100 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> Message-ID: <20071107101000.GN10978@elberon.bln.de.ingenico.com> * Zach Toups wrote on Tue, Nov 06, 2007 at 16:14 -0600: > Actually, the device runs over USB, but shows up as a virtual > serial port and is outputting these signals. Ahh, so what you want is to use rxtx on the serial port that is created by the driver and mapped maybe as some COM8 or whatever? I this case then IMHO it would be no hardware question but maybe a problem in your application, or some driver or indeed a rxtx issue. > The software that > comes with the device (a u-blox ANTARIS 4 eval kit) is able to > communicate. Is it sure that this software is really using the virtual serial port and only this port? oki, Steffen -- About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Wed Nov 7 04:59:10 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 06:59:10 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <20071107101000.GN10978@elberon.bln.de.ingenico.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> Message-ID: <4731A88E.6080705@gatworks.com> >> The software that >> comes with the device (a u-blox ANTARIS 4 eval kit) is able to >> communicate. > > Is it sure that this software is really using the virtual serial > port and only this port? > I have tried to read the docs. I have yet to find any explanation on a (windoz) device driver for this device ( the usb device ). That magic is not explained. For a developer thats important magic. Maybe a call to their support team is in order? From netbeans at gatworks.com Wed Nov 7 05:01:38 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 07:01:38 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <20071107101000.GN10978@elberon.bln.de.ingenico.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> Message-ID: <4731A922.7@gatworks.com> Steffen DETTMER wrote: > * Zach Toups wrote on Tue, Nov 06, 2007 at 16:14 -0600: >> Actually, the device runs over USB, but shows up as a virtual BTW: it seems that I am not getting all the Rxtx mail. Is there still a problem? From toupsz at cs.tamu.edu Wed Nov 7 07:36:20 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Wed, 7 Nov 2007 08:36:20 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4731A88E.6080705@gatworks.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> <4731A88E.6080705@gatworks.com> Message-ID: When I emailed them about this issue, they sent me their WinCE drivers, which are apparently based on this open source driver: http://www.yetanotherhomepage.com/j7xx/j7xx.html?/j7xx/software/util/usbdriver.html These include srcdll, and x86 subfolders, though it's not 100% clear to me that these are useful. The ublox communication suite appears to only communicate with serial ports...I've communicated with the ublox on two different comm ports (one with the serial adapter plugged into the serial port, one with the main USB connection), as well as a Garmin bluetooth GPS (which comes up as a bluetooth serial device). I'm not well versed in code this close to the hardware, but it seems to me that if you're running a virtual serial port, then you're virtually controlling the "voltages" that come in on this "port"...so why would they be "ttl level"? :-/ Shouldn't the USB driver be able to interpret the signals in whatever way it wants and just supply software with the binary interpretation? Thanks for all the help, guys, it's really appreciated! -Zach On Nov 7, 2007 5:59 AM, U. George wrote: > > >> The software that > >> comes with the device (a u-blox ANTARIS 4 eval kit) is able to > >> communicate. > > > > Is it sure that this software is really using the virtual serial > > port and only this port? > > > > I have tried to read the docs. I have yet to find any explanation on a > (windoz) device driver for this device ( the usb device ). That magic > is not explained. For a developer thats important magic. Maybe a call > to their support team is in order? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071107/18a13314/attachment-0023.html From netbeans at gatworks.com Wed Nov 7 08:55:55 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 10:55:55 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> <4731A88E.6080705@gatworks.com> Message-ID: <4731E00B.9030902@gatworks.com> There are 2 components to talking to hardware. There is the electrical specification, and then there is the software specification. there is the rs232 specification, parallel port specification, and the USB electrical specification. Generally these are used to plug in the various devices, and hook up electrically. Then there is the software side. There is the device driver, a software component that sits somewhere in the kernel that handles the USB ( in your case ) controller. The device driver generally does not care about the electrical component. There are various chips that handle USB signals, and these chips have I/O addresses so that signals and data can be properly routed. There is also the side that communicates to the user via the COM port device-name. The device driver that you mentioned is for the "Support PL2303 serial chip". This device driver, which hopefully works, handles the USB chip, and eventually recognzes the gps device, and hopefully creates an COM port so the user can open up and communicate. These are a lot of "HOPES". Since u have the web address of the device driver, and developer, I would think that the developer, and any docs, might be better able to help u to first determine if the GPS device is recognized, and the COM port ( maybe its called by another name ) is created, as per documentation. > > These include srcdll, and x86 subfolders, though it's not 100% clear to > me that these are useful. From tjarvi at qbang.org Sat Nov 10 17:46:13 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Nov 2007 17:46:13 -0700 (MST) Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 5 Nov 2007, Oberhuber, Martin wrote: > Hi Trent, > > are the interestes of hobbyists really so different > from commercial ones? Both should be interested in > high quality and innovation the like. > > I haven't seen too many Open Source projects from the > "inside" but those that I have seen did not have > separate mailing lists for quality/testing/qa > versus innovation/development. > > What I have seen with the Open Source projects that > one would call "successful" is a good deal of > process around automated builds, automated unit > tests, predictable release dates and milestones, > and policies around commiting/contributing/reviewing > changes. > > I think that all of these benefit commercial users > and hobbyists the like. > > If you were just asking about who's interested in > discussing changes to foster more quality, count > me in. I'm just not sure whether discussing these > on a separate mailing list or other channel is the > right thing to do. > Hi Martin, There are two issues I'm thinking about. The first is the generic unit testing and quality initiatives required to move rxtx forward. The second is the inevitable fact that rxtx connects to external hardware. The discussion deals with a different set of problems. Here is a simple example of what I'm getting at. We have the capability of setting custom baud rates in rxtx. We may be interested in seeing regressions in rxtx, the C library or the kernel. Some people may be doing some tests with loopback connections. These will always work even if the baud rate is not set to the expected value. Some people may use null modems between two ports. This may be able to catch the problem but not always. Will the build machines be able to test this? (no - for a few reasons) Will people be trying to catch these type of regressions? (yes) What type of coverage does the community have in the end? (?) We could include the discussions in the same list or another equally open list that may be of interest to some folks that deal with these types of problems on a regular basis. -- Trent Jarvi tjarvi at qbang.org From timlow84 at gmail.com Mon Nov 12 00:31:17 2007 From: timlow84 at gmail.com (Timothy Low) Date: Mon, 12 Nov 2007 15:31:17 +0800 Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> Message-ID: <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> ---------- Forwarded message ---------- From: Timothy Low Date: Nov 12, 2007 3:02 PM Subject: Building RXTX From Source To: taj at www.linux.org.uk Cc: ferdinand.tang at tangs.net, Timothy Low , chweehuat.ng at tangs.net Hi Trent, I tried building RXTX from source, and I got this error. I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm trying to get the necessary ".so" files to use for my serial port communication through java. My linux kernal information is: *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 x86_64 x86_64 x86_64 GNU/Linux* I'll most glad if you can provide me some direction on this. Thanks ! ---------------- [root at smsgateway rxtx-2.0-7pre1]# ./configure checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu configure: WARNING: Trying libtool. If the following fails install libtool checking for gcc... gcc checking for C compiler default output... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking for ld used by GCC... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking for a sed that does not truncate output... /bin/sed checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking command to parse /usr/bin/nm -B output... ok checking how to run the C preprocessor... gcc -E checking for egrep... grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for ranlib... ranlib checking for strip... strip checking for objdir... .libs checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.lo... yes checking if gcc supports -fno-rtti -fno-exceptions... yes checking whether the linker (/usr/bin/ld) supports shared libraries... yes checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking dynamic linker characteristics... GNU/Linux ld.so checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no checking whether -lc should be explicitly linked in... no creating libtool checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking for style of include used by make... GNU checking dependency style of gcc... none checking fcntl.h usability... yes checking fcntl.h presence... yes checking for fcntl.h... yes checking sys/fcntl.h usability... yes checking sys/fcntl.h presence... yes checking for sys/fcntl.h... yes checking sys/file.h usability... yes checking sys/file.h presence... yes checking for sys/file.h... yes checking sys/time.h usability... yes checking sys/time.h presence... yes checking for sys/time.h... yes checking sys/signal.h usability... yes checking sys/signal.h presence... yes checking for sys/signal.h... yes checking signal.h usability... yes checking signal.h presence... yes checking for signal.h.. . yes checking termios.h usability... yes checking termios.h presence... yes checking for termios.h... yes checking asm/termbits.h usability... yes checking asm/termbits.h presence... yes checking for asm/termbits.h... yes checking grp.h usability... yes checking grp.h presence... yes checking for grp.h... yes checking pwd.h usability... yes checking pwd.h presence... yes checking for pwd.h... yes checking whether gcc needs -traditional... no checking whether to enable maintainer-specific portions of Makefiles... no /usr/java/jdk1.5.0_13 configure: WARNING: using JAVA_HOME environmental variable adjusted java.home is /usr/java/jdk1.5.0_13 checking os.name Linux checking os.arch i386 checking java.vendor Sun Microsystems Inc. checking java.version 1.5.0_13 checking os.version 2.6.18-8.el5xen comm.jar appears to be installed already. conftest.c: In function 'main': conftest.c:6: warning: incompatible implicit declaration of built-in function 'printf' conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:6: error: (Each undeclared identifier is reported only once conftest.c:6: error: for each function it appears in.) conftest.c:6: error: expected ')' before string constant conftest.c:7: warning: incompatible implicit declaration of built-in function 'exit' ./configure: line 9649: ./conftest: No such file or directory ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected conftest.c: In function 'main': conftest.c:5: warning: incompatible implicit declaration of built-in function 'printf' conftest.c:10: warning: incompatible implicit declaration of built-in function 'exit' configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status : config.h is unchanged config.status: executing depfiles commands [root at smsgateway rxtx-2.0-7pre1]# make install /usr/java/jdk1.5.0_13/bin/javac -classpath .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d /home/jboss/sources/rxtx- 2.0-7pre1/ -O /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java /home/jboss/sources/rxtx-2.0-7pre1/./src/UnSupportedLoggerException.java /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o /home/jboss/sources/rxtx-2.0-7pre1/x86_64-unknown-linux-gnu/SerialImp.lo /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'init_threads': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: cast from pointer to integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_nativeDrain': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: cast to pointer from integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'read_byte_array': /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: cast to pointer from integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_readArray': /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: comparison is always false due to limited range of data type /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_readTerminatedArray': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: comparison is always false due to limited range of data type mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial- 2.0.7pre1.* gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so -o .libs/librxtxSerial-2.0.7pre1.so (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.0.7pre1.so librxtxSerial.so) creating librxtxSerial.la (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la librxtxSerial.la) gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/ParallelImp.lo /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function 'Java_javax_comm_LPRPort_readArray': /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: comparison is always false due to limited range of data type rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* .libs/librxtxParallel-2.0.7pre1.* gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so -o .libs/librxtxParallel- 2.0.7pre1.so (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.0.7pre1.so librxtxParallel.so) creating librxtxParallel.la (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la librxtxParallel.la) make all-am make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' libtool: install: `x86_64-unknown-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 ------------- Regards, Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071112/27758c3c/attachment-0019.html From tjarvi at qbang.org Mon Nov 12 01:02:09 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Nov 2007 01:02:09 -0700 (MST) Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> Message-ID: On Mon, 12 Nov 2007, Timothy Low wrote: > > Hi Trent, Hi Tim, Comments are inline. As I mentioned off the list, rxtx 2.0 is on the edge of deprecation. We can get it working but this is not the path of least resistance for future work. You will probably need to bounce another round of questions off the list. The following is intended to isolate the problem. > > I tried building RXTX from source, and I got this error. > > > I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm trying > to get the necessary ".so" files to use for my serial port communication > through java. > My linux kernal information is: > > *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 x86_64 > x86_64 x86_64 GNU/Linux* > > I'll most glad if you can provide me some direction on this. Thanks ! > > ---------------- > [root at smsgateway rxtx-2.0-7pre1]# ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > checking for C compiler default output... a.out > checking whether the C compiler works... yes > checking whether we are cross compiling... no > checking for suffix of executables... > checking for suffix of object files... o > checking whether we are using the GNU C compiler... yes > checking whether gcc accepts -g... yes > checking for gcc option to accept ANSI C... none needed > checking for ld used by GCC... /usr/bin/ld > checking if the linker (/usr/bin/ld) is GNU ld... yes > checking for /usr/bin/ld option to reload object files... -r > checking for BSD-compatible nm... /usr/bin/nm -B > checking for a sed that does not truncate output... /bin/sed > checking whether ln -s works... yes > checking how to recognise dependent libraries... pass_all > checking command to parse /usr/bin/nm -B output... ok > checking how to run the C preprocessor... gcc -E > checking for egrep... grep -E > checking for ANSI C header files... yes > checking for sys/types.h... yes > checking for sys/stat.h... yes > checking for stdlib.h... yes > checking for string.h... yes > checking for memory.h... yes > checking for strings.h... yes > checking for inttypes.h... yes > checking for stdint.h... yes > checking for unistd.h... yes > checking dlfcn.h usability... yes > checking dlfcn.h presence... yes > checking for dlfcn.h... yes > checking for ranlib... ranlib > checking for strip... strip > checking for objdir... .libs > checking for gcc option to produce PIC... -fPIC > checking if gcc PIC flag -fPIC works... yes > checking if gcc static flag -static works... yes > checking if gcc supports -c -o file.o... yes > checking if gcc supports -c -o file.lo... yes > checking if gcc supports -fno-rtti -fno-exceptions... yes > checking whether the linker (/usr/bin/ld) supports shared libraries... yes > checking how to hardcode library paths into programs... immediate > checking whether stripping libraries is possible... yes > checking dynamic linker characteristics... GNU/Linux ld.so > checking if libtool supports shared libraries... yes > checking whether to build shared libraries... yes > checking whether to build static libraries... no > checking whether -lc should be explicitly linked in... no > creating libtool > checking for a BSD-compatible install... /usr/bin/install -c > checking whether build environment is sane... yes > checking for gawk... gawk > checking whether make sets $(MAKE)... yes > checking for style of include used by make... GNU > checking dependency style of gcc... none > checking fcntl.h usability... yes > checking fcntl.h presence... yes > checking for fcntl.h... yes > checking sys/fcntl.h usability... yes > checking sys/fcntl.h presence... yes > checking for sys/fcntl.h... yes > checking sys/file.h usability... yes > checking sys/file.h presence... yes > checking for sys/file.h... yes > checking sys/time.h usability... yes > checking sys/time.h presence... yes > checking for sys/time.h... yes > checking sys/signal.h usability... yes > checking sys/signal.h presence... yes > checking for sys/signal.h... yes > checking signal.h usability... yes > checking signal.h presence... yes > checking for signal.h.. . yes > checking termios.h usability... yes > checking termios.h presence... yes > checking for termios.h... yes > checking asm/termbits.h usability... yes > checking asm/termbits.h presence... yes > checking for asm/termbits.h... yes > checking grp.h usability... yes > checking grp.h presence... yes > checking for grp.h... yes > checking pwd.h usability... yes > checking pwd.h presence... yes > checking for pwd.h... yes > checking whether gcc needs -traditional... no > checking whether to enable maintainer-specific portions of Makefiles... no > /usr/java/jdk1.5.0_13 > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /usr/java/jdk1.5.0_13 > checking os.name Linux > checking os.arch i386 > checking java.vendor Sun Microsystems Inc. > checking java.version 1.5.0_13 > checking os.version 2.6.18-8.el5xen > comm.jar appears to be installed already. > conftest.c: In function 'main': > conftest.c:6: warning: incompatible implicit declaration of built-in > function 'printf' > conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:6: error: (Each undeclared identifier is reported only once > conftest.c:6: error: for each function it appears in.) > conftest.c:6: error: expected ')' before string constant This is an outdated kernel version check for when headers and kernels could cause problems for rxtx. If we made it past this, then you are OK. > conftest.c:7: warning: incompatible implicit declaration of built-in > function 'exit' > ./configure: line 9649: ./conftest: No such file or directory > ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected It blew up but continues.. > conftest.c: In function 'main': > conftest.c:5: warning: incompatible implicit declaration of built-in > function 'printf' > conftest.c:10: warning: incompatible implicit declaration of built-in > function 'exit' > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status : config.h is unchanged > config.status: executing depfiles commands > [root at smsgateway rxtx-2.0-7pre1]# make install > /usr/java/jdk1.5.0_13/bin/javac -classpath > .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d > /home/jboss/sources/rxtx- 2.0-7pre1/ -O > /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java > /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/UnSupportedLoggerException.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java > Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or > overrides a deprecated API. > Note: Recompile with -Xlint:deprecation for details. > /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* The java jar should be fine now. You may need to change the source files as mentioned below. > gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. > -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g > -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o > /home/jboss/sources/rxtx-2.0-7pre1/x86_64-unknown-linux-gnu/SerialImp.lo > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'init_threads': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: cast > from pointer to integer of different size > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_nativeDrain': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: cast to > pointer from integer of different size > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'read_byte_array': > /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: cast to > pointer from integer of different size As I recall, this was caused by pointers (now 64 bit rather than 32 bit) being stored in java ints (jints). I would look at the diff between the CVS 2.1 SerialImp.c and RXTXPort.java files against 2.0. We did fix those issues. You have a .so file but the different pointer sizes will cause runtime errors. > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_readArray': > /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: > comparison is always false due to limited range of data type > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_readTerminatedArray': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: > comparison is always false due to limited range of data type > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial- > 2.0.7pre1.* > gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so -o > .libs/librxtxSerial-2.0.7pre1.so > (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.0.7pre1.so > librxtxSerial.so) > creating librxtxSerial.la > (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la > librxtxSerial.la) > gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. > -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g > -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o > /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/ParallelImp.lo > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function > 'Java_javax_comm_LPRPort_readArray': > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: > comparison is always false due to limited range of data type > rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* > .libs/librxtxParallel-2.0.7pre1.* > gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so -o > .libs/librxtxParallel- 2.0.7pre1.so > (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.0.7pre1.so > librxtxParallel.so) > creating librxtxParallel.la > (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la > librxtxParallel.la) > make all-am > make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' > make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' > libtool: install: `x86_64-unknown-linux-gnu' must be an absolute directory > name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 A libtool change? Assuming you ran configure && make install in /home/jboss/sources/rxtx- 2.0-7pre1, libtool is looking for /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/.libs/librxtxSerial-2.0.7pre1.so. I think you have this? The file is just being copied to ~JAVA/jre/lib/$(JAVA_ARCH). -- Trent Jarvi tjarvi at qbang.org From sarah_662005 at yahoo.com Mon Nov 12 16:10:28 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Mon, 12 Nov 2007 15:10:28 -0800 (PST) Subject: [Rxtx] [urgent] device's power off detection Message-ID: <766782.10076.qm@web55803.mail.re3.yahoo.com> Hello all, I have a small application built on top of rxtx api. This application can retrieve the incoming data from a device through a port. The device can be powered off after the port get closed from the application. I have been trying a couple of hours to find a way to detect the power switching from device. If anyone knows how to handle it through rxtx, could you please give me a help? Thank you very much. r, Sara ____________________________________________________________________________________ Get easy, one-click access to your favorites. Make Yahoo! your homepage. http://www.yahoo.com/r/hs -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071112/4599f3ec/attachment-0018.html From netbeans at gatworks.com Mon Nov 12 17:52:22 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 12 Nov 2007 19:52:22 -0500 Subject: [Rxtx] [urgent] device's power off detection In-Reply-To: <766782.10076.qm@web55803.mail.re3.yahoo.com> References: <766782.10076.qm@web55803.mail.re3.yahoo.com> Message-ID: <4738F546.5010101@gatworks.com> Not sure what u are asking for. Are u asking for a way to detect if the device is OFF? Are u asking how to power off the device - via software ? Is it a Serial device? is it a parallel device? is it a usb device? Sara Hugh wrote: > Hello all, > I have a small application built on top of rxtx api. This application > can retrieve the incoming data from a device through a port. The device > can be powered off after the port get closed from the application. I > have been trying a couple of hours to find a way to detect the power > switching from device. If anyone knows how to handle it through rxtx, > could you please give me a help? Thank you very much. From tjarvi at qbang.org Mon Nov 12 22:48:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Nov 2007 22:48:11 -0700 (MST) Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711120225x562db8cbxb750767ade3b0d73@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> <900c6ba90711120031p66edc001ted76f7ba24e34b98@mail.gmail.com> <900c6ba90711120225x562db8cbxb750767ade3b0d73@mail.gmail.com> Message-ID: Hi Tim, The gnu.io namespace looks just like the javax.comm 2.0 namespace. There are additional (discouraged) undocumented methods in gnu.io that you need not use. We just used the different namespace to avoid poluting Sun's by mistake and to make sure we stayed off any potential licensing related radar. Usuaully, you just change your imports and make sure you do not use the javax.comm namespace for anything like exception handling. As I mentioned off the list, there are no issues with rxtx going through the JSR process to be more Sun friendly other than time. rxtx has no hidden intentions there; anything that does not work like CommAPI 2.0 documented is a bug. The reason we do not support CommAPI 2.1 is technical in nature and is in the list archives as well as the front page of www.rxtx.org. On Mon, 12 Nov 2007, Timothy Low wrote: > Hi Trent, > > I'll move to use a JDK1.5 64-bit version... but do I need to make any source > code changes to use the package (gnu.io) in the RTXTcomm.jar instead of the > ones from the javacomm api ? > > > Regards, > Tim > > On Nov 12, 2007 5:22 PM, Trent Jarvi wrote: > >> >> Hi Tim, >> >> I see a couple things here. >> >> First your jdk is for i686 yet the library is compiled on a x86_64 >> machine. You may try passing configure the --target=i686-unknown-linux to >> try using the i686 backend to gcc if it is available. Or move to the 64 >> bit jdk. >> >> The other error I see is again the moved UTF_RELEASE define that we need >> to fix. You can probably get around that with: >> >> make -DUTF_RELEASE=`uname -r` >> >> even more simple would be to just specify the serial library which should >> be in configure --help. >> >> You can remove the UTF_RELEASE check from configure by editing >> configure.in, searching for the simple C program check and deleting it. >> Running autoconf after that will regenerate a new configure without the >> check. >> >> Note that you should remove the previous native libraries >> (librxtxSerial.so) when moving from rxtx 2.0 to 2.1. These are compiled >> for different namespaces (javax.comm/gnu.io). >> >> On Mon, 12 Nov 2007, Timothy Low wrote: >> >>> *Hi Trent, >>> >>> I moved on to rxtx 2.1.7r2, and updated my jre to 1.6.0 (64-bit)... I >> tried >>> the following 2 methods: >>> >>> (1) using the rxtx 2.1.7 binaries from the RXTX website* >>> *Are these binaries suitable for a 64-bit OS ? There mentioning of the >>> gnu.io that you've talked about previously...* >>> ------ >>> [root at smsgateway sources]# java -Djava.library.path=/usr/lib PortLister >>> Experimental: JNI_OnLoad called. >>> >>> java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion >>> ()Ljava/lang/String; >>> at gnu.io.RXTXCommDriver.nativeGetVersion(Native Method) >>> at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:85) >>> at java.lang.Class.forName0(Native Method) >>> at java.lang.Class.forName(Unknown Source) >>> at javax.comm.CommPortIdentifier.loadDriver( >> CommPortIdentifier.java >>> :237) >>> at javax.comm.CommPortIdentifier.(CommPortIdentifier.java >>> :109) >>> at PortLister.(PortLister.java:6) >>> at PortLister.main(PortLister.java:25) >>> Exception in thread "main" java.lang.UnsatisfiedLinkError: >>> com.sun.comm.SunrayInfo.isSessionActive()Z >>> at com.sun.comm.SunrayInfo.isSessionActive(Native Method) >>> at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java >> :155) >>> at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java >>> :100) >>> at javax.comm.CommPortIdentifier.(CommPortIdentifier.java >>> :138) >>> at PortLister.(PortLister.java:6) >>> at PortLister.main(PortLister.java:25) >>> >>> ------ >>> >>> (2) compiling the rxtx 2.1.7 from source >>> *but i got the following error while running ./configure and make all* >>> >>> ------ >>> [root at smsgateway rxtx-2.1-7r2]# ./configure >>> checking build system type... x86_64-unknown-linux-gnu >>> checking host system type... x86_64-unknown-linux-gnu >>> checking target system type... x86_64-unknown-linux-gnu >>> configure: WARNING: Trying libtool. If the following fails install >> libtool >>> checking for gcc... gcc >>> checking for C compiler default output file name... a.out >>> checking whether the C compiler works... yes >>> checking whether we are cross compiling... no >>> checking for suffix of executables... >>> checking for suffix of object files... o >>> checking whether we are using the GNU C compiler... yes >>> checking whether gcc accepts -g... yes >>> checking for gcc option to accept ANSI C... none needed >>> checking for a sed that does not truncate output... /bin/sed >>> checking for egrep... grep -E >>> checking for ld used by gcc... /usr/bin/ld >>> checking if the linker (/usr/bin/ld) is GNU ld... yes >>> checking for /usr/bin/ld option to reload object files... -r >>> checking for BSD-compatible nm... /usr/bin/nm -B >>> checking whether ln -s works... yes >>> checking how to recognise dependent libraries... pass_all >>> checking how to run the C preprocessor... gcc -E >>> checking for ANSI C header files... yes >>> checking for sys/types.h... yes >>> checking for sys/stat.h... yes >>> checking for stdlib.h... yes >>> checking for string.h... yes >>> checking for memory.h... yes >>> checking for strings.h... yes >>> checking for inttypes.h... yes >>> checking for stdint.h... yes >>> checking for unistd.h... yes >>> checking dlfcn.h usability... yes >>> checking dlfcn.h presence... yes >>> checking for dlfcn.h... yes >>> checking for g++... g++ >>> checking whether we are using the GNU C++ compiler... yes >>> checking whether g++ accepts -g... yes >>> checking how to run the C++ preprocessor... g++ -E >>> checking for g77... no >>> checking for f77... no >>> checking for xlf... no >>> checking for frt... no >>> checking for pgf77... no >>> checking for fort77... no >>> checking for fl32... no >>> checking for af77... no >>> checking for f90... no >>> checking for xlf90... no >>> checking for pgf90... no >>> checking for epcf90... no >>> checking for f95... f95 >>> checking whether we are using the GNU Fortran 77 compiler... yes >>> checking whether f95 accepts -g... yes >>> checking the maximum length of command line arguments... 32768 >>> checking command to parse /usr/bin/nm -B output from gcc object... ok >>> checking for objdir... .libs >>> checking for ar... ar >>> checking for ranlib... ranlib >>> checking for strip... strip >>> checking if gcc static flag works... yes >>> checking if gcc supports -fno-rtti -fno-exceptions... no >>> checking for gcc option to produce PIC... -fPIC >>> checking if gcc PIC flag -fPIC works... yes >>> checking if gcc supports -c -o file.o... yes >>> checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking whether -lc should be explicitly linked in... no >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> checking if libtool supports shared libraries... yes >>> checking whether to build shared libraries... yes >>> checking whether to build static libraries... no >>> configure: creating libtool >>> appending configuration tag "CXX" to libtool >>> checking for ld used by g++... /usr/bin/ld -m elf_x86_64 >>> checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes >>> checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking for g++ option to produce PIC... -fPIC >>> checking if g++ PIC flag -fPIC works... yes >>> checking if g++ supports -c -o file.o... yes >>> checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> appending configuration tag "F77" to libtool >>> checking if libtool supports shared libraries... yes >>> checking whether to build shared libraries... yes >>> checking whether to build static libraries... no >>> checking for f95 option to produce PIC... -fPIC >>> checking if f95 PIC flag -fPIC works... yes >>> checking if f95 supports -c -o file.o... yes >>> checking whether the f95 linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> checking for a BSD-compatible install... /usr/bin/install -c >>> checking whether build environment is sane... yes >>> checking for gawk... gawk >>> checking whether make sets $(MAKE)... yes >>> checking for style of include used by make... GNU >>> checking dependency style of gcc... none >>> checking dependency style of g++... none >>> checking fcntl.h usability... yes >>> checking fcntl.h presence... yes >>> checking for fcntl.h... yes >>> checking sys/fcntl.h usability... yes >>> checking sys/fcntl.h presence... yes >>> checking for sys/fcntl.h... yes >>> checking sys/file.h usability... yes >>> checking sys/file.h presence... yes >>> checking for sys/file.h... yes >>> checking sys/time.h usability... yes >>> checking sys/time.h presence... yes >>> checking for sys/time.h... yes >>> checking sys/signal.h usability... yes >>> checking sys/signal.h presence... yes >>> checking for sys/signal.h... yes >>> checking signal.h usability... yes >>> checking signal.h presence... yes >>> checking for signal.h... yes >>> checking termios.h usability... yes >>> checking termios.h presence... yes >>> checking for termios.h... yes >>> checking grp.h usability... yes >>> checking grp.h presence... yes >>> checking for grp.h... yes >>> checking pwd.h usability... yes >>> checking pwd.h presence... yes >>> checking for pwd.h... yes >>> checking whether gcc needs -traditional... no >>> checking whether to enable maintainer-specific portions of Makefiles... >> no >>> /usr/java/jdk1.5.0_13 >>> configure: WARNING: using JAVA_HOME environmental variable >>> adjusted java.home is /usr/java/jdk1.5.0_13 >>> checking os.name Linux >>> checking os.arch i386 >>> checking java.vendor Sun Microsystems Inc. >>> checking java.version 1.5.0_13 >>> checking os.version 2.6.18-8.el5xen >>> conftest.c: In function 'main': >>> conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this >> function) >>> conftest.c:8: error: (Each undeclared identifier is reported only once >>> conftest.c:8: error: for each function it appears in.) >>> conftest.c:8: error: expected ')' before string constant >>> ./configure: line 21462: ./conftest: No such file or directory >>> ./configure: line 21462: test: 2.6.18-8.el5xen: unary operator expected >>> configure: creating ./config.status >>> config.status: creating Makefile >>> config.status: creating config.h >>> config.status: executing depfiles commands >>> [root at smsgateway rxtx-2.1-7r2]# make install >>> /usr/java/jdk1.5.0_13/bin/javac -classpath .:/home/jboss/sources/rxtx- >>> >> 2.1-7r2:/home/jboss/sources/rxtx-2.1-7r2/src:/usr/java/jdk1.5.0_13/jre/lib/ext/RXTXcomm.jar-d >>> /home/jboss/sources/rxtx- >>> 2.1-7r2/ -O -source 1.3 -target 1.3 >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommDriver.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortEnumerator.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortIdentifier.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortOwnershipListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Configure.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2C.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/I2CPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/LPRPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/NoSuchPortException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/PortInUseException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Raw.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/RawPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RawPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RawPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/RS485PortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485PortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485Port.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXCommDriver.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXVersion.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPort.java >>> /home/jboss/sources/rxtx-2.1-7r2 >> /./src/UnsupportedCommOperationException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/UnSupportedLoggerException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Zystem.java >>> /usr/java/jdk1.5.0_13/bin/javah -classpath .:/home/jboss/sources/rxtx- >>> >> 2.1-7r2:/home/jboss/sources/rxtx-2.1-7r2/src:/usr/java/jdk1.5.0_13/jre/lib/ext/RXTXcomm.jar-d >>> x86_64-unknown-linux-gnu -jni `(for i in CommDriver CommPortEnumerator >>> CommPortIdentifier CommPort CommPortOwnershipListener Configure I2C >>> I2CPortEvent I2CPortEventListener I2CPort LPRPort NoSuchPortException >>> ParallelPortEvent ParallelPortEventListener ParallelPort >> PortInUseException >>> Raw RawPortEvent RawPortEventListener RawPort RS485 RS485PortEvent >>> RS485PortEventListener RS485Port RXTXCommDriver RXTXPort RXTXVersion >>> SerialPortEvent SerialPortEventListener SerialPort >>> UnsupportedCommOperationException UnSupportedLoggerException Zystem;do \ >>> if grep > /dev/null native.*\( /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/$i.java; then \ >>> echo gnu.io.$i; \ >>> fi; \ >>> done)` >>> /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialImp.c -o >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo; >>> \ >>> if [ "Serial" = "Serial" ]; >>> then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxSerial.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxSerial.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo; >> \ >>> fi; \ >>> ) >>> mkdir /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/.libs >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/SerialImp.o >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/fuserImp.o >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c: In function >> 'show_user': >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c:238: warning: cast >> from >>> pointer to integer of different size >>> gcc -shared /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/SerialImp.o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/fuserImp.o >>> -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7.so -o >> .libs/librxtxSerial- >>> 2.1-7.so >>> (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.1-7.so >>> librxtxSerial.so) >>> creating librxtxSerial.la >>> (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la >>> librxtxSerial.la) >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelImp.c -o >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/ParallelImp.lo; >>> \ >>> if [ "Parallel" = "Serial" ]; >>> then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxParallel.la -rpath >>> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/ParallelImp.lo >>> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxParallel.la -rpath >>> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/ParallelImp.lo; >>> \ >>> fi; \ >>> ) >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >>> /x86_64-unknown-linux-gnu/.libs/ParallelImp.o >>> gcc -shared /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/ParallelImp.o >>> -lpthread -Wl,-soname -Wl,librxtxParallel-2.1-7.so -o >>> .libs/librxtxParallel-2.1-7.so >>> (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.1-7.so >>> librxtxParallel.so) >>> creating librxtxParallel.la >>> (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la >>> librxtxParallel.la) >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo; >>> \ >>> if [ "I2C" = "Serial" ]; then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxI2C.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo >>> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxI2C.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo; >>> \ >>> fi; \ >>> ) >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/.libs/I2CImp.o >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c: In function >>> 'Java_gnu_io_I2CPort_Initialize': >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: 'UTS_RELEASE' >>> undeclared (first use in this function) >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: (Each >> undeclared >>> identifier is reported only once >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: for each >> function >>> it appears in.) >>> libtool: link: `/home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/I2CImp.lo' >>> is not a valid libtool object >>> make: *** [x86_64-unknown-linux-gnu/librxtxI2C.la] Error 1 >>> >>> ------ >>> >>> >>> >>> On Nov 12, 2007 4:02 PM, Trent Jarvi wrote: >>> >>>> On Mon, 12 Nov 2007, Timothy Low wrote: >>>>> >>>>> Hi Trent, >>>> >>>> Hi Tim, >>>> >>>> Comments are inline. As I mentioned off the list, rxtx 2.0 is on the >> edge >>>> of deprecation. We can get it working but this is not the path of >> least >>>> resistance for future work. >>>> >>>> You will probably need to bounce another round of questions off the >> list. >>>> The following is intended to isolate the problem. >>>> >>>>> >>>>> I tried building RXTX from source, and I got this error. >>>>> >>>>> >>>>> I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm >>>> trying >>>>> to get the necessary ".so" files to use for my serial port >> communication >>>>> through java. >>>>> My linux kernal information is: >>>>> >>>>> *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 >>>> x86_64 >>>>> x86_64 x86_64 GNU/Linux* >>>>> >>>>> I'll most glad if you can provide me some direction on this. Thanks ! >>>>> >>>>> ---------------- >>>>> [root at smsgateway rxtx-2.0-7pre1]# ./configure >>>>> checking build system type... x86_64-unknown-linux-gnu >>>>> checking host system type... x86_64-unknown-linux-gnu >>>>> checking target system type... x86_64-unknown-linux-gnu >>>>> configure: WARNING: Trying libtool. If the following fails install >>>> libtool >>>>> checking for gcc... gcc >>>>> checking for C compiler default output... a.out >>>>> checking whether the C compiler works... yes >>>>> checking whether we are cross compiling... no >>>>> checking for suffix of executables... >>>>> checking for suffix of object files... o >>>>> checking whether we are using the GNU C compiler... yes >>>>> checking whether gcc accepts -g... yes >>>>> checking for gcc option to accept ANSI C... none needed >>>>> checking for ld used by GCC... /usr/bin/ld >>>>> checking if the linker (/usr/bin/ld) is GNU ld... yes >>>>> checking for /usr/bin/ld option to reload object files... -r >>>>> checking for BSD-compatible nm... /usr/bin/nm -B >>>>> checking for a sed that does not truncate output... /bin/sed >>>>> checking whether ln -s works... yes >>>>> checking how to recognise dependent libraries... pass_all >>>>> checking command to parse /usr/bin/nm -B output... ok >>>>> checking how to run the C preprocessor... gcc -E >>>>> checking for egrep... grep -E >>>>> checking for ANSI C header files... yes >>>>> checking for sys/types.h... yes >>>>> checking for sys/stat.h... yes >>>>> checking for stdlib.h... yes >>>>> checking for string.h... yes >>>>> checking for memory.h... yes >>>>> checking for strings.h... yes >>>>> checking for inttypes.h... yes >>>>> checking for stdint.h... yes >>>>> checking for unistd.h... yes >>>>> checking dlfcn.h usability... yes >>>>> checking dlfcn.h presence... yes >>>>> checking for dlfcn.h... yes >>>>> checking for ranlib... ranlib >>>>> checking for strip... strip >>>>> checking for objdir... .libs >>>>> checking for gcc option to produce PIC... -fPIC >>>>> checking if gcc PIC flag -fPIC works... yes >>>>> checking if gcc static flag -static works... yes >>>>> checking if gcc supports -c -o file.o... yes >>>>> checking if gcc supports -c -o file.lo... yes >>>>> checking if gcc supports -fno-rtti -fno-exceptions... yes >>>>> checking whether the linker (/usr/bin/ld) supports shared libraries... >>>> yes >>>>> checking how to hardcode library paths into programs... immediate >>>>> checking whether stripping libraries is possible... yes >>>>> checking dynamic linker characteristics... GNU/Linux ld.so >>>>> checking if libtool supports shared libraries... yes >>>>> checking whether to build shared libraries... yes >>>>> checking whether to build static libraries... no >>>>> checking whether -lc should be explicitly linked in... no >>>>> creating libtool >>>>> checking for a BSD-compatible install... /usr/bin/install -c >>>>> checking whether build environment is sane... yes >>>>> checking for gawk... gawk >>>>> checking whether make sets $(MAKE)... yes >>>>> checking for style of include used by make... GNU >>>>> checking dependency style of gcc... none >>>>> checking fcntl.h usability... yes >>>>> checking fcntl.h presence... yes >>>>> checking for fcntl.h... yes >>>>> checking sys/fcntl.h usability... yes >>>>> checking sys/fcntl.h presence... yes >>>>> checking for sys/fcntl.h... yes >>>>> checking sys/file.h usability... yes >>>>> checking sys/file.h presence... yes >>>>> checking for sys/file.h... yes >>>>> checking sys/time.h usability... yes >>>>> checking sys/time.h presence... yes >>>>> checking for sys/time.h... yes >>>>> checking sys/signal.h usability... yes >>>>> checking sys/signal.h presence... yes >>>>> checking for sys/signal.h... yes >>>>> checking signal.h usability... yes >>>>> checking signal.h presence... yes >>>>> checking for signal.h.. . yes >>>>> checking termios.h usability... yes >>>>> checking termios.h presence... yes >>>>> checking for termios.h... yes >>>>> checking asm/termbits.h usability... yes >>>>> checking asm/termbits.h presence... yes >>>>> checking for asm/termbits.h... yes >>>>> checking grp.h usability... yes >>>>> checking grp.h presence... yes >>>>> checking for grp.h... yes >>>>> checking pwd.h usability... yes >>>>> checking pwd.h presence... yes >>>>> checking for pwd.h... yes >>>>> checking whether gcc needs -traditional... no >>>>> checking whether to enable maintainer-specific portions of >> Makefiles... >>>> no >>>>> /usr/java/jdk1.5.0_13 >>>>> configure: WARNING: using JAVA_HOME environmental variable >>>>> adjusted java.home is /usr/java/jdk1.5.0_13 >>>>> checking os.name Linux >>>>> checking os.arch i386 >>>>> checking java.vendor Sun Microsystems Inc. >>>>> checking java.version 1.5.0_13 >>>>> checking os.version 2.6.18-8.el5xen >>>>> comm.jar appears to be installed already. >>>>> conftest.c: In function 'main': >>>>> conftest.c:6: warning: incompatible implicit declaration of built-in >>>>> function 'printf' >>>>> conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this >>>> function) >>>>> conftest.c:6: error: (Each undeclared identifier is reported only once >>>>> conftest.c:6: error: for each function it appears in.) >>>>> conftest.c:6: error: expected ')' before string constant >>>> >>>> >>>> This is an outdated kernel version check for when headers and kernels >>>> could cause problems for rxtx. If we made it past this, then you are >> OK. >>>> >>>> >>>>> conftest.c:7: warning: incompatible implicit declaration of built-in >>>>> function 'exit' >>>>> ./configure: line 9649: ./conftest: No such file or directory >>>>> ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected >>>> >>>> It blew up but continues.. >>>> >>>>> conftest.c: In function 'main': >>>>> conftest.c:5: warning: incompatible implicit declaration of built-in >>>>> function 'printf' >>>>> conftest.c:10: warning: incompatible implicit declaration of built-in >>>>> function 'exit' >>>>> configure: creating ./config.status >>>>> config.status: creating Makefile >>>>> config.status: creating config.h >>>>> config.status : config.h is unchanged >>>>> config.status: executing depfiles commands >>>>> [root at smsgateway rxtx-2.0-7pre1]# make install >>>>> /usr/java/jdk1.5.0_13/bin/javac -classpath >>>>> .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/ -O >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1 >> /./src/UnSupportedLoggerException.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java >>>>> Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or >>>>> overrides a deprecated API. >>>>> Note: Recompile with -Xlint:deprecation for details. >>>>> /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* >>>> >>>> >>>> The java jar should be fine now. You may need to change the source >> files >>>> as mentioned below. >>>> >>>>> gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu >> -I. >>>>> -I/usr/java/jdk1.5.0_13/include >> -I/usr/java/jdk1.5.0_13/include/./linux/ >>>> -g >>>>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o >>>>> /home/jboss/sources/rxtx-2.0-7pre1 >> /x86_64-unknown-linux-gnu/SerialImp.lo >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'init_threads': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: >>>> cast >>>>> from pointer to integer of different size >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_nativeDrain': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: >>>> cast to >>>>> pointer from integer of different size >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'read_byte_array': >>>>> /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: >>>> cast to >>>>> pointer from integer of different size >>>> >>>> >>>> As I recall, this was caused by pointers (now 64 bit rather than 32 >> bit) >>>> being stored in java ints (jints). I would look at the diff between >> the >>>> CVS 2.1 SerialImp.c and RXTXPort.java files against 2.0. We >>>> did fix those issues. >>>> >>>> You have a .so file but the different pointer sizes will cause runtime >>>> errors. >>>> >>>> >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_readArray': >>>>> /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: >>>>> comparison is always false due to limited range of data type >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_readTerminatedArray': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: >>>>> comparison is always false due to limited range of data type >>>>> mkdir .libs >>>>> rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* >> .libs/librxtxSerial- >>>>> 2.0.7pre1.* >>>>> gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so-o >>>>> .libs/librxtxSerial-2.0.7pre1.so >>>>> (cd .libs && rm -f librxtxSerial.so && ln -s >> librxtxSerial-2.0.7pre1.so >>>>> librxtxSerial.so) >>>>> creating librxtxSerial.la >>>>> (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la >>>>> librxtxSerial.la) >>>>> gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu >> -I. >>>>> -I/usr/java/jdk1.5.0_13/include >> -I/usr/java/jdk1.5.0_13/include/./linux/ >>>> -g >>>>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o >>>>> /home/jboss/sources/rxtx- 2.0-7pre1 >>>> /x86_64-unknown-linux-gnu/ParallelImp.lo >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function >>>>> 'Java_javax_comm_LPRPort_readArray': >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: >>>>> comparison is always false due to limited range of data type >>>>> rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* >>>>> .libs/librxtxParallel-2.0.7pre1.* >>>>> gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so-o >>>>> .libs/librxtxParallel- 2.0.7pre1.so >>>>> (cd .libs && rm -f librxtxParallel.so && ln -s >>>> librxtxParallel-2.0.7pre1.so >>>>> librxtxParallel.so) >>>>> creating librxtxParallel.la >>>>> (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la >>>>> librxtxParallel.la) >>>>> make all-am >>>>> make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' >>>>> make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' >>>>> libtool: install: `x86_64-unknown-linux-gnu' must be an absolute >>>> directory >>>>> name >>>>> Try `libtool --help --mode=install' for more information. >>>>> make: *** [install] Error 1 >>>> >>>> A libtool change? Assuming you ran configure && make install in >>>> /home/jboss/sources/rxtx- 2.0-7pre1, libtool is looking for >>>> /home/jboss/sources/rxtx- >>>> 2.0-7pre1/x86_64-unknown-linux-gnu/.libs/librxtxSerial-2.0.7pre1.so. >>>> >>>> I think you have this? The file is just being copied to >>>> ~JAVA/jre/lib/$(JAVA_ARCH). >>>> >>>> -- >>>> Trent Jarvi >>>> tjarvi at qbang.org >>>> >>> >> > From guido.vogt at celsi.ch Tue Nov 13 00:28:01 2007 From: guido.vogt at celsi.ch (Guido Vogt) Date: Tue, 13 Nov 2007 08:28:01 +0100 Subject: [Rxtx] RTS Line can't be set Message-ID: <47395201.1050400@celsi.ch> I'm working on an Windows XP /SP2 System. Version of RXTX: 2.1.7. The serial line is connected to a modem. As I can see, the RTS-Line of the serial Port is inactive, when the port is opened (flowcontrol=none). Obviously, no data is coming from the modem. If I use the setRTS(true) command after open, the comport does not send out my data any more. This behaviour is regardless of flowcontrol. Anybody has an idea what do do? Thanks for help. From Martin.Oberhuber at windriver.com Tue Nov 13 08:58:23 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 13 Nov 2007 16:58:23 +0100 Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803880918@ism-mail03.corp.ad.wrs.com> Hi Trent, as said before, I like the idea of discussing such quality engineering issues, but why hide these away from the rest of the public? Anyways, if you do want to create a new mailing list for these kinds of things I'll happily subscribe. 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: Sunday, November 11, 2007 1:46 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: RE: [Rxtx] Quality Engineering with rxtx > > On Mon, 5 Nov 2007, Oberhuber, Martin wrote: > > > Hi Trent, > > > > are the interestes of hobbyists really so different > > from commercial ones? Both should be interested in > > high quality and innovation the like. > > > > I haven't seen too many Open Source projects from the > > "inside" but those that I have seen did not have > > separate mailing lists for quality/testing/qa > > versus innovation/development. > > > > What I have seen with the Open Source projects that > > one would call "successful" is a good deal of > > process around automated builds, automated unit > > tests, predictable release dates and milestones, > > and policies around commiting/contributing/reviewing > > changes. > > > > I think that all of these benefit commercial users > > and hobbyists the like. > > > > If you were just asking about who's interested in > > discussing changes to foster more quality, count > > me in. I'm just not sure whether discussing these > > on a separate mailing list or other channel is the > > right thing to do. > > > > Hi Martin, > > There are two issues I'm thinking about. The first is the > generic unit > testing and quality initiatives required to move rxtx > forward. The second > is the inevitable fact that rxtx connects to external hardware. The > discussion deals with a different set of problems. > > Here is a simple example of what I'm getting at. > > We have the capability of setting custom baud rates in rxtx. > We may be > interested in seeing regressions in rxtx, the C library or > the kernel. > Some people may be doing some tests with loopback > connections. These will > always work even if the baud rate is not set to the expected > value. Some > people may use null modems between two ports. This may be > able to catch > the problem but not always. > > Will the build machines be able to test this? (no - for a few reasons) > Will people be trying to catch these type of regressions? (yes) > What type of coverage does the community have in the end? (?) > > We could include the discussions in the same list or another > equally open > list that may be of interest to some folks that deal with > these types of > problems on a regular basis. > > -- > Trent Jarvi > tjarvi at qbang.org > From toupsz at cs.tamu.edu Tue Nov 13 10:33:03 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 13 Nov 2007 11:33:03 -0600 Subject: [Rxtx] [urgent] device's power off detection In-Reply-To: <4738F546.5010101@gatworks.com> References: <766782.10076.qm@web55803.mail.re3.yahoo.com> <4738F546.5010101@gatworks.com> Message-ID: Lacking any other specification on it...but can you set up the device to notify your software when it turns off? Send a message or somesuch? Maybe it can signal using RTS or DTR? -Zach On Nov 12, 2007 6:52 PM, U. George wrote: > Not sure what u are asking for. Are u asking for a way to detect if the > device is OFF? Are u asking how to power off the device - via software ? > Is it a Serial device? > is it a parallel device? > is it a usb device? > > Sara Hugh wrote: > > Hello all, > > I have a small application built on top of rxtx api. This application > > can retrieve the incoming data from a device through a port. The device > > can be powered off after the port get closed from the application. I > > have been trying a couple of hours to find a way to detect the power > > switching from device. If anyone knows how to handle it through rxtx, > > could you please give me a help? Thank you very much. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071113/e5859e4d/attachment-0017.html From tjarvi at qbang.org Tue Nov 13 20:02:03 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 13 Nov 2007 20:02:03 -0700 (MST) Subject: [Rxtx] #ifndef TIOCSERGETLSR In-Reply-To: <472E3AAF.7050709@gatworks.com> References: <472E3AAF.7050709@gatworks.com> Message-ID: On Sun, 4 Nov 2007, U. George wrote: > For Linux, it seems that you need the code for both *having* a > TIOCSERGETLSR, and *not having* a TIOCSERGETLSR. Maybe the ioctl exists > system wide, but not necessarily for the device driver itself ( always > returns -1 ) . > > Are there systems that have a *functioning* TIOCSERGETLSR for all their > devices? Then this would be the case where the "#ifndef TIOCSERGETLSR" > directive could be useful is eliminating the unnecessary code and tests. > > And for those systems that dont have a TIOCSERGETLSR, then the code for > TIOCSERGETLSR can be eliminated. > > It would be a simple case to have, as a foundation, all the code to > simulate the missing TIOCSERGETLSR ioctl. If the system does have the > ioctl, then that code can be ifdef'd in, and co-exist with the > functionality of the code that simulates the missing TIOCSERGETLSR ioctl. > Ah, there is the post. Sorry I was on vacation. Hi George, Yes there are systems that have functioning TIOCSERGETLSR for all of their devices. These are machines that just use traditional UARTs. If you mean operating systems, then probably not. Let me explain a bit about the history of those #ifdefs to help clear up a mess. RXTX aims to follow POSIX. TIOCSERGETLSR turns out to not be POSIX at all as I understand. It isn't in BSD, Solaris, AIX or HP-UX. It certainly provides access to important information. I assumed it was standard when I coded rxtx on a Linux system. Ya, laugh. Then I looked at Win32.. Oh you are still laughing? ..I could not navigate msft's web site at the time [still can't really find anything today]. So google pointed me to someones 'reverse documentation' of the w32 API and an example msft put together back in the win3.0 days. It was enough but maybe not 100% correct. They covered overlapped IO which was important for events in rxtx. Looking at Win32 and Linux, it made sense to implement TIOCSERGETLSR for win32 with the way rxtx works. That was how things matched up. But when I got feedback about other systems, it didn't match up. When people used multiport cards with money saving designs in Linux, it didn't match up. And today, there are drivers for unusual serial ports that don't match up. Now we have some ugly logic that mostly works for most serial ports. It isn't right though. The important aspect of TIOSERGETLSR is knowing when the output is really gone. But POSIX tcdrain tells us the same thing. So there is logic in the ifdefs to match that up as you suggest. Perhaps a more formal solution along those lines would be worth looking into. I would suggest the roles should be switched though. We should use POSIX calls on all systems and hide things that don't work on everything like we have with other undocumented calls. TIOSERGETLSR is nice and would be great if it was standard. It isn't as far as I can tell. In the end, many people write Java code because they want portability. The TIOSERGETLSR does not really fit. In someways, this is limiting to the least common denominator which is Solaris if you have seen it's serial kernel driver code. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 15 09:10:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 15 Nov 2007 17:10:59 +0100 Subject: [Rxtx] RXTX blocking on unconnected virtual port Message-ID: <460801A4097E3D4CA04CC64EE648584803919080@ism-mail03.corp.ad.wrs.com> Hello, we came across the following issue: * Set up a virtual serial port, e.g. with com0com: http://com0com.sourceforge.net/ * Connect RXTX to one end, e.g. cnc1a * Do not connect the other end, e.g. cnc1b * Have RXTX write data to the port --> Since the data is not being read, RXTX blocks - RXTXPort.SerialOutputStream.write increases the RXTXPort.IOLocked variable - it then calls the native writeByte or writeArray method (which blocks) closing the RXTXPort hangs for ever too: - RXTXPort.close() has a while( IOLocked > 0 ) {..Thread.sleep(500);...} which spins for ever ==> once the communication hangs, it cannot recover. Has anybody else seen such a problem before, or even got an idea how to solve it? When I connect Hyperterminal to the same half-open port, and type a character, it hangs for about 3 seconds but then times out and is available again. I guess that's what I'd like to see in RXTX as well, with a (configurable) timeout. Our big problem with the current situation is that once RXTX gets stuck, there is nothing at all we can do to make it go live again - that's why our original workaround of writing to the port in a background thread is not good enough. For more background information, the issue is being tracked in https://bugs.eclipse.org/bugs/show_bug.cgi?id=208185 Thanks for any hints or ideas, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Sun Nov 18 09:43:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 09:43:26 -0700 (MST) Subject: [Rxtx] PortInUseException - Cannot close and reopen serial port In-Reply-To: <460801A4097E3D4CA04CC64EE64858480351C711@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858480351C711@ism-mail03.corp.ad.wrs.com> Message-ID: These have been submitted to CVS and the bugzilla entries have been changed to reflect the changes. ChangeLog: find ports which were added after program startup on Mac OS X. Martin Oberhuber http://bugzilla.qbang.org/show_bug.cgi?id=48 Clean up CommPort Ownership code, avoid possible deadlocks, fix lost commport ownership events. http://bugzilla.qbang.org/show_bug.cgi?id=83 Martin Oberhuber On Wed, 24 Oct 2007, Oberhuber, Martin wrote: > 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) > > > > > > > > > > > > > > > From tjarvi at qbang.org Sun Nov 18 09:45:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 09:45:39 -0700 (MST) Subject: [Rxtx] PortInUseException - Cannot close and reopen serial port In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848020CAF26@ism-mail03.corp.ad.wrs.com> Message-ID: The current CVS code should have all the entries. With version information, I usually do not change the version until we tag and release a zip file. Any feedback would be appreciated. On Wed, 27 Jun 2007, Greg Johnson wrote: > 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) >> >> >> >> >> > From tjarvi at qbang.org Sun Nov 18 13:51:27 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 13:51:27 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs Message-ID: The following bugs have been closed and CVS updated as needed: CommPortIdentifier.getPortIdentifier throws NoSuchPortException http://bugzilla.qbang.org/show_bug.cgi?id=48 CommPortOwnership events not sent http://bugzilla.qbang.org/show_bug.cgi?id=83 JVM 1.6 builds http://bugzilla.qbang.org/show_bug.cgi?id=84 I'd like to give Martin Oberhuber CVS write access. He has been doing a great job of pushing safe patches into rxtx. I'll be preparing seperate patches for the changes I have and submitting them to the list. I'll need to work with George to do a couple things: 1) break the patch into smaller pieces to isolate issues for discussion. 2) work through the Line Status Register changes so it does not cause problems on other systems. George: If you could do the first one, it would be greatly appreciated. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Nov 18 15:33:36 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 15:33:36 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: Message-ID: I'm not running any tests at this point, I'm trying to apply the small safe patches and make sure everything is compiling. As mentioned at the bottom, there are 3 patches + the USB fix posted here that need more review before accepting. The following bugs have been closed and CVS updated as needed. Most of these are already in CVS. The diff will be small. configure script failed at line UTS_RELEASE megov http://bugzilla.qbang.org/show_bug.cgi?id=80 code cleanup patch (extra ';' creates bug for if statements + new String() calls removed) Xavier Le Vourch http://bugzilla.qbang.org/show_bug.cgi?id=77 Wont compile on linux ppc with glibc 2.5 - no sys/io.h Brian Johnson http://bugzilla.qbang.org/show_bug.cgi?id=72 rxtx overwrites System properties Andrew Gillett Nektarios K. Papadopoulos Neboj??a http://bugzilla.qbang.org/show_bug.cgi?id=64 Solaris ACM port support Dave Cleal http://bugzilla.qbang.org/show_bug.cgi?id=59 Setting of non-standard baud rate fails. Andrew Prunicki http://bugzilla.qbang.org/show_bug.cgi?id=58 RXTX uses lockfiles on MacOS X (instead of ioctl TIOCEXCL) Joachim Buechse http://bugzilla.qbang.org/show_bug.cgi?id=50 JavaDoc fixes Joachim Buechse http://bugzilla.qbang.org/show_bug.cgi?id=49 I need to further review the following: http://bugzilla.qbang.org/show_bug.cgi?id=53 http://bugzilla.qbang.org/show_bug.cgi?id=46 http://bugzilla.qbang.org/show_bug.cgi?id=41 On Sun, 18 Nov 2007, Trent Jarvi wrote: > > The following bugs have been closed and CVS updated as needed: > > CommPortIdentifier.getPortIdentifier throws NoSuchPortException > http://bugzilla.qbang.org/show_bug.cgi?id=48 > CommPortOwnership events not sent > http://bugzilla.qbang.org/show_bug.cgi?id=83 > JVM 1.6 builds > http://bugzilla.qbang.org/show_bug.cgi?id=84 > > I'd like to give Martin Oberhuber CVS write access. He has been doing a > great job of pushing safe patches into rxtx. > > I'll be preparing seperate patches for the changes I have and submitting > them to the list. > > I'll need to work with George to do a couple things: > > 1) break the patch into smaller pieces to isolate issues for discussion. > 2) work through the Line Status Register changes so it does not cause > problems on other systems. > > George: If you could do the first one, it would be greatly appreciated. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From netbeans at gatworks.com Sun Nov 18 16:20:02 2007 From: netbeans at gatworks.com (U. George) Date: Sun, 18 Nov 2007 18:20:02 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: Message-ID: <4740C8A2.6030908@gatworks.com> > I'll need to work with George to do a couple things: > > 1) break the patch into smaller pieces to isolate issues for discussion. > 2) work through the Line Status Register changes so it does not cause > problems on other systems. > > George: If you could do the first one, it would be greatly appreciated. there are ( probably ) 3 pieces: 1) the select() failure when the USB-serial device is unceremoniously unplugged ( causes rxtx to spin ) 2) TIOCSERGETLSR, need to have the simulation of it available for all os's . If the system has the capability, don't simulate for devices that have the capability. For devices that dont have the capability, but the OS still defines TIOCSERGETLSR, fall back to simulation. 3) I rearranged DEBUG ifdef's. This is probably the bulk of the patches. From tjarvi at qbang.org Sun Nov 18 18:26:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 18:26:26 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <4740C8A2.6030908@gatworks.com> References: <4740C8A2.6030908@gatworks.com> Message-ID: On Sun, 18 Nov 2007, U. George wrote: > >> I'll need to work with George to do a couple things: >> >> 1) break the patch into smaller pieces to isolate issues for discussion. >> 2) work through the Line Status Register changes so it does not cause >> problems on other systems. >> >> George: If you could do the first one, it would be greatly appreciated. > > there are ( probably ) 3 pieces: > 1) the select() failure when the USB-serial device is unceremoniously > unplugged ( causes rxtx to spin ) > 2) TIOCSERGETLSR, need to have the simulation of it available for all os's . > If the system has the capability, don't simulate for devices that have the > capability. For devices that dont have the capability, but the OS still > defines TIOCSERGETLSR, fall back to simulation. > 3) I rearranged DEBUG ifdef's. This is probably the bulk of the patches. > Hi George, I suspect if you do cvs update, there will be very few conflicts if any. While the list of fixes is fairly long, the changes are small. -- Trent Jarvi tjarvi at qbang.org From EdwardRF at xtremax.com Mon Nov 19 03:32:29 2007 From: EdwardRF at xtremax.com (Edward) Date: Mon, 19 Nov 2007 18:32:29 +0800 Subject: [Rxtx] Cannot Read under Windows XP Message-ID: <4741663D.4070200@xtremax.com> Hi Guys, I have a iTegno 3000 usb GSM modem, it is an usb-serial device. I am trying to use RXTX with it under Windows XP. The problem is it seems RXTX cannot read any data from it, but writing to it seems successful. I blindly issue a series of command to send off a SMS, it is successfully delivered, but neither the echo from the modem nor the "OK" response was received. I tried to connect to the modem directly using hyper terminal, there was no problem reading or writing. So can i assume it is not the driver problem? Then i turned to Serial Port Monitor for help, when I use hyper terminal, monitor shows both way traffic, and nothing abnormal, but when I connect using RXTX, only the data I sent to the modem is being detected, no input was detected. Does anyone else experience similar problem? Best Regards Edward From tjarvi at qbang.org Mon Nov 19 03:38:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Nov 2007 03:38:02 -0700 (MST) Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: <4741663D.4070200@xtremax.com> References: <4741663D.4070200@xtremax.com> Message-ID: On Mon, 19 Nov 2007, Edward wrote: > Hi Guys, > > I have a iTegno 3000 usb GSM modem, it is an usb-serial device. I am > trying to use RXTX with it under Windows XP. > The problem is it seems RXTX cannot read any data from it, but writing > to it seems successful. I blindly issue a series of command to send off > a SMS, it is successfully delivered, but neither the echo from the modem > nor the "OK" response was received. > > I tried to connect to the modem directly using hyper terminal, there was > no problem reading or writing. So can i assume it is not the driver problem? > > Then i turned to Serial Port Monitor for help, when I use hyper > terminal, monitor shows both way traffic, and nothing abnormal, but when > I connect using RXTX, only the data I sent to the modem is being > detected, no input was detected. > > Does anyone else experience similar problem? > Hi Edward, A common mistake is to send Strings to the modem which are i18n. You want to send the bytes. Examples of doing this are in the contrib directory with the sourcecode. ie SimpleSnuV1.java -- Trent Jarvi tjarvi at qbang.org From EdwardRF at xtremax.com Mon Nov 19 04:42:16 2007 From: EdwardRF at xtremax.com (Edward) Date: Mon, 19 Nov 2007 19:42:16 +0800 Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: References: <4741663D.4070200@xtremax.com> Message-ID: <47417698.3060705@xtremax.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071119/b0f08ba9/attachment-0012.html From netbeans at gatworks.com Mon Nov 19 06:31:30 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 19 Nov 2007 08:31:30 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: <4740C8A2.6030908@gatworks.com> Message-ID: <47419032.8080406@gatworks.com> Did the "make install". The install does not want to go to or use Makefiles's prefix = /usr/local/rxtx-devel Not terribly happy that it installed in /home/gat/JAVA/JDK14/j2sdk1.4.2_08/jre/lib/i386 Trent Jarvi wrote: > > I suspect if you do cvs update, there will be very few conflicts if any. > While the list of fixes is fairly long, the changes are small. > > -- > Trent Jarvi > tjarvi at qbang.org > > From Martin.Oberhuber at windriver.com Mon Nov 19 07:00:48 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 19 Nov 2007 15:00:48 +0100 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE6485848039986E6@ism-mail03.corp.ad.wrs.com> It's great to see things progressing - thanks Trent! I checked CVS, and it seems that most of the patch authors are yet missing from the AUTHORS file, is this intentional? The issues areound RXTXPort.close() are interesting for us in the context of Eclipse as well: https://bugs.eclipse.org/bugs/show_bug.cgi?id=208185#c3 I did a quick review and found some issues / comments: http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 http://bugzilla.qbang.org/show_bug.cgi?id=53#c9 Thanks for proposing CVS write access for me. I promise to use these thoughtfully, and discuss potential fixes openly (on bugzilla) before applying them [unless it's really trivial issues only like obvious Javadoc syntax or spelling errors]. Cheers, -- 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 Mon Nov 19 07:24:16 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 19 Nov 2007 15:24:16 +0100 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803998711@ism-mail03.corp.ad.wrs.com> Hi all, I think I've got a better version for RXTXCommDriver.checkSolaris(): http://bugzilla.qbang.org/show_bug.cgi?id=77#c3 Cheers, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From netbeans at gatworks.com Mon Nov 19 09:01:22 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 19 Nov 2007 11:01:22 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <47419032.8080406@gatworks.com> References: <4740C8A2.6030908@gatworks.com> <47419032.8080406@gatworks.com> Message-ID: <4741B352.8070205@gatworks.com> U. George wrote: > Did the "make install". The install does not want to go to or use > Makefiles's prefix = /usr/local/rxtx-devel > > Not terribly happy that it installed in > /home/gat/JAVA/JDK14/j2sdk1.4.2_08/jre/lib/i386 > Put libs and jar in MY preferential places. Ran application. And it loves to spin. Deja gnu all over again. :-/ It did find the avail /dev/ttyUSB0 port connected to LINUX usbserial/pl2303 device driver. Now to find the spin. and apply simpler set of patches From tjarvi at qbang.org Mon Nov 19 10:14:38 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Nov 2007 10:14:38 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <4741B352.8070205@gatworks.com> References: <4740C8A2.6030908@gatworks.com> <47419032.8080406@gatworks.com> <4741B352.8070205@gatworks.com> Message-ID: On Mon, 19 Nov 2007, U. George wrote: > U. George wrote: >> Did the "make install". The install does not want to go to or use >> Makefiles's prefix = /usr/local/rxtx-devel >> >> Not terribly happy that it installed in >> /home/gat/JAVA/JDK14/j2sdk1.4.2_08/jre/lib/i386 >> > Put libs and jar in MY preferential places. Ran application. And it loves to > spin. Deja gnu all over again. :-/ > > It did find the avail /dev/ttyUSB0 port connected to LINUX usbserial/pl2303 > device driver. > > Now to find the spin. and apply simpler set of patches > Hi George, When the prefix code was stomped on and the library was installed in the jre, It wasnt clear how the layout would end up looking. I'm still not sure. My usual attack was to dump a jdk onto the filesystem, set JAVA_HOME and install. When I was done, I would nuke the jdk. Obviously that may not be what people want but I'm not sure a prefix is enough to let us know what they do want. For a shared library prefix /usr/local means the library goes in /usr/local/lib. What would it mean for the jar and shared library in Java? -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Nov 19 10:24:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Nov 2007 10:24:08 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <460801A4097E3D4CA04CC64EE6485848039986E6@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848039986E6@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 19 Nov 2007, Oberhuber, Martin wrote: > > I checked CVS, and it seems that most of the patch > authors are yet missing from the AUTHORS file, > is this intentional? > There isn't a hard rule covering who goes into AUTHORS. If I recognize a person from previous patches, I try to make sure they are in. Everyone contributing (authors) is in the ChangeLog with what they did going all the way back to the first release. AUTHORS is more of a summary of what they did after a few submissions. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Nov 19 11:39:51 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 19 Nov 2007 13:39:51 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: <4740C8A2.6030908@gatworks.com> <47419032.8080406@gatworks.com> <4741B352.8070205@gatworks.com> Message-ID: <4741D877.80203@gatworks.com> For me, the makefile/prefix = /usr/local sorta suggest thats where the libs/bins/jars/... should eventually wind up. If a user does not like /usr/local, then a quick change would put it somewhere else. At this moment I dont care where the jar winds up ( in lib, or a jar directory ). So I like to keep the jre/sdk directory protected from meddling, and changes. But if a user has a penchant to use 'java -jar', then the RXTXcomm.jar file should be stuffed with the other jre/sdk jar files. From ajmas at sympatico.ca Mon Nov 19 11:54:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 19 Nov 2007 13:54:29 -0500 Subject: [Rxtx] CVS updates and closed bugs Message-ID: <20071119185429.SPYK18413.tomts22-srv.bellnexxia.net@smtp1.sympatico.ca> On this day in November "U. George" wrote: > > For me, the makefile/prefix = /usr/local sorta suggest thats where the > libs/bins/jars/... should eventually wind up. > If a user does not like /usr/local, then a quick change would put it > somewhere else. At this moment I dont care where the jar winds up ( in > lib, or a jar directory ). > So I like to keep the jre/sdk directory protected from meddling, and > changes. > But if a user has a penchant to use 'java -jar', then the RXTXcomm.jar > file should be stuffed with the other jre/sdk jar files. It should be noted that some platforms, such as MacOS X might have different conventions. In the case of MacOS X there are two 'correct' places for Java libraries that aren't part of an application: - /Library/Java/Extensions/ - ~/Library/Java/Extensions/ Andre From ajmas at sympatico.ca Mon Nov 19 18:15:37 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 19 Nov 2007 20:15:37 -0500 Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: <47417698.3060705@xtremax.com> References: <4741663D.4070200@xtremax.com> <47417698.3060705@xtremax.com> Message-ID: <3D24B671-06CA-4709-AE3C-BCDB542F427F@sympatico.ca> On 19-Nov-07, at 06:42 , Edward wrote: > Hi Trent, > > First of all, I did sent them as bytes, eg, > > output.write("at\r\n".getBytes()); > > And if writing is every the problem, it wouldn't be able to explain > why i could send out a sms successfully using RXTX. > If you have the section of code that does the communicating, could you share it with us? This should help us tell whether it is a coding issue or something more fundamental with RXTX. Andre From EdwardRF at xtremax.com Mon Nov 19 19:39:36 2007 From: EdwardRF at xtremax.com (EdwardRF) Date: Tue, 20 Nov 2007 10:39:36 +0800 Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: <3D24B671-06CA-4709-AE3C-BCDB542F427F@sympatico.ca> References: <4741663D.4070200@xtremax.com> <47417698.3060705@xtremax.com> <3D24B671-06CA-4709-AE3C-BCDB542F427F@sympatico.ca> Message-ID: <474248E8.7070002@xtremax.com> Hi Guys, Thanks for the help, i've finally found out the problem. It was a flow control issue, i did not set the flow control properly. Btw, what is the default flow control behavior for rxtx2.1.7? was it the same as 2.0? Because i remember i did not need to set the flow control when I use rxtx 2.0 2 years back. Best Regards Edward Andre-John Mas wrote: > > On 19-Nov-07, at 06:42 , Edward wrote: > >> Hi Trent, >> >> First of all, I did sent them as bytes, eg, >> >> output.write("at\r\n".getBytes()); >> >> And if writing is every the problem, it wouldn't be able to explain >> why i could send out a sms successfully using RXTX. >> > > If you have the section of code that does the communicating, could you > share it with us? This should help us tell whether it is a coding > issue or something more fundamental with RXTX. > > Andre > From netbeans at gatworks.com Tue Nov 20 06:23:26 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 20 Nov 2007 08:23:26 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: <4740C8A2.6030908@gatworks.com> Message-ID: <4742DFCE.5070504@gatworks.com> Here is the small subset of diffs just for TIOCSERGETLSR :) Next I'll pull out the usb device, and see if that also causes rxtx to spin. >> 2) TIOCSERGETLSR, need to have the simulation of it available for all >> os's . If the system has the capability, don't simulate for devices >> that have the capability. For devices that dont have the capability, >> but the OS still defines TIOCSERGETLSR, fall back to simulation. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: a Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20071120/2c5c8ee7/attachment-0009.pl From tjarvi at qbang.org Tue Nov 20 08:20:21 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Nov 2007 08:20:21 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <4742DFCE.5070504@gatworks.com> References: <4740C8A2.6030908@gatworks.com> <4742DFCE.5070504@gatworks.com> Message-ID: On Tue, 20 Nov 2007, U. George wrote: > Here is the small subset of diffs just for TIOCSERGETLSR :) > > Next I'll pull out the usb device, and see if that also causes rxtx to spin. > >>> 2) TIOCSERGETLSR, need to have the simulation of it available for all os's >>> . If the system has the capability, don't simulate for devices that have >>> the capability. For devices that dont have the capability, but the OS >>> still defines TIOCSERGETLSR, fall back to simulation. > Hi George, I'll be looking through this patch in detail tonight. I just wanted to make sure you are aware of this line in win32termios.h. The ifdef logic is messy as you noticed. That is combined with the later addition of support for it to windows. #define TIOCSERGETLSR 0x5459 (this is by far the strangest code in rxtx in retrospect) I'll be able to do extensive automated testing once we get to that point. I'm confident we can get something in that has a low probability of causing regressions. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Tue Nov 20 08:42:08 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 20 Nov 2007 10:42:08 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: <4740C8A2.6030908@gatworks.com> <4742DFCE.5070504@gatworks.com> Message-ID: <47430050.1010203@gatworks.com> It is of no difference. 1) If the define does not exist, then it should be as before. 2) If it does exist, then it should also be as before. 3) If it does exist, but the ioctl fails, then it will fallback as if it did not exist in the first place. Trent Jarvi wrote: > On Tue, 20 Nov 2007, U. George wrote: > >> Here is the small subset of diffs just for TIOCSERGETLSR :) >> >> Next I'll pull out the usb device, and see if that also causes rxtx to >> spin. >> >>>> 2) TIOCSERGETLSR, need to have the simulation of it available for >>>> all os's . If the system has the capability, don't simulate for >>>> devices that have the capability. For devices that dont have the >>>> capability, but the OS still defines TIOCSERGETLSR, fall back to >>>> simulation. >> > > Hi George, > > I'll be looking through this patch in detail tonight. I just wanted to > make sure you are aware of this line in win32termios.h. The ifdef logic > is messy as you noticed. That is combined with the later addition of > support for it to windows. > > #define TIOCSERGETLSR 0x5459 > > (this is by far the strangest code in rxtx in retrospect) > > I'll be able to do extensive automated testing once we get to that > point. I'm confident we can get something in that has a low probability > of causing regressions. > > -- > Trent Jarvi > tjarvi at qbang.org > > From netbeans at gatworks.com Tue Nov 20 08:36:56 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 20 Nov 2007 10:36:56 -0500 Subject: [Rxtx] Unplugged Opened USB devices In-Reply-To: <4742DFCE.5070504@gatworks.com> References: <4740C8A2.6030908@gatworks.com> <4742DFCE.5070504@gatworks.com> Message-ID: <4742FF18.3050005@gatworks.com> > Next I'll pull out the usb device, and see if that also causes rxtx to > spin. This is the error on a read. The select() should have failed, as well as the read(). java.io.IOException: Input/output error in nativeavailable at gnu.io.RXTXPort.nativeavailable(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1420) at jGPS.GpsData.DeviceDrivers.SerialPort.SerialPort_NMEA_GNU.serialEvent (SerialPort_NMEA_GNU.java:449) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:771) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1622) But for java program, it sees( when USB device is unplugged ) : 1) event: SerialPortEvent.DATA_AVAILABLE 2) read (non-existant) data. I think that its bad form to say DATA_AVAILABLE, when there is no data to be obtained. There does not seem to be an I/O error event. So basically, I think, and IMHO, that no events should be sent. Rather a thread timeout ( ie no data in X seconds ) AND recovery from user code should be instantiated. From manujnaman at yahoo.com Wed Nov 21 12:35:46 2007 From: manujnaman at yahoo.com (manuj naman) Date: Wed, 21 Nov 2007 11:35:46 -0800 (PST) Subject: [Rxtx] Problem reading 1-wire device using RXTX on Linux Message-ID: <371969.66249.qm@web37911.mail.mud.yahoo.com> Hello, I am trying to use the RXTX library on Ubuntu (Debian) linux to read iButtons. It works perfectly on Windows. However on my linux machines it gives the following errors. I am using DS9490 (USB port adapter) to read the iButtons. I have followed your instructions on the Wiki. I recompiled the rxtx library to produce the .so and .jar files. But still it gives me this: manujnaman at sensor:~/iButton/onewireviewer$ java -cp $CLASSPATH:./OneWireAPI.jar:./OneWireViewer.jar OneWireViewer Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Warning: serial communications API not setup properly, no ports in enumeration Pure-Java DS9097U adapter will not work, not added to adapter enum Standard drivers for 1-Wire are not found. Please download the latest drivers from http://www.ibutton.com Or install RXTX Serial Communications API from http://www.rxtx.org Do you know how to solve the "Serial communications API not setup properly, no ports in enumeration" problem? Also, how to detect which what /dev/* is the port to be used? On Windows this is simply USB1, on linux this is a bit unclear. Many thanks for your advice, Manuj Naman Dallas, TX, US manujnaman at yahoo.com --------------------------------- Be a better pen pal. Text or chat with friends inside Yahoo! Mail. See how. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071121/2760f691/attachment-0008.html From Martin.Oberhuber at windriver.com Wed Nov 21 13:55:25 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 21 Nov 2007 21:55:25 +0100 Subject: [Rxtx] Should RXTX Lixense link to LGPL-2.1 be changed? In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803A21160@ism-mail03.corp.ad.wrs.com> Hi Trent and all, In all the RXTX source files as well as http://users.frii.com/jarvi/rxtx/license.html there is the following lines: | A copy of the LGPL v 2.1 may be found at | http://www.gnu.org/licenses/lgpl.txt on March 4th 2007. A copy is | here for your convenience. But, as of today, at the link provided there is only a copy of the LGPL v3.0. I think there should be a link to the LGPL v2.1, e.g. http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html What do you think? Cheers, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Nov 21 20:46:18 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Nov 2007 20:46:18 -0700 (MST) Subject: [Rxtx] Problem reading 1-wire device using RXTX on Linux In-Reply-To: <371969.66249.qm@web37911.mail.mud.yahoo.com> References: <371969.66249.qm@web37911.mail.mud.yahoo.com> Message-ID: On Wed, 21 Nov 2007, manuj naman wrote: > Hello, > > I am trying to use the RXTX library on Ubuntu (Debian) linux to read iButtons. It works perfectly on Windows. However on my linux machines it gives the following errors. I am using DS9490 (USB port adapter) to read the iButtons. > > I have followed your instructions on the Wiki. I recompiled the rxtx library to produce the .so and .jar files. But still it gives me this: > > manujnaman at sensor:~/iButton/onewireviewer$ java -cp $CLASSPATH:./OneWireAPI.jar:./OneWireViewer.jar OneWireViewer > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > Warning: serial communications API not setup properly, no ports in enumeration > Pure-Java DS9097U adapter will not work, not added to adapter enum > > Standard drivers for 1-Wire are not found. > Please download the latest drivers from http://www.ibutton.com > Or install RXTX Serial Communications API from http://www.rxtx.org > > Do you know how to solve the "Serial communications API not setup properly, no ports in enumeration" problem? > > Also, how to detect which what /dev/* is the port to be used? On Windows this is simply USB1, on linux this is a bit unclear. Hi Manuj What is the output of the following? dmesg |grep tty touch /var/lock/test.lock && rm -f /var/lock/test.lock If you see something like /dev/ttyUSB0 in the dmesg output, what happens if you do something like tail -f /dev/ttyUSB0? These test each of the usual suspects. We are looking for missing USB drivers, no permission to create a lockfile and no read permission for the device. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Nov 21 21:05:23 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Nov 2007 21:05:23 -0700 (MST) Subject: [Rxtx] Should RXTX Lixense link to LGPL-2.1 be changed? In-Reply-To: <460801A4097E3D4CA04CC64EE648584803A21160@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803A21160@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 21 Nov 2007, Oberhuber, Martin wrote: > Hi Trent and all, > > In all the RXTX source files as well as > http://users.frii.com/jarvi/rxtx/license.html > there is the following lines: > > | A copy of the LGPL v 2.1 may be found at > | http://www.gnu.org/licenses/lgpl.txt on March 4th 2007. A copy is > | here for your convenience. > > But, as of today, at the link provided there is only > a copy of the LGPL v3.0. I think there should be a link > to the LGPL v2.1, e.g. > http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html > > What do you think? > Hi Martin, Thanks. I updated the link. Changing licences is a heavy process for me as a free software developer and an employee so I'd rather stay with 2.1 unless the current license becomes a show stopper. I figured that would happen someday so I put the date in to be clear. -- Trent Jarvi tjarvi at qbang.org From beat.arnet at gmail.com Thu Nov 22 08:45:45 2007 From: beat.arnet at gmail.com (Beat Arnet) Date: Thu, 22 Nov 2007 10:45:45 -0500 Subject: [Rxtx] Dual Core Problem Message-ID: <4745A429.9060604@gmail.com> Dear All, I am struggling with an application that uses RXTX 2.1.7 and has been working reliably in the past. When this program runs on a dual-core DELL (Intel T2500), strange things happen with the RS232 communication. The application is missing incoming characters and also often freezes when trying to close the serial port. I highly suspect a threading problem and was wondering if a) anybody had run into a similar problem with dual core processors and b) if there is a list of does and dont's when it comes to RXTX and threads. Regards, Beat From tjarvi at qbang.org Thu Nov 22 13:22:43 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 22 Nov 2007 13:22:43 -0700 (MST) Subject: [Rxtx] Dual Core Problem In-Reply-To: <4745A429.9060604@gmail.com> References: <4745A429.9060604@gmail.com> Message-ID: On Thu, 22 Nov 2007, Beat Arnet wrote: > Dear All, > I am struggling with an application that uses RXTX 2.1.7 and has been > working reliably in the past. When this program runs on a dual-core DELL > (Intel T2500), strange things happen with the RS232 communication. The > application is missing incoming characters and also often freezes when > trying to close the serial port. I highly suspect a threading problem > and was wondering if a) anybody had run into a similar problem with dual > core processors and b) if there is a list of does and dont's when it > comes to RXTX and threads. > I've used rxtx with SMP systems but have not experimented very much with threading and rxtx. One red flag rxtx raises is it stores pointers to java objects in SerialImp.c. If the JVM decides to move things around, rxtx becomes confused. Missing incomming characters is usually caused by someone running two applications. They then fight over the incomming data. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Fri Nov 23 03:12:28 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 23 Nov 2007 11:12:28 +0100 Subject: [Rxtx] Dual Core Problem In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803A84C59@ism-mail03.corp.ad.wrs.com> > Missing incomming characters is usually caused by someone running two > applications. They then fight over the incomming data. I've seen exactly this scenario on Linux with Lockfiles disabled. Usually, port locking (through Lockfiles or Ioctl method) should avoid exactly this problem. I know that on Mac, port locking through Kernel/Ioctl method has been added for the upcoming RXTX 2.1-8. What's the status of this feature for Linux and other Unixes? Cheers, Martin From chris.paton at red61.com Fri Nov 23 05:26:10 2007 From: chris.paton at red61.com (Chris Paton) Date: Fri, 23 Nov 2007 12:26:10 +0000 Subject: [Rxtx] RXTX parallel port issues Message-ID: <4746C6E2.3000304@red61.com> Hi there, I've been happily using RXTX to communicate with a serial based point-of-sale printer for a several months. I've recently received a parallel based printer and have been trying to get RXTX to talk to this too. I've encountered a few problems along the way and just wanted to check if I'm doing anything wrong, or if I've found any bugs. Writing ------- Writing to the parallel port using ParallelPort.getOutputStream works well, except when I use OutputStream.write(byte[]) to write a multiple of 8 bytes (!). Doing this causes the JVM to crash with an EXCEPTION_PRIV_INSTRUCTION on Windows. I worked around this in my application by adding an additional byte if bytesToWrite % 8 == 0. I guess I could also have called write(byte) repeatedly. This also generated a SIGSEGV on Linux but I was unable to reproduce it today using the CVS version of RXTX and a recent kernel. Reading status pins ------------------- On Linux, I've found that ParallelPort.isPaperOut and ParallelPort.isPrinterSelected appear to be inverted; i.e. when the paper is out ParallelPort.isPaperOut returns false, and when there is paper ParallelPort.isPaperOut returns true! I've tested this in both Sun JDK5 and JDK6 on machines running Linux 2.6.21 and 2.6.23. Fortunately it's easy to use a conditional based on System.getProperty("os.name") to hack around this. Reading from InputStream ------------------------ I've had more serious issues trying to read from ParallelPort.getInputStream. On Windows, readByte seems to return -1 (end of stream) any time data isn't available. On Linux, I got a kernel oops, even with a recent 2.6.23.1 kernel. I was able to stop this using a kernel patch that I found via Google. Although this stopped the oops, I still get frequent IOExceptions when calling InputStream.readByte. It appears that instead of blocking, readByte throws an IOException with message "Resource temporarily unavailable in readByte" any time it is called when no data is available. Occasionally, I get an exception instead of the data I was expecting to read, e.g when asking my printer for a version string I get "VER: S3306 * 06.03* 10/*6/06" where the *s indicate that an exception occurred and data was missed. Any advice that anyone can offer would be much appreciated. If you need any more details or debugging information about any of these problems then let me know. Cheers -- Chris Paton Technical Developer Red61 -- Transaction Marketing Software http://www.red61.com -------------- next part -------------- A non-text attachment was scrubbed... Name: chris.paton.vcf Type: text/x-vcard Size: 230 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20071123/00a747b6/attachment-0014.vcf From chris.paton at red61.com Fri Nov 23 05:26:10 2007 From: chris.paton at red61.com (Chris Paton) Date: Fri, 23 Nov 2007 12:26:10 +0000 Subject: [Rxtx] RXTX parallel port issues Message-ID: <4746C6E2.3000304@red61.com> Hi there, I've been happily using RXTX to communicate with a serial based point-of-sale printer for a several months. I've recently received a parallel based printer and have been trying to get RXTX to talk to this too. I've encountered a few problems along the way and just wanted to check if I'm doing anything wrong, or if I've found any bugs. Writing ------- Writing to the parallel port using ParallelPort.getOutputStream works well, except when I use OutputStream.write(byte[]) to write a multiple of 8 bytes (!). Doing this causes the JVM to crash with an EXCEPTION_PRIV_INSTRUCTION on Windows. I worked around this in my application by adding an additional byte if bytesToWrite % 8 == 0. I guess I could also have called write(byte) repeatedly. This also generated a SIGSEGV on Linux but I was unable to reproduce it today using the CVS version of RXTX and a recent kernel. Reading status pins ------------------- On Linux, I've found that ParallelPort.isPaperOut and ParallelPort.isPrinterSelected appear to be inverted; i.e. when the paper is out ParallelPort.isPaperOut returns false, and when there is paper ParallelPort.isPaperOut returns true! I've tested this in both Sun JDK5 and JDK6 on machines running Linux 2.6.21 and 2.6.23. Fortunately it's easy to use a conditional based on System.getProperty("os.name") to hack around this. Reading from InputStream ------------------------ I've had more serious issues trying to read from ParallelPort.getInputStream. On Windows, readByte seems to return -1 (end of stream) any time data isn't available. On Linux, I got a kernel oops, even with a recent 2.6.23.1 kernel. I was able to stop this using a kernel patch that I found via Google. Although this stopped the oops, I still get frequent IOExceptions when calling InputStream.readByte. It appears that instead of blocking, readByte throws an IOException with message "Resource temporarily unavailable in readByte" any time it is called when no data is available. Occasionally, I get an exception instead of the data I was expecting to read, e.g when asking my printer for a version string I get "VER: S3306 * 06.03* 10/*6/06" where the *s indicate that an exception occurred and data was missed. Any advice that anyone can offer would be much appreciated. If you need any more details or debugging information about any of these problems then let me know. Cheers -- Chris Paton Technical Developer Red61 -- Transaction Marketing Software http://www.red61.com -------------- next part -------------- A non-text attachment was scrubbed... Name: chris.paton.vcf Type: text/x-vcard Size: 230 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20071123/00a747b6/attachment-0015.vcf From hho at bibliotheca.dk Fri Nov 23 06:45:36 2007 From: hho at bibliotheca.dk (Hans Hvelplund Odborg) Date: Fri, 23 Nov 2007 14:45:36 +0100 Subject: [Rxtx] RXTX parallel port issues In-Reply-To: <4746C6E2.3000304@red61.com> References: <4746C6E2.3000304@red61.com> Message-ID: <001201c82dd7$21c6e2c0$6a37a8c0@HANSLAPTOP> I've experienced similar crashes in JVM when writing to the parallel port in windows (with rxtx). Unfortunately I did not save the data sent to the parallel port so cannot say anything about the length. Furthermore, I recall having problems with .write(byte) (would never exit if I recall correctly), but I do not recall if this was with serial or parallel or both. In the end, we ended printing through Java's support of the windows driver. Unfortunately I currently don?t have the time to investigate these issues further. I just wanted to let you know that currently there are bugs in rxtx. Med venlig hilsen / Best regards / Med v?nliga h?lsningar Hans Hvelplund Odborg BIBLIOTHECA A/S Vallensb?kvej 20B ? 2605 Br?ndby ? Denmark Tel.: +45 70271008 Fax: +45 70271009 hho at bibliotheca.dk www.bibliotheca.dk -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Chris Paton Sent: 23. november 2007 13:26 To: rxtx at qbang.org Subject: [Rxtx] RXTX parallel port issues Hi there, I've been happily using RXTX to communicate with a serial based point-of-sale printer for a several months. I've recently received a parallel based printer and have been trying to get RXTX to talk to this too. I've encountered a few problems along the way and just wanted to check if I'm doing anything wrong, or if I've found any bugs. Writing ------- Writing to the parallel port using ParallelPort.getOutputStream works well, except when I use OutputStream.write(byte[]) to write a multiple of 8 bytes (!). Doing this causes the JVM to crash with an EXCEPTION_PRIV_INSTRUCTION on Windows. I worked around this in my application by adding an additional byte if bytesToWrite % 8 == 0. I guess I could also have called write(byte) repeatedly. This also generated a SIGSEGV on Linux but I was unable to reproduce it today using the CVS version of RXTX and a recent kernel. Reading status pins ------------------- On Linux, I've found that ParallelPort.isPaperOut and ParallelPort.isPrinterSelected appear to be inverted; i.e. when the paper is out ParallelPort.isPaperOut returns false, and when there is paper ParallelPort.isPaperOut returns true! I've tested this in both Sun JDK5 and JDK6 on machines running Linux 2.6.21 and 2.6.23. Fortunately it's easy to use a conditional based on System.getProperty("os.name") to hack around this. Reading from InputStream ------------------------ I've had more serious issues trying to read from ParallelPort.getInputStream. On Windows, readByte seems to return -1 (end of stream) any time data isn't available. On Linux, I got a kernel oops, even with a recent 2.6.23.1 kernel. I was able to stop this using a kernel patch that I found via Google. Although this stopped the oops, I still get frequent IOExceptions when calling InputStream.readByte. It appears that instead of blocking, readByte throws an IOException with message "Resource temporarily unavailable in readByte" any time it is called when no data is available. Occasionally, I get an exception instead of the data I was expecting to read, e.g when asking my printer for a version string I get "VER: S3306 * 06.03* 10/*6/06" where the *s indicate that an exception occurred and data was missed. Any advice that anyone can offer would be much appreciated. If you need any more details or debugging information about any of these problems then let me know. Cheers -- Chris Paton Technical Developer Red61 -- Transaction Marketing Software http://www.red61.com From tjarvi at qbang.org Fri Nov 23 16:28:23 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 23 Nov 2007 16:28:23 -0700 (MST) Subject: [Rxtx] RXTX parallel port issues In-Reply-To: <001201c82dd7$21c6e2c0$6a37a8c0@HANSLAPTOP> References: <4746C6E2.3000304@red61.com> <001201c82dd7$21c6e2c0$6a37a8c0@HANSLAPTOP> Message-ID: It would be good to create a bug report for this so others can either look into it or find the report to confirm their suspicions. Currently, there is only one parallel port bug report. http://bugzilla.qbang.org/show_bug.cgi?id=40 As we do update the reports when bugs are fixed, it gives people a chance to put themselves on the CC list and get notification of fixes they are interested in. On Fri, 23 Nov 2007, Hans Hvelplund Odborg wrote: > > I've experienced similar crashes in JVM when writing to the parallel port in > windows (with rxtx). > > Unfortunately I did not save the data sent to the parallel port so cannot > say anything about the length. > > Furthermore, I recall having problems with .write(byte) (would never exit if > I recall correctly), but I do not recall if this was with serial or parallel > or both. > > In the end, we ended printing through Java's support of the windows driver. > > Unfortunately I currently don?t have the time to investigate these issues > further. I just wanted to let you know that currently there are bugs in > rxtx. > > > Med venlig hilsen / Best regards / Med v?nliga h?lsningar > Hans Hvelplund Odborg > > BIBLIOTHECA A/S > Vallensb?kvej 20B ? 2605 Br?ndby ? Denmark > Tel.: +45 70271008 > Fax: +45 70271009 > hho at bibliotheca.dk > www.bibliotheca.dk > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Chris Paton > Sent: 23. november 2007 13:26 > To: rxtx at qbang.org > Subject: [Rxtx] RXTX parallel port issues > > Hi there, > > I've been happily using RXTX to communicate with a serial based > point-of-sale printer for a several months. I've recently received a > parallel based printer and have been trying to get RXTX to talk to this > too. I've encountered a few problems along the way and just wanted to > check if I'm doing anything wrong, or if I've found any bugs. > > Writing > ------- > Writing to the parallel port using ParallelPort.getOutputStream works > well, except when I use OutputStream.write(byte[]) to write a multiple > of 8 bytes (!). Doing this causes the JVM to crash with an > EXCEPTION_PRIV_INSTRUCTION on Windows. I worked around this in my > application by adding an additional byte if bytesToWrite % 8 == 0. I > guess I could also have called write(byte) repeatedly. > > This also generated a SIGSEGV on Linux but I was unable to reproduce it > today using the CVS version of RXTX and a recent kernel. > > Reading status pins > ------------------- > On Linux, I've found that ParallelPort.isPaperOut and > ParallelPort.isPrinterSelected appear to be inverted; i.e. when the > paper is out ParallelPort.isPaperOut returns false, and when there is > paper ParallelPort.isPaperOut returns true! I've tested this in both Sun > JDK5 and JDK6 on machines running Linux 2.6.21 and 2.6.23. Fortunately > it's easy to use a conditional based on System.getProperty("os.name") to > hack around this. > > Reading from InputStream > ------------------------ > > I've had more serious issues trying to read from > ParallelPort.getInputStream. On Windows, readByte seems to return -1 > (end of stream) any time data isn't available. > > On Linux, I got a kernel oops, even with a recent 2.6.23.1 > kernel. I was able to stop this using a kernel patch > > that I found via Google. Although this stopped the oops, I still get > frequent IOExceptions when calling InputStream.readByte. It appears that > instead of blocking, readByte throws an IOException with message > "Resource temporarily unavailable in readByte" any time it is called > when no data is available. Occasionally, I get an exception instead of > the data I was expecting to read, e.g when asking my printer for a > version string I get "VER: S3306 * 06.03* 10/*6/06" where the *s > indicate that an exception occurred and data was missed. > > > Any advice that anyone can offer would be much appreciated. If you need > any more details or debugging information about any of these problems > then let me know. > > Cheers > From manujnaman at yahoo.com Sun Nov 25 14:59:21 2007 From: manujnaman at yahoo.com (manuj naman) Date: Sun, 25 Nov 2007 13:59:21 -0800 (PST) Subject: [Rxtx] Problem reading 1-wire device using RXTX on Linux In-Reply-To: Message-ID: <104159.48942.qm@web37909.mail.mud.yahoo.com> Trent, dmesg | grep tty gives nothing. however, greping for usb does. The output for that is below. touch /var/lock/test.lock file does not exist, the directory does exits though. tail -f /dev/ttyUSB0 gives nothing simply because ttyUSB0 does not exist. Seems as if USB ports are not there... however, numerous /dev/tty* exist starting from /dev/tty, /dev/tty0, /dev/tty1... to ... /dev/ttyzf. The result of dmesg | grep usb is as follows: [17179576.220000] usbcore: registered new driver usbfs [17179576.220000] usbcore: registered new driver hub [17179576.572000] usb 1-1: new low speed USB device using uhci_hcd and address 2 [17179576.992000] usb 2-1: new full speed USB device using uhci_hcd and address 2 [17179577.132000] usbcore: registered new driver hiddev [17179577.188000] input: USB HID v1.11 Mouse [Microsoft Microsoft Wireless Optical Mouse� 1.00] on usb-0000:00:1f.2-1 [17179577.188000] usbcore: registered new driver usbhid [17179577.188000] drivers/usb/input/hid-core.c: v2.6:USB HID core driver [17179577.192000] usb-storage: device found at 2 [17179577.192000] usb-storage: waiting for device to settle before scanning [17179577.192000] usbcore: registered new driver usb-storage [17179582.192000] usb-storage: device scan complete [17209993.728000] usb 1-2: new full speed USB device using uhci_hcd and address 3 [17209994.816000] usbcore: registered new driver DS9490R [17248016.760000] usb 1-1: USB disconnect, address 2 [17302939.908000] usb 1-2: USB disconnect, address 3 [17302944.856000] usb 1-2: new full speed USB device using uhci_hcd and address 4 [17794170.232000] usb 1-2: USB disconnect, address 4 Does it help in diagnosis? The name of the 1-wire viewer device is DS9490 Best regards, Manuj Trent Jarvi wrote: On Wed, 21 Nov 2007, manuj naman wrote: > Hello, > > I am trying to use the RXTX library on Ubuntu (Debian) linux to read iButtons. It works perfectly on Windows. However on my linux machines it gives the following errors. I am using DS9490 (USB port adapter) to read the iButtons. > > I have followed your instructions on the Wiki. I recompiled the rxtx library to produce the .so and .jar files. But still it gives me this: > > manujnaman at sensor:~/iButton/onewireviewer$ java -cp $CLASSPATH:./OneWireAPI.jar:./OneWireViewer.jar OneWireViewer > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > Warning: serial communications API not setup properly, no ports in enumeration > Pure-Java DS9097U adapter will not work, not added to adapter enum > > Standard drivers for 1-Wire are not found. > Please download the latest drivers from http://www.ibutton.com > Or install RXTX Serial Communications API from http://www.rxtx.org > > Do you know how to solve the "Serial communications API not setup properly, no ports in enumeration" problem? > > Also, how to detect which what /dev/* is the port to be used? On Windows this is simply USB1, on linux this is a bit unclear. Hi Manuj What is the output of the following? dmesg |grep tty touch /var/lock/test.lock && rm -f /var/lock/test.lock If you see something like /dev/ttyUSB0 in the dmesg output, what happens if you do something like tail -f /dev/ttyUSB0? These test each of the usual suspects. We are looking for missing USB drivers, no permission to create a lockfile and no read permission for the device. -- Trent Jarvi tjarvi at qbang.org --------------------------------- Be a better sports nut! Let your teams follow you with Yahoo Mobile. Try it now. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071125/ef4f80c4/attachment-0004.html From tjarvi at qbang.org Sun Nov 25 16:43:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 25 Nov 2007 16:43:04 -0700 (MST) Subject: [Rxtx] Problem reading 1-wire device using RXTX on Linux In-Reply-To: <104159.48942.qm@web37909.mail.mud.yahoo.com> References: <104159.48942.qm@web37909.mail.mud.yahoo.com> Message-ID: Hi Manuj, This does help diagnose the problem. Sadly the answer is in the system configuration of your debian system. I can only point you towards some areas that are suspect. /dev/tty01->/dev/ttyzz are terminals which are not of interest. It appears that the usb serial kernel module is not loading. That is usually in a directory like the following: /lib/modules/2.6.*/kernel/drivers/usb/serial modprobe is used to manually load the drivers. Your /dev/* may be created based upon the kernel modules loaded or MAKEDEV may be used to create the devices. /etc/modules.conf may be what is misconfigured though I'm not sure. One of the modules in usb/serial is probably responsible for representing your USB dongle as a tty. UDEV is probably responsible for creating ttyUSB01 once the kernel module is loaded. Perhaps someone has been through this before but basically this is a system configuration problem or a missing kernel driver. Once /dev/USB?? are present, rxtx should find the port. On Sun, 25 Nov 2007, manuj naman wrote: > Trent, > > dmesg | grep tty > gives nothing. however, greping for usb does. The output for that is below. > > touch /var/lock/test.lock file does not exist, the directory does exits though. > > tail -f /dev/ttyUSB0 gives nothing simply because ttyUSB0 does not exist. > > Seems as if USB ports are not there... however, numerous /dev/tty* exist starting from /dev/tty, /dev/tty0, /dev/tty1... to ... /dev/ttyzf. > > The result of dmesg | grep usb is as follows: > > [17179576.220000] usbcore: registered new driver usbfs > [17179576.220000] usbcore: registered new driver hub > [17179576.572000] usb 1-1: new low speed USB device using uhci_hcd and address 2 > [17179576.992000] usb 2-1: new full speed USB device using uhci_hcd and address 2 > [17179577.132000] usbcore: registered new driver hiddev > [17179577.188000] input: USB HID v1.11 Mouse [Microsoft Microsoft Wireless Optical Mouse� 1.00] on usb-0000:00:1f.2-1 > [17179577.188000] usbcore: registered new driver usbhid > [17179577.188000] drivers/usb/input/hid-core.c: v2.6:USB HID core driver > [17179577.192000] usb-storage: device found at 2 > [17179577.192000] usb-storage: waiting for device to settle before scanning > [17179577.192000] usbcore: registered new driver usb-storage > [17179582.192000] usb-storage: device scan complete > [17209993.728000] usb 1-2: new full speed USB device using uhci_hcd and address 3 > [17209994.816000] usbcore: registered new driver DS9490R > [17248016.760000] usb 1-1: USB disconnect, address 2 > [17302939.908000] usb 1-2: USB disconnect, address 3 > [17302944.856000] usb 1-2: new full speed USB device using uhci_hcd and address 4 > [17794170.232000] usb 1-2: USB disconnect, address 4 > > Does it help in diagnosis? The name of the 1-wire viewer device is DS9490 > > Best regards, > Manuj > > > Trent Jarvi wrote: On Wed, 21 Nov 2007, manuj naman wrote: > >> Hello, >> >> I am trying to use the RXTX library on Ubuntu (Debian) linux to read iButtons. It works perfectly on Windows. However on my linux machines it gives the following errors. I am using DS9490 (USB port adapter) to read the iButtons. >> >> I have followed your instructions on the Wiki. I recompiled the rxtx library to produce the .so and .jar files. But still it gives me this: >> >> manujnaman at sensor:~/iButton/onewireviewer$ java -cp $CLASSPATH:./OneWireAPI.jar:./OneWireViewer.jar OneWireViewer >> Experimental: JNI_OnLoad called. >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> Warning: serial communications API not setup properly, no ports in enumeration >> Pure-Java DS9097U adapter will not work, not added to adapter enum >> >> Standard drivers for 1-Wire are not found. >> Please download the latest drivers from http://www.ibutton.com >> Or install RXTX Serial Communications API from http://www.rxtx.org >> >> Do you know how to solve the "Serial communications API not setup properly, no ports in enumeration" problem? >> >> Also, how to detect which what /dev/* is the port to be used? On Windows this is simply USB1, on linux this is a bit unclear. > > > Hi Manuj > > What is the output of the following? > > dmesg |grep tty > > touch /var/lock/test.lock && rm -f /var/lock/test.lock > > If you see something like /dev/ttyUSB0 in the dmesg output, what happens > if you do something like > > tail -f /dev/ttyUSB0? > > These test each of the usual suspects. We are looking for missing USB > drivers, no permission to create a lockfile and no read permission for the > device. > > -- > Trent Jarvi > tjarvi at qbang.org > > > > --------------------------------- > Be a better sports nut! Let your teams follow you with Yahoo Mobile. Try it now. From netbeans at gatworks.com Mon Nov 26 06:53:02 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 26 Nov 2007 08:53:02 -0500 Subject: [Rxtx] #undef TIOCSERGETLSR on LINUX Message-ID: <474ACFBE.5050406@gatworks.com> So I undef'ed the define TIOCSERGETLSR on a linux box, I find that RXTX no longer works . this is a :{ It appears that the sigprocmask( SIG_SETMASK, &newmask, &oldmask ) at src/SerialImp.c:1427 seems to unblock more events than it should. On a linux box there are 2 other events that are blocked, and this code un-sets them, and the thread hangs. It also appears that this code is incomplete. Also, if you only add in the block for SIGCHLD ( which I think is what someone wanted ) , the code will (soon) core-dump ( or silently exit ). So has anyone run with this code ? From tjarvi at qbang.org Mon Nov 26 19:32:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 26 Nov 2007 19:32:54 -0700 (MST) Subject: [Rxtx] #undef TIOCSERGETLSR on LINUX In-Reply-To: <474ACFBE.5050406@gatworks.com> References: <474ACFBE.5050406@gatworks.com> Message-ID: On Mon, 26 Nov 2007, U. George wrote: > So I undef'ed the define TIOCSERGETLSR on a linux box, I find that RXTX > no longer works . this is a :{ > > It appears that the sigprocmask( SIG_SETMASK, &newmask, &oldmask ) at > src/SerialImp.c:1427 seems to unblock more events than it should. On a > linux box there are 2 other events that are blocked, and this code > un-sets them, and the thread hangs. > > It also appears that this code is incomplete. > Also, if you only add in the block for SIGCHLD ( which I think is what > someone wanted ) , the code will (soon) core-dump ( or silently exit ). > > So has anyone run with this code ? Hi George, The case when TIOCSERGETLSR is not defined is currently used on Solaris. Linux has used the TIOCSERGETLSR. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Nov 26 19:56:24 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 26 Nov 2007 21:56:24 -0500 Subject: [Rxtx] #undef TIOCSERGETLSR on LINUX In-Reply-To: References: <474ACFBE.5050406@gatworks.com> Message-ID: <474B8758.6010006@gatworks.com> Technically, with, or without TIOCSERGETLSR it *SHOULD* work the same. Still does not explain the SIGSEGV on the current development code Trent Jarvi wrote: > On Mon, 26 Nov 2007, U. George wrote: > >> So I undef'ed the define TIOCSERGETLSR on a linux box, I find that RXTX >> no longer works . this is a :{ From Joshua.Gerdes at xerox.com Tue Nov 27 16:00:07 2007 From: Joshua.Gerdes at xerox.com (Gerdes, Joshua) Date: Tue, 27 Nov 2007 15:00:07 -0800 Subject: [Rxtx] Trying to use RXTX Message-ID: Hello, I've been using Java for a little while, but am no master. This is my story: I'm trying to write a simple program that will use RXTX to open a serial port on com4, read from it and write to it. I must be doing something wrong because this doesn't seem to be working - I sort of hodge-podged this together from an example that was on the rxtx website. Basically I call the connect method I wrote, that seems to work (no exceptions atleast), I call writeSerial method, and though I don't know for sure if this works it doesn't throw any exceptions, but then I try calling readSerial and never get anything. Can anyone tell me why this isn't working? I must just be doing something flat out wrong. I know that my serial device responds fine when communicated to - I've checked it on a serial terminal. Also, what is considered the end of the input stream? I nabbed this from an example and wonder when the while loop in readSerial will end. /******************************************** * name: readSerial * description: reads from serial port until \0? * arguments: none * returns: read bytes from serial port *******************************************/ private byte [] readSerial() throws IOException{ byte [] buffer = new byte [128]; //read until end of stream. whats considered the end? int len = -1; while ( ( len = serialIn.read(buffer)) > -1 ); return(buffer); } /******************************************** * name: writeSerial * description: writes to serial port until * arguments: String to write * returns: none *******************************************/ private void writeSerial(String data) throws IOException{ byte [] buffer = data.getBytes(); serialOut.write(buffer); } /******************************************** * name: connect * description: opens serial port. * arguments: Com port name * returns: none *******************************************/ void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(9600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE); serialIn = serialPort.getInputStream(); serialOut = serialPort.getOutputStream(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } /******************************************** * name: closeSerial * description: close serial port. * arguments: none * returns: none *******************************************/ private void closeSerial() throws IOException{ serialIn.close(); serialOut.close(); } //some globals private InputStream serialIn; private OutputStream serialOut; -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071127/b9b8cae8/attachment-0002.html From tjarvi at qbang.org Tue Nov 27 21:45:07 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Nov 2007 21:45:07 -0700 (MST) Subject: [Rxtx] Trying to use RXTX In-Reply-To: References: Message-ID: On Tue, 27 Nov 2007, Gerdes, Joshua wrote: > Hello, > > I've been using Java for a little while, but am no master. This is my > story: > > I'm trying to write a simple program that will use RXTX to open a serial > port on com4, read from it and write to it. I must be doing something > wrong because this doesn't seem to be working - I sort of hodge-podged > this together from an example that was on the rxtx website. Basically I > call the connect method I wrote, that seems to work (no exceptions > atleast), I call writeSerial method, and though I don't know for sure if > this works it doesn't throw any exceptions, but then I try calling > readSerial and never get anything. Can anyone tell me why this isn't > working? I must just be doing something flat out wrong. I know that my > serial device responds fine when communicated to - I've checked it on a > serial terminal. Also, what is considered the end of the input stream? I > nabbed this from an example and wonder when the while loop in readSerial > will end. > It is hard to tell for sure without seeing main(). Here are a few hints. Sometimes when you try to communicate with a device, the white space is important. Perhaps the device knows that you are done transmitting a message when it reads a new line. Maybe it is a null character. Maybe you typed the same string into the terminal and then hit not thinking that was a character too. Serial communication can now go 3 Mb/sec with the right hardware but most of use don't have that :). Don't read right after you right. You can look at the bytes available with tha API. You can wait for bytes available events. Give the electrons a running head start if in doubt; they have been doing this since the 1960's and need a break now and then. The exact behavior of read depends upon the timeout and threshold. A 0 timeout and 0 threshold should block. There is no end of to a stream. Some terminals consider control-d the EOF and close. That is always the interesting part of serial communication. Often you end up creating some sort of packet based communication to know when you are done reading. Other times, you eat a byte at a time and make some decision. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 27 22:40:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Nov 2007 22:40:41 -0700 (MST) Subject: [Rxtx] #undef TIOCSERGETLSR on LINUX In-Reply-To: <474B8758.6010006@gatworks.com> References: <474ACFBE.5050406@gatworks.com> <474B8758.6010006@gatworks.com> Message-ID: Hi George, The last time I saw a segv it was related to 64 bit processors and how we stored pointers. Could you describe your system a bit and the serial device being used? I might just make sure I have access to one before the next release. I agree that doing an undef on TIOCSERGETLSR is a good thing to try. But given the afterthought/reaction nature of the ifdefs in rxtx, I would not put it past silly preprocessing mistakes that may be as simple as you don't have a Solaris machine or have a Linux machine and we didn't handle that case right. The ifdefs go both ways there. It is possible to attach gdb to the jvm. HP and IBM have published some info on that that google can find. Usually when rxtx segv's it is so blatant, the eventThread does not even start. I've usually just sprinkled some debug messages then stared at the sillyness. The Linux code should not be hard to figure out with an example system. The w32 issues have been what takes me time to figure out. On Mon, 26 Nov 2007, U. George wrote: > Technically, with, or without TIOCSERGETLSR it *SHOULD* work the same. > Still does not explain the SIGSEGV on the current development code > > Trent Jarvi wrote: >> On Mon, 26 Nov 2007, U. George wrote: >> >>> So I undef'ed the define TIOCSERGETLSR on a linux box, I find that RXTX >>> no longer works . this is a :{ > From netbeans at gatworks.com Wed Nov 28 07:16:17 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 28 Nov 2007 09:16:17 -0500 Subject: [Rxtx] #undef TIOCSERGETLSR on LINUX In-Reply-To: References: <474ACFBE.5050406@gatworks.com> <474B8758.6010006@gatworks.com> Message-ID: <474D7831.5010300@gatworks.com> Box is a PIII laptop, with a USB 1 port. Device is a serialUSB device ( as per linux/redhat ) Debugging is not terribly easy on LINUX when there are pthreads involved. Its not getting easier when SUN/java has placed extensive hooks in catching and logging ( catchable ) events. for example this logfile excerp: > # > # An unexpected error has been detected by Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0xb50ad67b, pid=4291, tid=16386 > # > # Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, sharing) > # Problematic frame: > # C [librxtxSerial.so+0x567b] Java_gnu_io_RXTXPort_interruptEventLoop+0xd3 > # > # If you would like to submit a bug report, please visit: > # http://java.sun.com/webapps/bugreport/crash.jsp > # > > --------------- T H R E A D --------------- > > Current thread (0x08291800): JavaThread "main" [_thread_in_native, id=4293] > > siginfo:si_signo=11, si_errno=0, si_code=1, si_addr=0xb50a77a0 > There are more java magical switches to aid in debugging, but they appear to be undocumented. So I have to go back to some old e-mails Right now I think its the SIGABRT that is sent a second time ( the first is caught ) to interrupt the drain_loop thread. > > The Linux code should not be hard to figure out with an example system. > The w32 issues have been what takes me time to figure out. From dwippermann at gmx.net Wed Nov 28 08:47:04 2007 From: dwippermann at gmx.net (Daniel Wippermann) Date: Wed, 28 Nov 2007 16:47:04 +0100 Subject: [Rxtx] Dual Core Problem In-Reply-To: References: Message-ID: Hi all, > I am struggling with an application that uses RXTX 2.1.7 and has been > working reliably in the past. When this program runs on a dual-core DELL > (Intel T2500), strange things happen with the RS232 communication. The > application is missing incoming characters and also often freezes when > trying to close the serial port. I highly suspect a threading problem > and was wondering if a) anybody had run into a similar problem with dual > core processors and b) if there is a list of does and dont's when it > comes to RXTX and threads. I just stumbled over the same "freeze" of the application while trying to "close()" the RXTXPort. In this rare circumstances the "IOLocked" variable of the RXTXPort class still has a value greater than 0 although no action is pending. That makes the close() method sleep forever in expectation of some other thread to end its work... I believe this is caused by the "IOLocked++" and "IOLocked--" instructions not being synchronized. I suspect that in a multi-core- CPU environment there is a chance that this instructions may interfere if two threads are operating on the same port, but in different CPU cores. In my example the monitor thread is reading the port, while the main thread, that opened the port, is writing to it. I just changed my application so that every port handling method call is done from within a synchronized method or block. I have not observed another freeze since then, although I did an extensive stress test. But I think it would be nice if you could do the synchronisation from within the library in a future release. Best regards, Daniel From keithvz at verizon.net Thu Nov 1 08:08:58 2007 From: keithvz at verizon.net (Keith) Date: Thu, 01 Nov 2007 10:08:58 -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: <4729DDFA.7080206@verizon.net> Trent Jarvi wrote: > 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? Well, I honestly don't know how all this fits together. I think it's just a matter of enabling the right flow control option within the standard serial framework to tell the device driver, "HEY START USING DTR/DSR FOR FLOW CONTROL." If what UGeorge said,(about that type of nitty-gritty lead control being done within the device driver), is true, then this confirms my suspicion. I tried narrowing down within the Linux drivers what you are looking for, but I can't entirely tell wth I'm looking at. (virtual com port drivers -- they are included compiled by default with Ubuntu, source included) http://www.ftdichip.com/Drivers/VCP/Linux/ftdi_sio.tar.gz Hahahaa, they make a reference to DTR flow control being supported but say (UGH) in parenthesis. You can also use their direct device driver library on Ubuntu -- libftd2xx.so.0.4.13. No source code. http://www.ftdichip.com/Drivers/D2XX/Linux/libftd2xx0.4.13.tar.gz In that case, you make a call to their FT_SetFlowControl() function. FT_STATUS FT_SetFlowControl (FT_HANDLE ftHandle, USHORT usFlowControl, UCHAR uXon,UCHAR uXoff) Parameters ftHandle Handle of the device. usFlowControl Must be one of FT_FLOW_NONE, FT_FLOW_RTS_CTS, ****FT_FLOW_DTR_DSR**** or FT_FLOW_XON_XOFF. uXon Character used to signal Xon. Only used if flow control is FT_FLOW_XON_XOFF. uXoff Character used to signal Xoff. Only used if flow control is FT_FLOW_XON_XOFF. This is from their programming guide http://www.ftdichip.com/Documents/ProgramGuides/D2XXPG34.pdf I actually want to take this a step further and say that I think the flow control is actually handled right on the device itself in hardware/firmware. It's enabled through the device driver, but I think the maintaining of buffers, asserting/deasserting of leads, etc is handled by the device. For the time being, I've switched to jd2xx, https://jd2xx.dev.java.net/ and http://bleyer.org/jd2xx/ These are Java wrappers for the device driver libraries. It allows almost direct access to the well-documented device drivers from Java. I hope this helps Keith From tjarvi at qbang.org Thu Nov 1 11:09:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:09:51 -0600 (MDT) 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: Hi Martin, What I usually have done is allow changes that do not impact working software including changes to methods not documented in CommAPI (which remain undocumented in rxtx) and fixes to known problems in the documented portions. That way if you use the documented API, the releases should only become better with time. If you use the undocumented portions, the behavior is not as predictable but open for improvement. On Wed, 31 Oct 2007, 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 >> > From tjarvi at qbang.org Thu Nov 1 11:15:52 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:15:52 -0600 (MDT) 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: I too use rxtx in commercial products. The problem I've been trying to address while bringing the server back was how to make it possible for hobby folks to build the same software as companies so we can move rxtx along a little faster. Exposing internal tools is not an option at this time, the public rxtx builds have been done on my home machine which has drives hanging out of it all over the place dying one at a time. This isn't maintainable. I'm currently looking at the possibility of making an S3 image available on Amazon's EC. These are machines you can rent for ~10 cents an hour which is more than enough to build rxtx. The S3 image is not changed when people use it so everyone has the same starting point. With this, we could all build rxtx for ~20 platforms for a small price and eliminate tool issues. On Wed, 31 Oct 2007, Greg Johnson wrote: > 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 tjarvi at qbang.org Thu Nov 1 11:19:55 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:19:55 -0600 (MDT) 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: On Wed, 31 Oct 2007, 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. I was helping Dmitry do the Mac OS X port without access to a machine when we put that in. In the archives there is information (easily found with google on Apple's site) that describes how their API (and others) can determine if a port is used and ignore it. I think these changes are in CVS but need to confirm. The bottom line is that rxtx should not have used lock files on Mac. It was just ignorance of the system on my part. -- Trent Jarvi tjarvi at qbang.org From fabioanjos at gmail.com Thu Nov 1 12:35:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Thu, 1 Nov 2007 15:35:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Hi, I was using SerialEventListener in my project. But, as was said here, id doesnt work very well with virtual serial ports. So, I changed the strategy using the code posted here in this thread: try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > 0) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } The thing is that in my tests I could notice that in.read(buffer) never blocks. Even when there's nothing to read. Instead of blocking when there's nothing to read it returns 0. So, my questions are: 1. Am I doing something wrong? 2. If not, wouldnt this decrease performance? (the thread would be locked in a loop that does nothing.) 3. Is there a better way to do the job? Thanks in advance!! F?bio -------- On 10/31/07, Andre-John Mas wrote: > > > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/0aee59d0/attachment-0030.html From ajmas at sympatico.ca Thu Nov 1 16:07:55 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Nov 2007 18:07:55 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Message-ID: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From sarah_662005 at yahoo.com Thu Nov 1 17:10:05 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Thu, 1 Nov 2007 16:10:05 -0700 (PDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Message-ID: <351433.37166.qm@web55814.mail.re3.yahoo.com> Thank you very much for your help. Now the application works fine. the serialEvent gets triggered. Rxtx is cool! ----- Original Message ---- From: Andre-John Mas To: Sara Hugh ; RXTX Developers and Users Sent: Wednesday, October 31, 2007 9:55:45 AM Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered 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 __________________________________________________ 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/20071101/4a86bea6/attachment-0030.html From tjarvi at qbang.org Thu Nov 1 17:58:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 17:58:02 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx Message-ID: The rxtx.org site is primarily interested in the hobby aspects of rxtx. Obviously, there are some companies following the work too. These interests bring larger workflows and concerns about details hobby folks may not care about. They also bring many more users. I know the company I work for has a quality engineering effort going on which includes rxtx. While the server was down, I was contacted by another company that was missing the binaries for their testing. Several people have mentioned concerns about a stable release for like reasons. Would there be interest on the quality side of the coin to get together? It could be just sharing email's with each other or a seperate list for QE/QA. I can not say for sure, but we may be able to share some of our efforts/results that could help keep rxtx releases stable. -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Fri Nov 2 01:42:55 2007 From: scldad at sdc.com.au (Stephen Davies) Date: Fri, 2 Nov 2007 18:12:55 +1030 Subject: [Rxtx] Multiple modems Message-ID: <200711021812.56047.scldad@sdc.com.au> This may or may not be related to the Multiple Ports thread. I have an application which uses rxtx on Linux (via cron jobs) to connect multiple modems to remote sensing devices. The application works fine most of the time but occasionally fails to connect if two (or more) connection attempts happen at about the same time. When it fails, it looks as if it may get confused as to which port it is talking to. The app has a "base" component that looks for an available port, opens it and then creates an input thread and an output thread for the connection and data transfer. The "base" component uses this code: // loop round all known ports until one is available. Give up after three minutes Counter ptimeout = new Counter(); while(!portFound && ptimeout.elapsed() < 180000) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // special case. ttyS0 is not available to us on this server. if (!portId.isCurrentlyOwned() && !portId.getName().equals("/dev/ttyS0")) { gLog.debug(lognm + ": Found port " + portId.getName()); try { serialPort = (RXTXPort) portId.open("AguaModem", 10000); } catch (Exception e) { gLog.error(lognm + ": Port " + portId.getName() + " will not open."); gLog.error(e.getMessage()); continue; } AguaModem aguamodem = new AguaModem(); portFound = true; break; } gLog.debug(lognm + ": Port " + portId.getName() + " is busy"); } } } I am wondering about the isCurrentlyOwned method. Does this actually tell me whether a port is currently being used by another process? TIA, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From fabioanjos at gmail.com Fri Nov 2 04:59:58 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 07:59:58 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Message-ID: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/9009eb1d/attachment-0030.html From netbeans at gatworks.com Fri Nov 2 06:28:13 2007 From: netbeans at gatworks.com (U. George) Date: Fri, 02 Nov 2007 08:28:13 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <472B17DD.1050508@gatworks.com> It should normally block ( unless eof / event ) . so its a :{ whats the device ( to recreate if possible ) and how do u open. > My question is, is there a way to make in.read block the thead until > there's something to read? > From fabioanjos at gmail.com Fri Nov 2 06:34:46 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 09:34:46 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > On 11/1/07, Andre-John Mas wrote: > > > > Fabio, > > > > Turns out there was a small error in my example. The test should be: > > > > (numBytes = in.read(buffer)) > -1 > > > > This is because -1 indicates an end of file (end of data stream) > > > > Andre > > > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > > > Hi, > > > > > > I was using SerialEventListener in my project. But, as was said > > > here, id doesnt work very well with virtual serial ports. > > > So, I changed the strategy using the code posted here in this thread: > > > > > > try{ > > > in = port.getInputStream(); > > > out = port.getOutputStream(); > > > int numBytes = 0; > > > while(active){ > > > > > > byte[] buffer = new byte[10]; > > > > > > while ( (numBytes = in.read(buffer)) > 0) > > > { > > > String dataValue = new String(buffer,0,numBytes); > > > processInput(dataValue); > > > } > > > > > > if(numBytes==-1){ > > > break; > > > } > > > > > > Thread.sleep(50); > > > } > > > > > > }catch(IOException e){ > > > logger.info("falha de comunicacao "+ > > > getReceptor().getPort() ); > > > > > > }catch(InterruptedException e){ > > > logger.info ("Interrompendo leitura da porta "+ > > > getReceptor().getPort() ); > > > } > > > > > > The thing is that in my tests I could notice that in.read(buffer) > > > never blocks. Even when there's nothing to read. Instead of blocking > > > when there's nothing to read it returns 0. > > > > > > So, my questions are: > > > > > > 1. Am I doing something wrong? > > > 2. If not, wouldnt this decrease performance? (the thread would be > > > locked in a loop that does nothing.) > > > 3. Is there a better way to do the job? > > > > > > Thanks in advance!! > > > > > > F?bio > > > -------- > > > > > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > > 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 > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > > > > > -- > > > Atenciosamente, > > > F?bio Cristiano dos Anjos > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/5306c4b1/attachment-0030.html From nick.circelli at infrasafe.com Fri Nov 2 07:01:17 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Fri, 2 Nov 2007 08:01:17 -0500 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com><29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com><90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca><29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Message-ID: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> I'm pretty sure that not blocking has to do with you virtual ports. Cause it should block. Maybe you should try: while ((numBytes = in.available()) > 0) { If (numBytes > buffer.length) { numBytes = buffer.length; // in case you have buffer overflow } numBytes = in.read(buffer, 0 , numBytes)); String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } Also, just for optimization, I'd move that byte[] buffer = new byte[10]; out of the while since you don't need to reallocate it every iteration. ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of F?bio Cristiano dos Anjos Sent: Friday, November 02, 2007 8:35 AM To: RXTX Developers and Users Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream (); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas < ajmas at sympatico.ca > wrote: Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info ("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Atenciosamente, F?bio Cristiano dos Anjos -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/4de7f6a3/attachment-0030.html From fabioanjos at gmail.com Fri Nov 2 07:36:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 10:36:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> Message-ID: <29788b250711020636q1588c88fgaa5e27f5504164fb@mail.gmail.com> Hi Nick, Actually, it doesnt block for physical ports too. And, the method avaiable does not block either, so when there's nothing avaiable the loop ends and the thread stops lintening to the port. But I did some more test with serialEventListener, and now its working. I realy dont know what I've done to get it working. I just start woking as soon as I decided to test it again. It was said here that serialEventListener is not reliable for virtual serial ports. Is there another way to read it, without compromising performance? Tanks again!! F?bio ------- On 11/2/07, Nick Circelli wrote: > > I'm pretty sure that not blocking has to do with you virtual ports. > Cause it should block. > > Maybe you should try: > > > > while ((numBytes = in.available()) > 0) > > { > > If (numBytes > buffer.length) { > > numBytes = buffer.length; // in case you have buffer overflow > > } > > numBytes = in.read(buffer, 0 , numBytes)); > > String dataValue = new String(buffer,0,numBytes,"ASCII"); > > processInput(dataValue); > > } > > > > Also, just for optimization, I'd move that byte[] buffer = new > byte[10]; > > out of the while since you don't need to reallocate it every iteration. > > > ------------------------------ > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On Behalf > Of *F?bio Cristiano dos Anjos > *Sent:* Friday, November 02, 2007 8:35 AM > *To:* RXTX Developers and Users > *Subject:* Re: [Rxtx] serialEvent(SerialPortEvent event) never be > triggered > > > > Hi, > > I think i missunderstand something here. > The code you post here was meant to be used inside serialEvent method, > right? > > The think is, that i cannot user SerialEventListener to read serial ports, > because i need to read virual serial ports and id does not behaves well, as > said here before. serialEvent is never triggered. > > So what I quit using SerialEventListener and created a thread to listen to > the port: > > public void run(){ > try{ > in = port.getInputStream(); > out = port.getOutputStream (); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new > String(buffer,0,numBytes,"ASCII"); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ getReceptor().getPort() > ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > } > > > So, the problem is that in.read(buffer) always returns 0 when there is > nothing to read, instead of blocking the flow, and the thread becames locked > in the loop. > > I hope you can help me solve this. > > Thanks in advance! > > F?bio > -------- > > On 11/2/07, *F?bio Cristiano dos Anjos* wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > > > On 11/1/07, *Andre-John Mas* < ajmas at sympatico.ca> wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info ("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/571df6ea/attachment-0029.html From tjarvi at qbang.org Fri Nov 2 08:32:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Nov 2007 08:32:15 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: References: Message-ID: On Fri, 2 Nov 2007, Greg Johnson wrote: > Hi Trent, folks, > Having a single rxtx that is suitable for commercial uses and hobbyists both > would be a great idea? Perhaps it would be worth submitting rxtx as a > proposal to Codehaus - they not only provide excellent tools (Jira (bug > tracker), Confluence (wiki)) but also support build management ( > maestro, continuum, bamboo). Relying on your personal machine (btw, frii.com > / rxtx.org is down again?) seems like a burden you shouldn't have to shoulder > alone. Hi Greg, There may be a little confusion here. There is no need to have two seperate rxtx releases. What I'm trying to encourage is a discussion between some of the people responsible for making sure rxtx does not break their products each release. Usually these people are interested in testing a set of functionality their product depends upon. They do not work with rxtx code but rather traps to catch when rxtx developers break something. This goes on all the time in isolated labs. There are many services that offer to do various pieces of a project for you if you... Anyone is free to do the 'if you' portion with rxtx and see how it goes. I'm actually interested in doing less of that than more. The rxtx.org work I do just happens to overlap with other things I do for personal/family use. The reason I suggest the amazon solution is that anyone can take full control of the environment for a day and it costs less than a package of gum without causing harm to what anyone else is doing. I assume the down question was with respect to a mod_security setting that has been resolved. If not, please post a url to the problem. -- Trent Jarvi tjarvi at qbang.org From nsayer at kfu.com Sat Nov 3 20:17:49 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 19:17:49 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? Message-ID: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Has anyone got RXTX working with an app under Leopard? My app hangs on port open (it works fine with Tiger). The relevant thread looks like this in the activity monitor: 1536 JVM_InvokeMethod 1536 0x48ccd0 1536 0x46f8a0 1536 0x4c3ff4 1536 0x4c4284 1536 0x357d160 1536 0x357faac 1536 Java_gnu_io_RXTXPort_open 1536 open $NOCANCEL$UNIX2003 1536 open $NOCANCEL$UNIX2003 From ajmas at sympatico.ca Sat Nov 3 22:02:04 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 00:02:04 -0400 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> RXTX works for me with Leopard. I am currently using it communicate with a Bluetooth GPS. What computer and device are you trying to use? Is the driver for your serial device compatible with MacOS X 10.5? Andre On 3-Nov-07, at 22:17 , Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From nsayer at kfu.com Sat Nov 3 22:17:47 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 21:17:47 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> Message-ID: <1720F723-3643-438C-B3AB-E09A67536977@kfu.com> On Nov 3, 2007, at 9:02 PM, Andre-John Mas wrote: > RXTX works for me with Leopard. I am currently using it communicate > with a Bluetooth GPS. > > What computer and device are you trying to use? Is the driver for > your serial device compatible with MacOS X 10.5? An Intel mac mini The FTDI USB serial driver an XMPCR, which is just a fancy serial controlled radio and an FTDI usb-to-serial chip I've successfully used the FTDI driver with another FTDI device in another context. > > > Andre > > On 3-Nov-07, at 22:17 , Nick Sayer wrote: > >> Has anyone got RXTX working with an app under Leopard? >> >> My app hangs on port open (it works fine with Tiger). The relevant >> thread looks like this in the activity monitor: >> >> 1536 JVM_InvokeMethod >> 1536 0x48ccd0 >> 1536 0x46f8a0 >> 1536 0x4c3ff4 >> 1536 0x4c4284 >> 1536 0x357d160 >> 1536 0x357faac >> 1536 >> Java_gnu_io_RXTXPort_open >> 1536 open >> $NOCANCEL$UNIX2003 >> 1536 open >> $NOCANCEL$UNIX2003 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From racecar at gmail.com Sat Nov 3 22:25:53 2007 From: racecar at gmail.com (Kevin Mateo Lim) Date: Sat, 3 Nov 2007 21:25:53 -0700 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: Message-ID: I am alternating between two errors. After i run the macosx_setup.command, "everyone" is set to Read only in /var/lock. I notice in the terminal that the group for these perms is _uucp, not uucp. In that state, I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 check_group_uucp(): error testing lock file creation Error details:Permission deniedcheck_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException : Error inside Serial.() at processing.serial.Serial.errorMessage(Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.( Serial.java:102) at Temporary_829_3245.setup(Temporary_829_3245.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java :690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) Then, I hand edit the "everyone" permissions for /var/lock/ to Read and Write (note /var/spool/uucp is Read/Write in all cases, and doesn't change). I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX uucp_lock() /var/lock/LK.003.009.000 is there gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException: Error inside Serial.() at processing.serial.Serial.errorMessage (Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.(Serial.java:102) at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java:690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) See here: http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071103/f1a2c467/attachment-0028.html From greg.johnson at manchester.ac.uk Sun Nov 4 02:31:13 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sun, 4 Nov 2007 10:31:13 +0100 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <28B5E0A0-0802-4C74-AC21-87ED35F3B9A2@manchester.ac.uk> Hi Nick, I also had problems initially with Leopard, but it was resolved by reinstalling the serial USB driver (FTDI in my case). The symptoms were a non-detection of any ports (but I twigged when I tried ZTerm and it had the same problem). Good luck! Cheers, greg PS I did a "Archive and install" which may be the reason my FTDI driver had disappeared - I don't think the driver has changed for 10.5 ------------------------------------------------------------------------- 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 4 Nov 2007, at 03:17, Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Sun Nov 4 13:01:12 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 15:01:12 -0500 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: Message-ID: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Hi, You will need to get the 2.1-8 code from CVS. See the FAQ for more information: http://rxtx.qbang.org/wiki/index.php/FAQ Andre On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > I am alternating between two errors. > > After i run the macosx_setup.command, "everyone" is set to Read only > in /var/lock. I notice in the terminal that the group for these > perms is _uucp, not uucp. > > In that state, I get this error: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > check_group_uucp(): error testing lock file creation Error > details:Permission deniedcheck_lock_status: No permission to create > lock file. > please see: How can I use Lock Files with rxtx? in INSTALL > gnu.io.PortInUseException: Unknown Application > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > java.lang.RuntimeException : Error inside Serial.() > > at processing.serial.Serial.errorMessage(Serial.java:583) > > at processing.serial.Serial.(Serial.java:148) > > at processing.serial.Serial.( Serial.java:102) > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > at processing.core.PApplet.run(PApplet.java:1556) > > at java.lang.Thread.run(Thread.java:613) > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > and Write (note /var/spool/uucp is Read/Write in all cases, and > doesn't change). I get this error: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > gnu.io.PortInUseException: Unknown Application > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > java.lang.RuntimeException: Error inside Serial.() > > at processing.serial.Serial.errorMessage (Serial.java:583) > > at processing.serial.Serial.(Serial.java:148) > > at processing.serial.Serial.(Serial.java:102) > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > at processing.core.PApplet.run(PApplet.java:1556) > > at java.lang.Thread.run(Thread.java:613) > > See here: > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From netbeans at gatworks.com Sun Nov 4 14:33:35 2007 From: netbeans at gatworks.com (U. George) Date: Sun, 04 Nov 2007 16:33:35 -0500 Subject: [Rxtx] #ifndef TIOCSERGETLSR Message-ID: <472E3AAF.7050709@gatworks.com> For Linux, it seems that you need the code for both *having* a TIOCSERGETLSR, and *not having* a TIOCSERGETLSR. Maybe the ioctl exists system wide, but not necessarily for the device driver itself ( always returns -1 ) . Are there systems that have a *functioning* TIOCSERGETLSR for all their devices? Then this would be the case where the "#ifndef TIOCSERGETLSR" directive could be useful is eliminating the unnecessary code and tests. And for those systems that dont have a TIOCSERGETLSR, then the code for TIOCSERGETLSR can be eliminated. It would be a simple case to have, as a foundation, all the code to simulate the missing TIOCSERGETLSR ioctl. If the system does have the ioctl, then that code can be ifdef'd in, and co-exist with the functionality of the code that simulates the missing TIOCSERGETLSR ioctl. From racecar at gmail.com Sun Nov 4 17:30:19 2007 From: racecar at gmail.com (Kevin Mateo Lim) Date: Sun, 4 Nov 2007 17:30:19 -0700 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: the README.OSX reads: Put libSerial.jnilib in the directory of the application (the JavaVM will find it there). Add RXTXComm.jar to the application classpath or include the classes in the application jar. (Some applications already include the RXTX classes in their application jar, in which case only the file libSerial.jnilib is required). I can't find libSerial.jnilib I put librxtxSerial.jnilib into my Processing /libraries/serial/library/ directory. Yet it still sees the old version: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 On 11/4/07, Andre-John Mas wrote: > > Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > 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/20071104/c0a83f91/attachment-0027.html From ajmas at sympatico.ca Sun Nov 4 17:41:47 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 19:41:47 -0500 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> If you are wanting it to be available for all applications, - for all users: /Library/Java/Extensions - for your user: ~/Library/Java/Extensions Or just for your application, then it should be in the same directory from which yo are launching your application. If you are getting the 2.1-8 source, then the library built is called: librxtxSerial.jnilib despite what the docs say. Andre On 4-Nov-07, at 19:30 , Kevin Mateo Lim wrote: > > the README.OSX reads: > Put > libSerial.jnilib > in the directory of the application (the JavaVM will find it there). > Add > RXTXComm.jar > to the application classpath or include the classes in the > application jar. > (Some applications already include the RXTX classes in their > application jar, > in which case only the file libSerial.jnilib is required). > > > I can't find libSerial.jnilib > I put librxtxSerial.jnilib into my Processing /libraries/serial/ > library/ directory. > > Yet it still sees the old version: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > On 11/4/07, Andre-John Mas wrote: Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial .(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay (PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > From bschlining at gmail.com Sun Nov 4 19:46:23 2007 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 4 Nov 2007 18:46:23 -0800 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> Message-ID: > > Or just for your application, then it should be in the same directory > from which yo are launching your application. Just wanted to add one more way of specifying the native lib location... If you don't want to define it globally by putting it in /Library/Java/Extensions (and you don't, it's a very very bad practice) you can also specify the location of the native library when starting the JVM by specifying the 'java.library.path' property. For example: java -Djava.library.path=/Path/To/Directory/With/RXTX/Library YourMainClass -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071104/c5af6980/attachment-0027.html From greg.johnson at manchester.ac.uk Mon Nov 5 01:39:02 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Mon, 5 Nov 2007 09:39:02 +0100 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: The 2.1-8 code reports 2.1-7, hence your (and my) confusion. But as long as you've removed all traces of the old library, it really _is_ 2.1-8. And if you specify the library path to the VM, don't make my mistake (on OSX at least) - you need to respecify the entire library path it had by default, as the command line argument replaces the path, rather than appending to it. 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 5 Nov 2007, at 01:30, Kevin Mateo Lim wrote: > > the README.OSX reads: > Put > libSerial.jnilib > in the directory of the application (the JavaVM will find it there). > Add > RXTXComm.jar > to the application classpath or include the classes in the > application jar. > (Some applications already include the RXTX classes in their > application jar, > in which case only the file libSerial.jnilib is required). > > > I can't find libSerial.jnilib > I put librxtxSerial.jnilib into my Processing /libraries/serial/ > library/ directory. > > Yet it still sees the old version: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > On 11/4/07, Andre-John Mas wrote: > Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial .(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay (PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > 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 HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071105/7f50506d/attachment-0027.html From cyrille.dumont at tatexpress.fr Mon Nov 5 05:46:03 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 05 Nov 2007 13:46:03 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: References: <472727F1.1000704@tatexpress.fr> Message-ID: <472F108B.2090101@tatexpress.fr> Thanks a lot for your solution ... but I'm not a expert in JAVA ... (sorry) For the moment I've this function : """ public void serialEvent(SerialPortEvent e) { StringBuffer inputBuffer = new StringBuffer(); int newData = 0; switch (e.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } //-- Manag. Data from Scanner this.MngDataScanner(inputBuffer.toString()); break; case SerialPortEvent.BI:; //-- Break Received } } """ How can I do what you write ? ( maybe a simple ex ? ) PS : I don't know the PDF417 size (could be, for example, 338 char, or 500 ... ; what I know is that it can't be more than 800 char) Thanks in advance. Best regards. Trent Jarvi a ?crit : > 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 Martin.Oberhuber at windriver.com Mon Nov 5 08:47:50 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 5 Nov 2007 16:47:50 +0100 Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> Hi Trent, are the interestes of hobbyists really so different from commercial ones? Both should be interested in high quality and innovation the like. I haven't seen too many Open Source projects from the "inside" but those that I have seen did not have separate mailing lists for quality/testing/qa versus innovation/development. What I have seen with the Open Source projects that one would call "successful" is a good deal of process around automated builds, automated unit tests, predictable release dates and milestones, and policies around commiting/contributing/reviewing changes. I think that all of these benefit commercial users and hobbyists the like. If you were just asking about who's interested in discussing changes to foster more quality, count me in. I'm just not sure whether discussing these on a separate mailing list or other channel is the right thing to do. Cheers, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From toupsz at cs.tamu.edu Tue Nov 6 14:27:04 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 15:27:04 -0600 Subject: [Rxtx] reading TTL level signals from serial? Message-ID: Dear RXTX community- I've been using RXTX to handle communicating with several hardware devices in Java (a GPS and some custom audio circuitry for my dissertation work). I have a new, high-accuracy GPS which only communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there any way to communicate with this device using RXTX, perhaps by modding the native code for Windows? If so, does anyone have any tips on how to do it? Has it perhaps already been done? Another option is for me to invert / amplify the signal in hardware, but this is difficult for me to pull off due to the sensitivity of the electronics involved...I'll likely end up using a much less accurate piece of equipment rather than go that far! If anyone could help out, I'd really appreciate it! Thanks! -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/b6c59c2b/attachment-0025.html From netbeans at gatworks.com Tue Nov 6 14:55:22 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 06 Nov 2007 16:55:22 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: Message-ID: <4730E2CA.3090009@gatworks.com> This is really a hardware issue. Is there any device ( ie the serial port ) on your computer that will accept the voltage signals ( and load ) that your device produces? Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it happen safely ( ie u dont cook the GPS device ) I have a new, high-accuracy GPS which only > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there > any way to communicate with this device using RXTX, From toupsz at cs.tamu.edu Tue Nov 6 15:14:01 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 16:14:01 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4730E2CA.3090009@gatworks.com> References: <4730E2CA.3090009@gatworks.com> Message-ID: Actually, the device runs over USB, but shows up as a virtual serial port and is outputting these signals. The software that comes with the device (a u-blox ANTARIS 4 eval kit) is able to communicate. RXTX is able to detect and properly configure the port, but does not get any of the data from it. :-/ It seems like there must be some way to do it (obviously, ublox knows how)... -Zach On Nov 6, 2007 3:55 PM, U. George wrote: > This is really a hardware issue. > Is there any device ( ie the serial port ) on your computer that will > accept the voltage signals ( and load ) that your device produces? > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it > happen safely ( ie u dont cook the GPS device ) > > > I have a new, high-accuracy GPS which only > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there > > any way to communicate with this device using RXTX, > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/15ae7a0b/attachment-0025.html From keithvz at verizon.net Tue Nov 6 16:16:55 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 06 Nov 2007 18:16:55 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> Message-ID: <4730F5E7.1030704@verizon.net> Zach Toups wrote: > On Nov 6, 2007 3:55 PM, U. George > wrote: > > This is really a hardware issue. > Is there any device ( ie the serial port ) on your computer that will > accept the voltage signals ( and load ) that your device produces? > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it > happen safely ( ie u dont cook the GPS device ) > > > I have a new, high-accuracy GPS which only > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is > there > > any way to communicate with this device using RXTX, > _______________________________________________ As UGeorge intimated, it's a hardware issue. If your device outputs TTL level voltages, and your USB to serial converter is RS-232, then you've got a physical hardware differences. Inverted leads and voltage issues are mainly the problem. MAXIM makes a neat little chip called the MAX233 (better than the 232, no extern caps required) You can't solve this in software. Now, there are TTL level compatible USB to serial converters available, I happen to be using one right now. This unit below is from a UK company (there might be sources in the US) http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm Parallax makes one that does 3.3 and 5v http://www.parallax.com/detail.asp?product_id=32201 (but only supports RX, TX, GND, AND DTR towards device) (i've tested a variant of the unit above, and it works with RXTX) In both cases, you'll need some creative wiring depending on the interface on your GPS. Hope this helps Keith From toupsz at cs.tamu.edu Tue Nov 6 16:53:01 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 17:53:01 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4730F5E7.1030704@verizon.net> References: <4730E2CA.3090009@gatworks.com> <4730F5E7.1030704@verizon.net> Message-ID: Yeah...I used an FTDI chip to handle USB/serial conversion on the audio equipment I built. I'm leery of trying to build a board for this ublox GPS due to all the grounding/shielding issues around it. Anyway, I apreciate the help...just sad that I can't handle the problem in software! Ublox did send me the source code for their USB drivers...but as a Java programmer, it's a bit tough for me to sort out. ;) Thanks again! -Zach On Nov 6, 2007 5:16 PM, Keith Monahan wrote: > Zach Toups wrote: > > > On Nov 6, 2007 3:55 PM, U. George > > wrote: > > > > This is really a hardware issue. > > Is there any device ( ie the serial port ) on your computer that > will > > accept the voltage signals ( and load ) that your device produces? > > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make > it > > happen safely ( ie u dont cook the GPS device ) > > > > > > I have a new, high-accuracy GPS which only > > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is > > there > > > any way to communicate with this device using RXTX, > > _______________________________________________ > > As UGeorge intimated, it's a hardware issue. > > If your device outputs TTL level voltages, and your USB to serial > converter is RS-232, then you've got a physical hardware differences. > Inverted leads and voltage issues are mainly the problem. MAXIM makes a > neat little chip called the MAX233 (better than the 232, no extern caps > required) > > You can't solve this in software. > > Now, there are TTL level compatible USB to serial converters available, > I happen to be using one right now. > > This unit below is from a UK company (there might be sources in the US) > > http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm > > Parallax makes one that does 3.3 and 5v > > http://www.parallax.com/detail.asp?product_id=32201 > (but only supports RX, TX, GND, AND DTR towards device) > > (i've tested a variant of the unit above, and it works with RXTX) > > In both cases, you'll need some creative wiring depending on the > interface on your GPS. > > Hope this helps > > Keith > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/06e88ad4/attachment-0025.html From netbeans at gatworks.com Tue Nov 6 17:14:01 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 06 Nov 2007 19:14:01 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> <4730F5E7.1030704@verizon.net> Message-ID: <47310349.5000406@gatworks.com> what gps chipset do u have? > Ublox did send me the source code for their USB drivers...but as a Java > programmer, it's a bit tough for me to sort out. ;) From Steffen.DETTMER at ingenico.com Wed Nov 7 03:10:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 7 Nov 2007 11:10:01 +0100 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> Message-ID: <20071107101000.GN10978@elberon.bln.de.ingenico.com> * Zach Toups wrote on Tue, Nov 06, 2007 at 16:14 -0600: > Actually, the device runs over USB, but shows up as a virtual > serial port and is outputting these signals. Ahh, so what you want is to use rxtx on the serial port that is created by the driver and mapped maybe as some COM8 or whatever? I this case then IMHO it would be no hardware question but maybe a problem in your application, or some driver or indeed a rxtx issue. > The software that > comes with the device (a u-blox ANTARIS 4 eval kit) is able to > communicate. Is it sure that this software is really using the virtual serial port and only this port? oki, Steffen -- About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Wed Nov 7 04:59:10 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 06:59:10 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <20071107101000.GN10978@elberon.bln.de.ingenico.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> Message-ID: <4731A88E.6080705@gatworks.com> >> The software that >> comes with the device (a u-blox ANTARIS 4 eval kit) is able to >> communicate. > > Is it sure that this software is really using the virtual serial > port and only this port? > I have tried to read the docs. I have yet to find any explanation on a (windoz) device driver for this device ( the usb device ). That magic is not explained. For a developer thats important magic. Maybe a call to their support team is in order? From netbeans at gatworks.com Wed Nov 7 05:01:38 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 07:01:38 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <20071107101000.GN10978@elberon.bln.de.ingenico.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> Message-ID: <4731A922.7@gatworks.com> Steffen DETTMER wrote: > * Zach Toups wrote on Tue, Nov 06, 2007 at 16:14 -0600: >> Actually, the device runs over USB, but shows up as a virtual BTW: it seems that I am not getting all the Rxtx mail. Is there still a problem? From toupsz at cs.tamu.edu Wed Nov 7 07:36:20 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Wed, 7 Nov 2007 08:36:20 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4731A88E.6080705@gatworks.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> <4731A88E.6080705@gatworks.com> Message-ID: When I emailed them about this issue, they sent me their WinCE drivers, which are apparently based on this open source driver: http://www.yetanotherhomepage.com/j7xx/j7xx.html?/j7xx/software/util/usbdriver.html These include srcdll, and x86 subfolders, though it's not 100% clear to me that these are useful. The ublox communication suite appears to only communicate with serial ports...I've communicated with the ublox on two different comm ports (one with the serial adapter plugged into the serial port, one with the main USB connection), as well as a Garmin bluetooth GPS (which comes up as a bluetooth serial device). I'm not well versed in code this close to the hardware, but it seems to me that if you're running a virtual serial port, then you're virtually controlling the "voltages" that come in on this "port"...so why would they be "ttl level"? :-/ Shouldn't the USB driver be able to interpret the signals in whatever way it wants and just supply software with the binary interpretation? Thanks for all the help, guys, it's really appreciated! -Zach On Nov 7, 2007 5:59 AM, U. George wrote: > > >> The software that > >> comes with the device (a u-blox ANTARIS 4 eval kit) is able to > >> communicate. > > > > Is it sure that this software is really using the virtual serial > > port and only this port? > > > > I have tried to read the docs. I have yet to find any explanation on a > (windoz) device driver for this device ( the usb device ). That magic > is not explained. For a developer thats important magic. Maybe a call > to their support team is in order? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071107/18a13314/attachment-0024.html From netbeans at gatworks.com Wed Nov 7 08:55:55 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 10:55:55 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> <4731A88E.6080705@gatworks.com> Message-ID: <4731E00B.9030902@gatworks.com> There are 2 components to talking to hardware. There is the electrical specification, and then there is the software specification. there is the rs232 specification, parallel port specification, and the USB electrical specification. Generally these are used to plug in the various devices, and hook up electrically. Then there is the software side. There is the device driver, a software component that sits somewhere in the kernel that handles the USB ( in your case ) controller. The device driver generally does not care about the electrical component. There are various chips that handle USB signals, and these chips have I/O addresses so that signals and data can be properly routed. There is also the side that communicates to the user via the COM port device-name. The device driver that you mentioned is for the "Support PL2303 serial chip". This device driver, which hopefully works, handles the USB chip, and eventually recognzes the gps device, and hopefully creates an COM port so the user can open up and communicate. These are a lot of "HOPES". Since u have the web address of the device driver, and developer, I would think that the developer, and any docs, might be better able to help u to first determine if the GPS device is recognized, and the COM port ( maybe its called by another name ) is created, as per documentation. > > These include srcdll, and x86 subfolders, though it's not 100% clear to > me that these are useful. From tjarvi at qbang.org Sat Nov 10 17:46:13 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Nov 2007 17:46:13 -0700 (MST) Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 5 Nov 2007, Oberhuber, Martin wrote: > Hi Trent, > > are the interestes of hobbyists really so different > from commercial ones? Both should be interested in > high quality and innovation the like. > > I haven't seen too many Open Source projects from the > "inside" but those that I have seen did not have > separate mailing lists for quality/testing/qa > versus innovation/development. > > What I have seen with the Open Source projects that > one would call "successful" is a good deal of > process around automated builds, automated unit > tests, predictable release dates and milestones, > and policies around commiting/contributing/reviewing > changes. > > I think that all of these benefit commercial users > and hobbyists the like. > > If you were just asking about who's interested in > discussing changes to foster more quality, count > me in. I'm just not sure whether discussing these > on a separate mailing list or other channel is the > right thing to do. > Hi Martin, There are two issues I'm thinking about. The first is the generic unit testing and quality initiatives required to move rxtx forward. The second is the inevitable fact that rxtx connects to external hardware. The discussion deals with a different set of problems. Here is a simple example of what I'm getting at. We have the capability of setting custom baud rates in rxtx. We may be interested in seeing regressions in rxtx, the C library or the kernel. Some people may be doing some tests with loopback connections. These will always work even if the baud rate is not set to the expected value. Some people may use null modems between two ports. This may be able to catch the problem but not always. Will the build machines be able to test this? (no - for a few reasons) Will people be trying to catch these type of regressions? (yes) What type of coverage does the community have in the end? (?) We could include the discussions in the same list or another equally open list that may be of interest to some folks that deal with these types of problems on a regular basis. -- Trent Jarvi tjarvi at qbang.org From timlow84 at gmail.com Mon Nov 12 00:31:17 2007 From: timlow84 at gmail.com (Timothy Low) Date: Mon, 12 Nov 2007 15:31:17 +0800 Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> Message-ID: <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> ---------- Forwarded message ---------- From: Timothy Low Date: Nov 12, 2007 3:02 PM Subject: Building RXTX From Source To: taj at www.linux.org.uk Cc: ferdinand.tang at tangs.net, Timothy Low , chweehuat.ng at tangs.net Hi Trent, I tried building RXTX from source, and I got this error. I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm trying to get the necessary ".so" files to use for my serial port communication through java. My linux kernal information is: *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 x86_64 x86_64 x86_64 GNU/Linux* I'll most glad if you can provide me some direction on this. Thanks ! ---------------- [root at smsgateway rxtx-2.0-7pre1]# ./configure checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu configure: WARNING: Trying libtool. If the following fails install libtool checking for gcc... gcc checking for C compiler default output... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking for ld used by GCC... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking for a sed that does not truncate output... /bin/sed checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking command to parse /usr/bin/nm -B output... ok checking how to run the C preprocessor... gcc -E checking for egrep... grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for ranlib... ranlib checking for strip... strip checking for objdir... .libs checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.lo... yes checking if gcc supports -fno-rtti -fno-exceptions... yes checking whether the linker (/usr/bin/ld) supports shared libraries... yes checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking dynamic linker characteristics... GNU/Linux ld.so checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no checking whether -lc should be explicitly linked in... no creating libtool checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking for style of include used by make... GNU checking dependency style of gcc... none checking fcntl.h usability... yes checking fcntl.h presence... yes checking for fcntl.h... yes checking sys/fcntl.h usability... yes checking sys/fcntl.h presence... yes checking for sys/fcntl.h... yes checking sys/file.h usability... yes checking sys/file.h presence... yes checking for sys/file.h... yes checking sys/time.h usability... yes checking sys/time.h presence... yes checking for sys/time.h... yes checking sys/signal.h usability... yes checking sys/signal.h presence... yes checking for sys/signal.h... yes checking signal.h usability... yes checking signal.h presence... yes checking for signal.h.. . yes checking termios.h usability... yes checking termios.h presence... yes checking for termios.h... yes checking asm/termbits.h usability... yes checking asm/termbits.h presence... yes checking for asm/termbits.h... yes checking grp.h usability... yes checking grp.h presence... yes checking for grp.h... yes checking pwd.h usability... yes checking pwd.h presence... yes checking for pwd.h... yes checking whether gcc needs -traditional... no checking whether to enable maintainer-specific portions of Makefiles... no /usr/java/jdk1.5.0_13 configure: WARNING: using JAVA_HOME environmental variable adjusted java.home is /usr/java/jdk1.5.0_13 checking os.name Linux checking os.arch i386 checking java.vendor Sun Microsystems Inc. checking java.version 1.5.0_13 checking os.version 2.6.18-8.el5xen comm.jar appears to be installed already. conftest.c: In function 'main': conftest.c:6: warning: incompatible implicit declaration of built-in function 'printf' conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:6: error: (Each undeclared identifier is reported only once conftest.c:6: error: for each function it appears in.) conftest.c:6: error: expected ')' before string constant conftest.c:7: warning: incompatible implicit declaration of built-in function 'exit' ./configure: line 9649: ./conftest: No such file or directory ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected conftest.c: In function 'main': conftest.c:5: warning: incompatible implicit declaration of built-in function 'printf' conftest.c:10: warning: incompatible implicit declaration of built-in function 'exit' configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status : config.h is unchanged config.status: executing depfiles commands [root at smsgateway rxtx-2.0-7pre1]# make install /usr/java/jdk1.5.0_13/bin/javac -classpath .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d /home/jboss/sources/rxtx- 2.0-7pre1/ -O /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java /home/jboss/sources/rxtx-2.0-7pre1/./src/UnSupportedLoggerException.java /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o /home/jboss/sources/rxtx-2.0-7pre1/x86_64-unknown-linux-gnu/SerialImp.lo /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'init_threads': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: cast from pointer to integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_nativeDrain': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: cast to pointer from integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'read_byte_array': /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: cast to pointer from integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_readArray': /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: comparison is always false due to limited range of data type /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_readTerminatedArray': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: comparison is always false due to limited range of data type mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial- 2.0.7pre1.* gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so -o .libs/librxtxSerial-2.0.7pre1.so (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.0.7pre1.so librxtxSerial.so) creating librxtxSerial.la (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la librxtxSerial.la) gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/ParallelImp.lo /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function 'Java_javax_comm_LPRPort_readArray': /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: comparison is always false due to limited range of data type rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* .libs/librxtxParallel-2.0.7pre1.* gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so -o .libs/librxtxParallel- 2.0.7pre1.so (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.0.7pre1.so librxtxParallel.so) creating librxtxParallel.la (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la librxtxParallel.la) make all-am make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' libtool: install: `x86_64-unknown-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 ------------- Regards, Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071112/27758c3c/attachment-0020.html From tjarvi at qbang.org Mon Nov 12 01:02:09 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Nov 2007 01:02:09 -0700 (MST) Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> Message-ID: On Mon, 12 Nov 2007, Timothy Low wrote: > > Hi Trent, Hi Tim, Comments are inline. As I mentioned off the list, rxtx 2.0 is on the edge of deprecation. We can get it working but this is not the path of least resistance for future work. You will probably need to bounce another round of questions off the list. The following is intended to isolate the problem. > > I tried building RXTX from source, and I got this error. > > > I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm trying > to get the necessary ".so" files to use for my serial port communication > through java. > My linux kernal information is: > > *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 x86_64 > x86_64 x86_64 GNU/Linux* > > I'll most glad if you can provide me some direction on this. Thanks ! > > ---------------- > [root at smsgateway rxtx-2.0-7pre1]# ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > checking for C compiler default output... a.out > checking whether the C compiler works... yes > checking whether we are cross compiling... no > checking for suffix of executables... > checking for suffix of object files... o > checking whether we are using the GNU C compiler... yes > checking whether gcc accepts -g... yes > checking for gcc option to accept ANSI C... none needed > checking for ld used by GCC... /usr/bin/ld > checking if the linker (/usr/bin/ld) is GNU ld... yes > checking for /usr/bin/ld option to reload object files... -r > checking for BSD-compatible nm... /usr/bin/nm -B > checking for a sed that does not truncate output... /bin/sed > checking whether ln -s works... yes > checking how to recognise dependent libraries... pass_all > checking command to parse /usr/bin/nm -B output... ok > checking how to run the C preprocessor... gcc -E > checking for egrep... grep -E > checking for ANSI C header files... yes > checking for sys/types.h... yes > checking for sys/stat.h... yes > checking for stdlib.h... yes > checking for string.h... yes > checking for memory.h... yes > checking for strings.h... yes > checking for inttypes.h... yes > checking for stdint.h... yes > checking for unistd.h... yes > checking dlfcn.h usability... yes > checking dlfcn.h presence... yes > checking for dlfcn.h... yes > checking for ranlib... ranlib > checking for strip... strip > checking for objdir... .libs > checking for gcc option to produce PIC... -fPIC > checking if gcc PIC flag -fPIC works... yes > checking if gcc static flag -static works... yes > checking if gcc supports -c -o file.o... yes > checking if gcc supports -c -o file.lo... yes > checking if gcc supports -fno-rtti -fno-exceptions... yes > checking whether the linker (/usr/bin/ld) supports shared libraries... yes > checking how to hardcode library paths into programs... immediate > checking whether stripping libraries is possible... yes > checking dynamic linker characteristics... GNU/Linux ld.so > checking if libtool supports shared libraries... yes > checking whether to build shared libraries... yes > checking whether to build static libraries... no > checking whether -lc should be explicitly linked in... no > creating libtool > checking for a BSD-compatible install... /usr/bin/install -c > checking whether build environment is sane... yes > checking for gawk... gawk > checking whether make sets $(MAKE)... yes > checking for style of include used by make... GNU > checking dependency style of gcc... none > checking fcntl.h usability... yes > checking fcntl.h presence... yes > checking for fcntl.h... yes > checking sys/fcntl.h usability... yes > checking sys/fcntl.h presence... yes > checking for sys/fcntl.h... yes > checking sys/file.h usability... yes > checking sys/file.h presence... yes > checking for sys/file.h... yes > checking sys/time.h usability... yes > checking sys/time.h presence... yes > checking for sys/time.h... yes > checking sys/signal.h usability... yes > checking sys/signal.h presence... yes > checking for sys/signal.h... yes > checking signal.h usability... yes > checking signal.h presence... yes > checking for signal.h.. . yes > checking termios.h usability... yes > checking termios.h presence... yes > checking for termios.h... yes > checking asm/termbits.h usability... yes > checking asm/termbits.h presence... yes > checking for asm/termbits.h... yes > checking grp.h usability... yes > checking grp.h presence... yes > checking for grp.h... yes > checking pwd.h usability... yes > checking pwd.h presence... yes > checking for pwd.h... yes > checking whether gcc needs -traditional... no > checking whether to enable maintainer-specific portions of Makefiles... no > /usr/java/jdk1.5.0_13 > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /usr/java/jdk1.5.0_13 > checking os.name Linux > checking os.arch i386 > checking java.vendor Sun Microsystems Inc. > checking java.version 1.5.0_13 > checking os.version 2.6.18-8.el5xen > comm.jar appears to be installed already. > conftest.c: In function 'main': > conftest.c:6: warning: incompatible implicit declaration of built-in > function 'printf' > conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:6: error: (Each undeclared identifier is reported only once > conftest.c:6: error: for each function it appears in.) > conftest.c:6: error: expected ')' before string constant This is an outdated kernel version check for when headers and kernels could cause problems for rxtx. If we made it past this, then you are OK. > conftest.c:7: warning: incompatible implicit declaration of built-in > function 'exit' > ./configure: line 9649: ./conftest: No such file or directory > ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected It blew up but continues.. > conftest.c: In function 'main': > conftest.c:5: warning: incompatible implicit declaration of built-in > function 'printf' > conftest.c:10: warning: incompatible implicit declaration of built-in > function 'exit' > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status : config.h is unchanged > config.status: executing depfiles commands > [root at smsgateway rxtx-2.0-7pre1]# make install > /usr/java/jdk1.5.0_13/bin/javac -classpath > .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d > /home/jboss/sources/rxtx- 2.0-7pre1/ -O > /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java > /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/UnSupportedLoggerException.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java > Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or > overrides a deprecated API. > Note: Recompile with -Xlint:deprecation for details. > /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* The java jar should be fine now. You may need to change the source files as mentioned below. > gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. > -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g > -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o > /home/jboss/sources/rxtx-2.0-7pre1/x86_64-unknown-linux-gnu/SerialImp.lo > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'init_threads': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: cast > from pointer to integer of different size > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_nativeDrain': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: cast to > pointer from integer of different size > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'read_byte_array': > /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: cast to > pointer from integer of different size As I recall, this was caused by pointers (now 64 bit rather than 32 bit) being stored in java ints (jints). I would look at the diff between the CVS 2.1 SerialImp.c and RXTXPort.java files against 2.0. We did fix those issues. You have a .so file but the different pointer sizes will cause runtime errors. > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_readArray': > /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: > comparison is always false due to limited range of data type > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_readTerminatedArray': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: > comparison is always false due to limited range of data type > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial- > 2.0.7pre1.* > gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so -o > .libs/librxtxSerial-2.0.7pre1.so > (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.0.7pre1.so > librxtxSerial.so) > creating librxtxSerial.la > (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la > librxtxSerial.la) > gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. > -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g > -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o > /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/ParallelImp.lo > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function > 'Java_javax_comm_LPRPort_readArray': > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: > comparison is always false due to limited range of data type > rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* > .libs/librxtxParallel-2.0.7pre1.* > gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so -o > .libs/librxtxParallel- 2.0.7pre1.so > (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.0.7pre1.so > librxtxParallel.so) > creating librxtxParallel.la > (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la > librxtxParallel.la) > make all-am > make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' > make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' > libtool: install: `x86_64-unknown-linux-gnu' must be an absolute directory > name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 A libtool change? Assuming you ran configure && make install in /home/jboss/sources/rxtx- 2.0-7pre1, libtool is looking for /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/.libs/librxtxSerial-2.0.7pre1.so. I think you have this? The file is just being copied to ~JAVA/jre/lib/$(JAVA_ARCH). -- Trent Jarvi tjarvi at qbang.org From sarah_662005 at yahoo.com Mon Nov 12 16:10:28 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Mon, 12 Nov 2007 15:10:28 -0800 (PST) Subject: [Rxtx] [urgent] device's power off detection Message-ID: <766782.10076.qm@web55803.mail.re3.yahoo.com> Hello all, I have a small application built on top of rxtx api. This application can retrieve the incoming data from a device through a port. The device can be powered off after the port get closed from the application. I have been trying a couple of hours to find a way to detect the power switching from device. If anyone knows how to handle it through rxtx, could you please give me a help? Thank you very much. r, Sara ____________________________________________________________________________________ Get easy, one-click access to your favorites. Make Yahoo! your homepage. http://www.yahoo.com/r/hs -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071112/4599f3ec/attachment-0019.html From netbeans at gatworks.com Mon Nov 12 17:52:22 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 12 Nov 2007 19:52:22 -0500 Subject: [Rxtx] [urgent] device's power off detection In-Reply-To: <766782.10076.qm@web55803.mail.re3.yahoo.com> References: <766782.10076.qm@web55803.mail.re3.yahoo.com> Message-ID: <4738F546.5010101@gatworks.com> Not sure what u are asking for. Are u asking for a way to detect if the device is OFF? Are u asking how to power off the device - via software ? Is it a Serial device? is it a parallel device? is it a usb device? Sara Hugh wrote: > Hello all, > I have a small application built on top of rxtx api. This application > can retrieve the incoming data from a device through a port. The device > can be powered off after the port get closed from the application. I > have been trying a couple of hours to find a way to detect the power > switching from device. If anyone knows how to handle it through rxtx, > could you please give me a help? Thank you very much. From tjarvi at qbang.org Mon Nov 12 22:48:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Nov 2007 22:48:11 -0700 (MST) Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711120225x562db8cbxb750767ade3b0d73@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> <900c6ba90711120031p66edc001ted76f7ba24e34b98@mail.gmail.com> <900c6ba90711120225x562db8cbxb750767ade3b0d73@mail.gmail.com> Message-ID: Hi Tim, The gnu.io namespace looks just like the javax.comm 2.0 namespace. There are additional (discouraged) undocumented methods in gnu.io that you need not use. We just used the different namespace to avoid poluting Sun's by mistake and to make sure we stayed off any potential licensing related radar. Usuaully, you just change your imports and make sure you do not use the javax.comm namespace for anything like exception handling. As I mentioned off the list, there are no issues with rxtx going through the JSR process to be more Sun friendly other than time. rxtx has no hidden intentions there; anything that does not work like CommAPI 2.0 documented is a bug. The reason we do not support CommAPI 2.1 is technical in nature and is in the list archives as well as the front page of www.rxtx.org. On Mon, 12 Nov 2007, Timothy Low wrote: > Hi Trent, > > I'll move to use a JDK1.5 64-bit version... but do I need to make any source > code changes to use the package (gnu.io) in the RTXTcomm.jar instead of the > ones from the javacomm api ? > > > Regards, > Tim > > On Nov 12, 2007 5:22 PM, Trent Jarvi wrote: > >> >> Hi Tim, >> >> I see a couple things here. >> >> First your jdk is for i686 yet the library is compiled on a x86_64 >> machine. You may try passing configure the --target=i686-unknown-linux to >> try using the i686 backend to gcc if it is available. Or move to the 64 >> bit jdk. >> >> The other error I see is again the moved UTF_RELEASE define that we need >> to fix. You can probably get around that with: >> >> make -DUTF_RELEASE=`uname -r` >> >> even more simple would be to just specify the serial library which should >> be in configure --help. >> >> You can remove the UTF_RELEASE check from configure by editing >> configure.in, searching for the simple C program check and deleting it. >> Running autoconf after that will regenerate a new configure without the >> check. >> >> Note that you should remove the previous native libraries >> (librxtxSerial.so) when moving from rxtx 2.0 to 2.1. These are compiled >> for different namespaces (javax.comm/gnu.io). >> >> On Mon, 12 Nov 2007, Timothy Low wrote: >> >>> *Hi Trent, >>> >>> I moved on to rxtx 2.1.7r2, and updated my jre to 1.6.0 (64-bit)... I >> tried >>> the following 2 methods: >>> >>> (1) using the rxtx 2.1.7 binaries from the RXTX website* >>> *Are these binaries suitable for a 64-bit OS ? There mentioning of the >>> gnu.io that you've talked about previously...* >>> ------ >>> [root at smsgateway sources]# java -Djava.library.path=/usr/lib PortLister >>> Experimental: JNI_OnLoad called. >>> >>> java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion >>> ()Ljava/lang/String; >>> at gnu.io.RXTXCommDriver.nativeGetVersion(Native Method) >>> at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:85) >>> at java.lang.Class.forName0(Native Method) >>> at java.lang.Class.forName(Unknown Source) >>> at javax.comm.CommPortIdentifier.loadDriver( >> CommPortIdentifier.java >>> :237) >>> at javax.comm.CommPortIdentifier.(CommPortIdentifier.java >>> :109) >>> at PortLister.(PortLister.java:6) >>> at PortLister.main(PortLister.java:25) >>> Exception in thread "main" java.lang.UnsatisfiedLinkError: >>> com.sun.comm.SunrayInfo.isSessionActive()Z >>> at com.sun.comm.SunrayInfo.isSessionActive(Native Method) >>> at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java >> :155) >>> at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java >>> :100) >>> at javax.comm.CommPortIdentifier.(CommPortIdentifier.java >>> :138) >>> at PortLister.(PortLister.java:6) >>> at PortLister.main(PortLister.java:25) >>> >>> ------ >>> >>> (2) compiling the rxtx 2.1.7 from source >>> *but i got the following error while running ./configure and make all* >>> >>> ------ >>> [root at smsgateway rxtx-2.1-7r2]# ./configure >>> checking build system type... x86_64-unknown-linux-gnu >>> checking host system type... x86_64-unknown-linux-gnu >>> checking target system type... x86_64-unknown-linux-gnu >>> configure: WARNING: Trying libtool. If the following fails install >> libtool >>> checking for gcc... gcc >>> checking for C compiler default output file name... a.out >>> checking whether the C compiler works... yes >>> checking whether we are cross compiling... no >>> checking for suffix of executables... >>> checking for suffix of object files... o >>> checking whether we are using the GNU C compiler... yes >>> checking whether gcc accepts -g... yes >>> checking for gcc option to accept ANSI C... none needed >>> checking for a sed that does not truncate output... /bin/sed >>> checking for egrep... grep -E >>> checking for ld used by gcc... /usr/bin/ld >>> checking if the linker (/usr/bin/ld) is GNU ld... yes >>> checking for /usr/bin/ld option to reload object files... -r >>> checking for BSD-compatible nm... /usr/bin/nm -B >>> checking whether ln -s works... yes >>> checking how to recognise dependent libraries... pass_all >>> checking how to run the C preprocessor... gcc -E >>> checking for ANSI C header files... yes >>> checking for sys/types.h... yes >>> checking for sys/stat.h... yes >>> checking for stdlib.h... yes >>> checking for string.h... yes >>> checking for memory.h... yes >>> checking for strings.h... yes >>> checking for inttypes.h... yes >>> checking for stdint.h... yes >>> checking for unistd.h... yes >>> checking dlfcn.h usability... yes >>> checking dlfcn.h presence... yes >>> checking for dlfcn.h... yes >>> checking for g++... g++ >>> checking whether we are using the GNU C++ compiler... yes >>> checking whether g++ accepts -g... yes >>> checking how to run the C++ preprocessor... g++ -E >>> checking for g77... no >>> checking for f77... no >>> checking for xlf... no >>> checking for frt... no >>> checking for pgf77... no >>> checking for fort77... no >>> checking for fl32... no >>> checking for af77... no >>> checking for f90... no >>> checking for xlf90... no >>> checking for pgf90... no >>> checking for epcf90... no >>> checking for f95... f95 >>> checking whether we are using the GNU Fortran 77 compiler... yes >>> checking whether f95 accepts -g... yes >>> checking the maximum length of command line arguments... 32768 >>> checking command to parse /usr/bin/nm -B output from gcc object... ok >>> checking for objdir... .libs >>> checking for ar... ar >>> checking for ranlib... ranlib >>> checking for strip... strip >>> checking if gcc static flag works... yes >>> checking if gcc supports -fno-rtti -fno-exceptions... no >>> checking for gcc option to produce PIC... -fPIC >>> checking if gcc PIC flag -fPIC works... yes >>> checking if gcc supports -c -o file.o... yes >>> checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking whether -lc should be explicitly linked in... no >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> checking if libtool supports shared libraries... yes >>> checking whether to build shared libraries... yes >>> checking whether to build static libraries... no >>> configure: creating libtool >>> appending configuration tag "CXX" to libtool >>> checking for ld used by g++... /usr/bin/ld -m elf_x86_64 >>> checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes >>> checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking for g++ option to produce PIC... -fPIC >>> checking if g++ PIC flag -fPIC works... yes >>> checking if g++ supports -c -o file.o... yes >>> checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> appending configuration tag "F77" to libtool >>> checking if libtool supports shared libraries... yes >>> checking whether to build shared libraries... yes >>> checking whether to build static libraries... no >>> checking for f95 option to produce PIC... -fPIC >>> checking if f95 PIC flag -fPIC works... yes >>> checking if f95 supports -c -o file.o... yes >>> checking whether the f95 linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> checking for a BSD-compatible install... /usr/bin/install -c >>> checking whether build environment is sane... yes >>> checking for gawk... gawk >>> checking whether make sets $(MAKE)... yes >>> checking for style of include used by make... GNU >>> checking dependency style of gcc... none >>> checking dependency style of g++... none >>> checking fcntl.h usability... yes >>> checking fcntl.h presence... yes >>> checking for fcntl.h... yes >>> checking sys/fcntl.h usability... yes >>> checking sys/fcntl.h presence... yes >>> checking for sys/fcntl.h... yes >>> checking sys/file.h usability... yes >>> checking sys/file.h presence... yes >>> checking for sys/file.h... yes >>> checking sys/time.h usability... yes >>> checking sys/time.h presence... yes >>> checking for sys/time.h... yes >>> checking sys/signal.h usability... yes >>> checking sys/signal.h presence... yes >>> checking for sys/signal.h... yes >>> checking signal.h usability... yes >>> checking signal.h presence... yes >>> checking for signal.h... yes >>> checking termios.h usability... yes >>> checking termios.h presence... yes >>> checking for termios.h... yes >>> checking grp.h usability... yes >>> checking grp.h presence... yes >>> checking for grp.h... yes >>> checking pwd.h usability... yes >>> checking pwd.h presence... yes >>> checking for pwd.h... yes >>> checking whether gcc needs -traditional... no >>> checking whether to enable maintainer-specific portions of Makefiles... >> no >>> /usr/java/jdk1.5.0_13 >>> configure: WARNING: using JAVA_HOME environmental variable >>> adjusted java.home is /usr/java/jdk1.5.0_13 >>> checking os.name Linux >>> checking os.arch i386 >>> checking java.vendor Sun Microsystems Inc. >>> checking java.version 1.5.0_13 >>> checking os.version 2.6.18-8.el5xen >>> conftest.c: In function 'main': >>> conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this >> function) >>> conftest.c:8: error: (Each undeclared identifier is reported only once >>> conftest.c:8: error: for each function it appears in.) >>> conftest.c:8: error: expected ')' before string constant >>> ./configure: line 21462: ./conftest: No such file or directory >>> ./configure: line 21462: test: 2.6.18-8.el5xen: unary operator expected >>> configure: creating ./config.status >>> config.status: creating Makefile >>> config.status: creating config.h >>> config.status: executing depfiles commands >>> [root at smsgateway rxtx-2.1-7r2]# make install >>> /usr/java/jdk1.5.0_13/bin/javac -classpath .:/home/jboss/sources/rxtx- >>> >> 2.1-7r2:/home/jboss/sources/rxtx-2.1-7r2/src:/usr/java/jdk1.5.0_13/jre/lib/ext/RXTXcomm.jar-d >>> /home/jboss/sources/rxtx- >>> 2.1-7r2/ -O -source 1.3 -target 1.3 >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommDriver.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortEnumerator.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortIdentifier.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortOwnershipListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Configure.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2C.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/I2CPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/LPRPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/NoSuchPortException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/PortInUseException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Raw.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/RawPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RawPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RawPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/RS485PortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485PortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485Port.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXCommDriver.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXVersion.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPort.java >>> /home/jboss/sources/rxtx-2.1-7r2 >> /./src/UnsupportedCommOperationException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/UnSupportedLoggerException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Zystem.java >>> /usr/java/jdk1.5.0_13/bin/javah -classpath .:/home/jboss/sources/rxtx- >>> >> 2.1-7r2:/home/jboss/sources/rxtx-2.1-7r2/src:/usr/java/jdk1.5.0_13/jre/lib/ext/RXTXcomm.jar-d >>> x86_64-unknown-linux-gnu -jni `(for i in CommDriver CommPortEnumerator >>> CommPortIdentifier CommPort CommPortOwnershipListener Configure I2C >>> I2CPortEvent I2CPortEventListener I2CPort LPRPort NoSuchPortException >>> ParallelPortEvent ParallelPortEventListener ParallelPort >> PortInUseException >>> Raw RawPortEvent RawPortEventListener RawPort RS485 RS485PortEvent >>> RS485PortEventListener RS485Port RXTXCommDriver RXTXPort RXTXVersion >>> SerialPortEvent SerialPortEventListener SerialPort >>> UnsupportedCommOperationException UnSupportedLoggerException Zystem;do \ >>> if grep > /dev/null native.*\( /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/$i.java; then \ >>> echo gnu.io.$i; \ >>> fi; \ >>> done)` >>> /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialImp.c -o >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo; >>> \ >>> if [ "Serial" = "Serial" ]; >>> then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxSerial.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxSerial.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo; >> \ >>> fi; \ >>> ) >>> mkdir /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/.libs >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/SerialImp.o >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/fuserImp.o >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c: In function >> 'show_user': >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c:238: warning: cast >> from >>> pointer to integer of different size >>> gcc -shared /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/SerialImp.o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/fuserImp.o >>> -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7.so -o >> .libs/librxtxSerial- >>> 2.1-7.so >>> (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.1-7.so >>> librxtxSerial.so) >>> creating librxtxSerial.la >>> (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la >>> librxtxSerial.la) >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelImp.c -o >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/ParallelImp.lo; >>> \ >>> if [ "Parallel" = "Serial" ]; >>> then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxParallel.la -rpath >>> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/ParallelImp.lo >>> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxParallel.la -rpath >>> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/ParallelImp.lo; >>> \ >>> fi; \ >>> ) >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >>> /x86_64-unknown-linux-gnu/.libs/ParallelImp.o >>> gcc -shared /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/ParallelImp.o >>> -lpthread -Wl,-soname -Wl,librxtxParallel-2.1-7.so -o >>> .libs/librxtxParallel-2.1-7.so >>> (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.1-7.so >>> librxtxParallel.so) >>> creating librxtxParallel.la >>> (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la >>> librxtxParallel.la) >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo; >>> \ >>> if [ "I2C" = "Serial" ]; then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxI2C.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo >>> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxI2C.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo; >>> \ >>> fi; \ >>> ) >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/.libs/I2CImp.o >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c: In function >>> 'Java_gnu_io_I2CPort_Initialize': >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: 'UTS_RELEASE' >>> undeclared (first use in this function) >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: (Each >> undeclared >>> identifier is reported only once >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: for each >> function >>> it appears in.) >>> libtool: link: `/home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/I2CImp.lo' >>> is not a valid libtool object >>> make: *** [x86_64-unknown-linux-gnu/librxtxI2C.la] Error 1 >>> >>> ------ >>> >>> >>> >>> On Nov 12, 2007 4:02 PM, Trent Jarvi wrote: >>> >>>> On Mon, 12 Nov 2007, Timothy Low wrote: >>>>> >>>>> Hi Trent, >>>> >>>> Hi Tim, >>>> >>>> Comments are inline. As I mentioned off the list, rxtx 2.0 is on the >> edge >>>> of deprecation. We can get it working but this is not the path of >> least >>>> resistance for future work. >>>> >>>> You will probably need to bounce another round of questions off the >> list. >>>> The following is intended to isolate the problem. >>>> >>>>> >>>>> I tried building RXTX from source, and I got this error. >>>>> >>>>> >>>>> I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm >>>> trying >>>>> to get the necessary ".so" files to use for my serial port >> communication >>>>> through java. >>>>> My linux kernal information is: >>>>> >>>>> *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 >>>> x86_64 >>>>> x86_64 x86_64 GNU/Linux* >>>>> >>>>> I'll most glad if you can provide me some direction on this. Thanks ! >>>>> >>>>> ---------------- >>>>> [root at smsgateway rxtx-2.0-7pre1]# ./configure >>>>> checking build system type... x86_64-unknown-linux-gnu >>>>> checking host system type... x86_64-unknown-linux-gnu >>>>> checking target system type... x86_64-unknown-linux-gnu >>>>> configure: WARNING: Trying libtool. If the following fails install >>>> libtool >>>>> checking for gcc... gcc >>>>> checking for C compiler default output... a.out >>>>> checking whether the C compiler works... yes >>>>> checking whether we are cross compiling... no >>>>> checking for suffix of executables... >>>>> checking for suffix of object files... o >>>>> checking whether we are using the GNU C compiler... yes >>>>> checking whether gcc accepts -g... yes >>>>> checking for gcc option to accept ANSI C... none needed >>>>> checking for ld used by GCC... /usr/bin/ld >>>>> checking if the linker (/usr/bin/ld) is GNU ld... yes >>>>> checking for /usr/bin/ld option to reload object files... -r >>>>> checking for BSD-compatible nm... /usr/bin/nm -B >>>>> checking for a sed that does not truncate output... /bin/sed >>>>> checking whether ln -s works... yes >>>>> checking how to recognise dependent libraries... pass_all >>>>> checking command to parse /usr/bin/nm -B output... ok >>>>> checking how to run the C preprocessor... gcc -E >>>>> checking for egrep... grep -E >>>>> checking for ANSI C header files... yes >>>>> checking for sys/types.h... yes >>>>> checking for sys/stat.h... yes >>>>> checking for stdlib.h... yes >>>>> checking for string.h... yes >>>>> checking for memory.h... yes >>>>> checking for strings.h... yes >>>>> checking for inttypes.h... yes >>>>> checking for stdint.h... yes >>>>> checking for unistd.h... yes >>>>> checking dlfcn.h usability... yes >>>>> checking dlfcn.h presence... yes >>>>> checking for dlfcn.h... yes >>>>> checking for ranlib... ranlib >>>>> checking for strip... strip >>>>> checking for objdir... .libs >>>>> checking for gcc option to produce PIC... -fPIC >>>>> checking if gcc PIC flag -fPIC works... yes >>>>> checking if gcc static flag -static works... yes >>>>> checking if gcc supports -c -o file.o... yes >>>>> checking if gcc supports -c -o file.lo... yes >>>>> checking if gcc supports -fno-rtti -fno-exceptions... yes >>>>> checking whether the linker (/usr/bin/ld) supports shared libraries... >>>> yes >>>>> checking how to hardcode library paths into programs... immediate >>>>> checking whether stripping libraries is possible... yes >>>>> checking dynamic linker characteristics... GNU/Linux ld.so >>>>> checking if libtool supports shared libraries... yes >>>>> checking whether to build shared libraries... yes >>>>> checking whether to build static libraries... no >>>>> checking whether -lc should be explicitly linked in... no >>>>> creating libtool >>>>> checking for a BSD-compatible install... /usr/bin/install -c >>>>> checking whether build environment is sane... yes >>>>> checking for gawk... gawk >>>>> checking whether make sets $(MAKE)... yes >>>>> checking for style of include used by make... GNU >>>>> checking dependency style of gcc... none >>>>> checking fcntl.h usability... yes >>>>> checking fcntl.h presence... yes >>>>> checking for fcntl.h... yes >>>>> checking sys/fcntl.h usability... yes >>>>> checking sys/fcntl.h presence... yes >>>>> checking for sys/fcntl.h... yes >>>>> checking sys/file.h usability... yes >>>>> checking sys/file.h presence... yes >>>>> checking for sys/file.h... yes >>>>> checking sys/time.h usability... yes >>>>> checking sys/time.h presence... yes >>>>> checking for sys/time.h... yes >>>>> checking sys/signal.h usability... yes >>>>> checking sys/signal.h presence... yes >>>>> checking for sys/signal.h... yes >>>>> checking signal.h usability... yes >>>>> checking signal.h presence... yes >>>>> checking for signal.h.. . yes >>>>> checking termios.h usability... yes >>>>> checking termios.h presence... yes >>>>> checking for termios.h... yes >>>>> checking asm/termbits.h usability... yes >>>>> checking asm/termbits.h presence... yes >>>>> checking for asm/termbits.h... yes >>>>> checking grp.h usability... yes >>>>> checking grp.h presence... yes >>>>> checking for grp.h... yes >>>>> checking pwd.h usability... yes >>>>> checking pwd.h presence... yes >>>>> checking for pwd.h... yes >>>>> checking whether gcc needs -traditional... no >>>>> checking whether to enable maintainer-specific portions of >> Makefiles... >>>> no >>>>> /usr/java/jdk1.5.0_13 >>>>> configure: WARNING: using JAVA_HOME environmental variable >>>>> adjusted java.home is /usr/java/jdk1.5.0_13 >>>>> checking os.name Linux >>>>> checking os.arch i386 >>>>> checking java.vendor Sun Microsystems Inc. >>>>> checking java.version 1.5.0_13 >>>>> checking os.version 2.6.18-8.el5xen >>>>> comm.jar appears to be installed already. >>>>> conftest.c: In function 'main': >>>>> conftest.c:6: warning: incompatible implicit declaration of built-in >>>>> function 'printf' >>>>> conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this >>>> function) >>>>> conftest.c:6: error: (Each undeclared identifier is reported only once >>>>> conftest.c:6: error: for each function it appears in.) >>>>> conftest.c:6: error: expected ')' before string constant >>>> >>>> >>>> This is an outdated kernel version check for when headers and kernels >>>> could cause problems for rxtx. If we made it past this, then you are >> OK. >>>> >>>> >>>>> conftest.c:7: warning: incompatible implicit declaration of built-in >>>>> function 'exit' >>>>> ./configure: line 9649: ./conftest: No such file or directory >>>>> ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected >>>> >>>> It blew up but continues.. >>>> >>>>> conftest.c: In function 'main': >>>>> conftest.c:5: warning: incompatible implicit declaration of built-in >>>>> function 'printf' >>>>> conftest.c:10: warning: incompatible implicit declaration of built-in >>>>> function 'exit' >>>>> configure: creating ./config.status >>>>> config.status: creating Makefile >>>>> config.status: creating config.h >>>>> config.status : config.h is unchanged >>>>> config.status: executing depfiles commands >>>>> [root at smsgateway rxtx-2.0-7pre1]# make install >>>>> /usr/java/jdk1.5.0_13/bin/javac -classpath >>>>> .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/ -O >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1 >> /./src/UnSupportedLoggerException.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java >>>>> Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or >>>>> overrides a deprecated API. >>>>> Note: Recompile with -Xlint:deprecation for details. >>>>> /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* >>>> >>>> >>>> The java jar should be fine now. You may need to change the source >> files >>>> as mentioned below. >>>> >>>>> gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu >> -I. >>>>> -I/usr/java/jdk1.5.0_13/include >> -I/usr/java/jdk1.5.0_13/include/./linux/ >>>> -g >>>>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o >>>>> /home/jboss/sources/rxtx-2.0-7pre1 >> /x86_64-unknown-linux-gnu/SerialImp.lo >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'init_threads': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: >>>> cast >>>>> from pointer to integer of different size >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_nativeDrain': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: >>>> cast to >>>>> pointer from integer of different size >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'read_byte_array': >>>>> /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: >>>> cast to >>>>> pointer from integer of different size >>>> >>>> >>>> As I recall, this was caused by pointers (now 64 bit rather than 32 >> bit) >>>> being stored in java ints (jints). I would look at the diff between >> the >>>> CVS 2.1 SerialImp.c and RXTXPort.java files against 2.0. We >>>> did fix those issues. >>>> >>>> You have a .so file but the different pointer sizes will cause runtime >>>> errors. >>>> >>>> >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_readArray': >>>>> /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: >>>>> comparison is always false due to limited range of data type >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_readTerminatedArray': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: >>>>> comparison is always false due to limited range of data type >>>>> mkdir .libs >>>>> rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* >> .libs/librxtxSerial- >>>>> 2.0.7pre1.* >>>>> gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so-o >>>>> .libs/librxtxSerial-2.0.7pre1.so >>>>> (cd .libs && rm -f librxtxSerial.so && ln -s >> librxtxSerial-2.0.7pre1.so >>>>> librxtxSerial.so) >>>>> creating librxtxSerial.la >>>>> (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la >>>>> librxtxSerial.la) >>>>> gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu >> -I. >>>>> -I/usr/java/jdk1.5.0_13/include >> -I/usr/java/jdk1.5.0_13/include/./linux/ >>>> -g >>>>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o >>>>> /home/jboss/sources/rxtx- 2.0-7pre1 >>>> /x86_64-unknown-linux-gnu/ParallelImp.lo >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function >>>>> 'Java_javax_comm_LPRPort_readArray': >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: >>>>> comparison is always false due to limited range of data type >>>>> rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* >>>>> .libs/librxtxParallel-2.0.7pre1.* >>>>> gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so-o >>>>> .libs/librxtxParallel- 2.0.7pre1.so >>>>> (cd .libs && rm -f librxtxParallel.so && ln -s >>>> librxtxParallel-2.0.7pre1.so >>>>> librxtxParallel.so) >>>>> creating librxtxParallel.la >>>>> (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la >>>>> librxtxParallel.la) >>>>> make all-am >>>>> make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' >>>>> make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' >>>>> libtool: install: `x86_64-unknown-linux-gnu' must be an absolute >>>> directory >>>>> name >>>>> Try `libtool --help --mode=install' for more information. >>>>> make: *** [install] Error 1 >>>> >>>> A libtool change? Assuming you ran configure && make install in >>>> /home/jboss/sources/rxtx- 2.0-7pre1, libtool is looking for >>>> /home/jboss/sources/rxtx- >>>> 2.0-7pre1/x86_64-unknown-linux-gnu/.libs/librxtxSerial-2.0.7pre1.so. >>>> >>>> I think you have this? The file is just being copied to >>>> ~JAVA/jre/lib/$(JAVA_ARCH). >>>> >>>> -- >>>> Trent Jarvi >>>> tjarvi at qbang.org >>>> >>> >> > From guido.vogt at celsi.ch Tue Nov 13 00:28:01 2007 From: guido.vogt at celsi.ch (Guido Vogt) Date: Tue, 13 Nov 2007 08:28:01 +0100 Subject: [Rxtx] RTS Line can't be set Message-ID: <47395201.1050400@celsi.ch> I'm working on an Windows XP /SP2 System. Version of RXTX: 2.1.7. The serial line is connected to a modem. As I can see, the RTS-Line of the serial Port is inactive, when the port is opened (flowcontrol=none). Obviously, no data is coming from the modem. If I use the setRTS(true) command after open, the comport does not send out my data any more. This behaviour is regardless of flowcontrol. Anybody has an idea what do do? Thanks for help. From Martin.Oberhuber at windriver.com Tue Nov 13 08:58:23 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 13 Nov 2007 16:58:23 +0100 Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803880918@ism-mail03.corp.ad.wrs.com> Hi Trent, as said before, I like the idea of discussing such quality engineering issues, but why hide these away from the rest of the public? Anyways, if you do want to create a new mailing list for these kinds of things I'll happily subscribe. 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: Sunday, November 11, 2007 1:46 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: RE: [Rxtx] Quality Engineering with rxtx > > On Mon, 5 Nov 2007, Oberhuber, Martin wrote: > > > Hi Trent, > > > > are the interestes of hobbyists really so different > > from commercial ones? Both should be interested in > > high quality and innovation the like. > > > > I haven't seen too many Open Source projects from the > > "inside" but those that I have seen did not have > > separate mailing lists for quality/testing/qa > > versus innovation/development. > > > > What I have seen with the Open Source projects that > > one would call "successful" is a good deal of > > process around automated builds, automated unit > > tests, predictable release dates and milestones, > > and policies around commiting/contributing/reviewing > > changes. > > > > I think that all of these benefit commercial users > > and hobbyists the like. > > > > If you were just asking about who's interested in > > discussing changes to foster more quality, count > > me in. I'm just not sure whether discussing these > > on a separate mailing list or other channel is the > > right thing to do. > > > > Hi Martin, > > There are two issues I'm thinking about. The first is the > generic unit > testing and quality initiatives required to move rxtx > forward. The second > is the inevitable fact that rxtx connects to external hardware. The > discussion deals with a different set of problems. > > Here is a simple example of what I'm getting at. > > We have the capability of setting custom baud rates in rxtx. > We may be > interested in seeing regressions in rxtx, the C library or > the kernel. > Some people may be doing some tests with loopback > connections. These will > always work even if the baud rate is not set to the expected > value. Some > people may use null modems between two ports. This may be > able to catch > the problem but not always. > > Will the build machines be able to test this? (no - for a few reasons) > Will people be trying to catch these type of regressions? (yes) > What type of coverage does the community have in the end? (?) > > We could include the discussions in the same list or another > equally open > list that may be of interest to some folks that deal with > these types of > problems on a regular basis. > > -- > Trent Jarvi > tjarvi at qbang.org > From toupsz at cs.tamu.edu Tue Nov 13 10:33:03 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 13 Nov 2007 11:33:03 -0600 Subject: [Rxtx] [urgent] device's power off detection In-Reply-To: <4738F546.5010101@gatworks.com> References: <766782.10076.qm@web55803.mail.re3.yahoo.com> <4738F546.5010101@gatworks.com> Message-ID: Lacking any other specification on it...but can you set up the device to notify your software when it turns off? Send a message or somesuch? Maybe it can signal using RTS or DTR? -Zach On Nov 12, 2007 6:52 PM, U. George wrote: > Not sure what u are asking for. Are u asking for a way to detect if the > device is OFF? Are u asking how to power off the device - via software ? > Is it a Serial device? > is it a parallel device? > is it a usb device? > > Sara Hugh wrote: > > Hello all, > > I have a small application built on top of rxtx api. This application > > can retrieve the incoming data from a device through a port. The device > > can be powered off after the port get closed from the application. I > > have been trying a couple of hours to find a way to detect the power > > switching from device. If anyone knows how to handle it through rxtx, > > could you please give me a help? Thank you very much. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071113/e5859e4d/attachment-0018.html From tjarvi at qbang.org Tue Nov 13 20:02:03 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 13 Nov 2007 20:02:03 -0700 (MST) Subject: [Rxtx] #ifndef TIOCSERGETLSR In-Reply-To: <472E3AAF.7050709@gatworks.com> References: <472E3AAF.7050709@gatworks.com> Message-ID: On Sun, 4 Nov 2007, U. George wrote: > For Linux, it seems that you need the code for both *having* a > TIOCSERGETLSR, and *not having* a TIOCSERGETLSR. Maybe the ioctl exists > system wide, but not necessarily for the device driver itself ( always > returns -1 ) . > > Are there systems that have a *functioning* TIOCSERGETLSR for all their > devices? Then this would be the case where the "#ifndef TIOCSERGETLSR" > directive could be useful is eliminating the unnecessary code and tests. > > And for those systems that dont have a TIOCSERGETLSR, then the code for > TIOCSERGETLSR can be eliminated. > > It would be a simple case to have, as a foundation, all the code to > simulate the missing TIOCSERGETLSR ioctl. If the system does have the > ioctl, then that code can be ifdef'd in, and co-exist with the > functionality of the code that simulates the missing TIOCSERGETLSR ioctl. > Ah, there is the post. Sorry I was on vacation. Hi George, Yes there are systems that have functioning TIOCSERGETLSR for all of their devices. These are machines that just use traditional UARTs. If you mean operating systems, then probably not. Let me explain a bit about the history of those #ifdefs to help clear up a mess. RXTX aims to follow POSIX. TIOCSERGETLSR turns out to not be POSIX at all as I understand. It isn't in BSD, Solaris, AIX or HP-UX. It certainly provides access to important information. I assumed it was standard when I coded rxtx on a Linux system. Ya, laugh. Then I looked at Win32.. Oh you are still laughing? ..I could not navigate msft's web site at the time [still can't really find anything today]. So google pointed me to someones 'reverse documentation' of the w32 API and an example msft put together back in the win3.0 days. It was enough but maybe not 100% correct. They covered overlapped IO which was important for events in rxtx. Looking at Win32 and Linux, it made sense to implement TIOCSERGETLSR for win32 with the way rxtx works. That was how things matched up. But when I got feedback about other systems, it didn't match up. When people used multiport cards with money saving designs in Linux, it didn't match up. And today, there are drivers for unusual serial ports that don't match up. Now we have some ugly logic that mostly works for most serial ports. It isn't right though. The important aspect of TIOSERGETLSR is knowing when the output is really gone. But POSIX tcdrain tells us the same thing. So there is logic in the ifdefs to match that up as you suggest. Perhaps a more formal solution along those lines would be worth looking into. I would suggest the roles should be switched though. We should use POSIX calls on all systems and hide things that don't work on everything like we have with other undocumented calls. TIOSERGETLSR is nice and would be great if it was standard. It isn't as far as I can tell. In the end, many people write Java code because they want portability. The TIOSERGETLSR does not really fit. In someways, this is limiting to the least common denominator which is Solaris if you have seen it's serial kernel driver code. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 15 09:10:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 15 Nov 2007 17:10:59 +0100 Subject: [Rxtx] RXTX blocking on unconnected virtual port Message-ID: <460801A4097E3D4CA04CC64EE648584803919080@ism-mail03.corp.ad.wrs.com> Hello, we came across the following issue: * Set up a virtual serial port, e.g. with com0com: http://com0com.sourceforge.net/ * Connect RXTX to one end, e.g. cnc1a * Do not connect the other end, e.g. cnc1b * Have RXTX write data to the port --> Since the data is not being read, RXTX blocks - RXTXPort.SerialOutputStream.write increases the RXTXPort.IOLocked variable - it then calls the native writeByte or writeArray method (which blocks) closing the RXTXPort hangs for ever too: - RXTXPort.close() has a while( IOLocked > 0 ) {..Thread.sleep(500);...} which spins for ever ==> once the communication hangs, it cannot recover. Has anybody else seen such a problem before, or even got an idea how to solve it? When I connect Hyperterminal to the same half-open port, and type a character, it hangs for about 3 seconds but then times out and is available again. I guess that's what I'd like to see in RXTX as well, with a (configurable) timeout. Our big problem with the current situation is that once RXTX gets stuck, there is nothing at all we can do to make it go live again - that's why our original workaround of writing to the port in a background thread is not good enough. For more background information, the issue is being tracked in https://bugs.eclipse.org/bugs/show_bug.cgi?id=208185 Thanks for any hints or ideas, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Sun Nov 18 09:43:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 09:43:26 -0700 (MST) Subject: [Rxtx] PortInUseException - Cannot close and reopen serial port In-Reply-To: <460801A4097E3D4CA04CC64EE64858480351C711@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858480351C711@ism-mail03.corp.ad.wrs.com> Message-ID: These have been submitted to CVS and the bugzilla entries have been changed to reflect the changes. ChangeLog: find ports which were added after program startup on Mac OS X. Martin Oberhuber http://bugzilla.qbang.org/show_bug.cgi?id=48 Clean up CommPort Ownership code, avoid possible deadlocks, fix lost commport ownership events. http://bugzilla.qbang.org/show_bug.cgi?id=83 Martin Oberhuber On Wed, 24 Oct 2007, Oberhuber, Martin wrote: > 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) > > > > > > > > > > > > > > > From tjarvi at qbang.org Sun Nov 18 09:45:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 09:45:39 -0700 (MST) Subject: [Rxtx] PortInUseException - Cannot close and reopen serial port In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848020CAF26@ism-mail03.corp.ad.wrs.com> Message-ID: The current CVS code should have all the entries. With version information, I usually do not change the version until we tag and release a zip file. Any feedback would be appreciated. On Wed, 27 Jun 2007, Greg Johnson wrote: > 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) >> >> >> >> >> > From tjarvi at qbang.org Sun Nov 18 13:51:27 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 13:51:27 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs Message-ID: The following bugs have been closed and CVS updated as needed: CommPortIdentifier.getPortIdentifier throws NoSuchPortException http://bugzilla.qbang.org/show_bug.cgi?id=48 CommPortOwnership events not sent http://bugzilla.qbang.org/show_bug.cgi?id=83 JVM 1.6 builds http://bugzilla.qbang.org/show_bug.cgi?id=84 I'd like to give Martin Oberhuber CVS write access. He has been doing a great job of pushing safe patches into rxtx. I'll be preparing seperate patches for the changes I have and submitting them to the list. I'll need to work with George to do a couple things: 1) break the patch into smaller pieces to isolate issues for discussion. 2) work through the Line Status Register changes so it does not cause problems on other systems. George: If you could do the first one, it would be greatly appreciated. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Nov 18 15:33:36 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 15:33:36 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: Message-ID: I'm not running any tests at this point, I'm trying to apply the small safe patches and make sure everything is compiling. As mentioned at the bottom, there are 3 patches + the USB fix posted here that need more review before accepting. The following bugs have been closed and CVS updated as needed. Most of these are already in CVS. The diff will be small. configure script failed at line UTS_RELEASE megov http://bugzilla.qbang.org/show_bug.cgi?id=80 code cleanup patch (extra ';' creates bug for if statements + new String() calls removed) Xavier Le Vourch http://bugzilla.qbang.org/show_bug.cgi?id=77 Wont compile on linux ppc with glibc 2.5 - no sys/io.h Brian Johnson http://bugzilla.qbang.org/show_bug.cgi?id=72 rxtx overwrites System properties Andrew Gillett Nektarios K. Papadopoulos Neboj??a http://bugzilla.qbang.org/show_bug.cgi?id=64 Solaris ACM port support Dave Cleal http://bugzilla.qbang.org/show_bug.cgi?id=59 Setting of non-standard baud rate fails. Andrew Prunicki http://bugzilla.qbang.org/show_bug.cgi?id=58 RXTX uses lockfiles on MacOS X (instead of ioctl TIOCEXCL) Joachim Buechse http://bugzilla.qbang.org/show_bug.cgi?id=50 JavaDoc fixes Joachim Buechse http://bugzilla.qbang.org/show_bug.cgi?id=49 I need to further review the following: http://bugzilla.qbang.org/show_bug.cgi?id=53 http://bugzilla.qbang.org/show_bug.cgi?id=46 http://bugzilla.qbang.org/show_bug.cgi?id=41 On Sun, 18 Nov 2007, Trent Jarvi wrote: > > The following bugs have been closed and CVS updated as needed: > > CommPortIdentifier.getPortIdentifier throws NoSuchPortException > http://bugzilla.qbang.org/show_bug.cgi?id=48 > CommPortOwnership events not sent > http://bugzilla.qbang.org/show_bug.cgi?id=83 > JVM 1.6 builds > http://bugzilla.qbang.org/show_bug.cgi?id=84 > > I'd like to give Martin Oberhuber CVS write access. He has been doing a > great job of pushing safe patches into rxtx. > > I'll be preparing seperate patches for the changes I have and submitting > them to the list. > > I'll need to work with George to do a couple things: > > 1) break the patch into smaller pieces to isolate issues for discussion. > 2) work through the Line Status Register changes so it does not cause > problems on other systems. > > George: If you could do the first one, it would be greatly appreciated. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From netbeans at gatworks.com Sun Nov 18 16:20:02 2007 From: netbeans at gatworks.com (U. George) Date: Sun, 18 Nov 2007 18:20:02 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: Message-ID: <4740C8A2.6030908@gatworks.com> > I'll need to work with George to do a couple things: > > 1) break the patch into smaller pieces to isolate issues for discussion. > 2) work through the Line Status Register changes so it does not cause > problems on other systems. > > George: If you could do the first one, it would be greatly appreciated. there are ( probably ) 3 pieces: 1) the select() failure when the USB-serial device is unceremoniously unplugged ( causes rxtx to spin ) 2) TIOCSERGETLSR, need to have the simulation of it available for all os's . If the system has the capability, don't simulate for devices that have the capability. For devices that dont have the capability, but the OS still defines TIOCSERGETLSR, fall back to simulation. 3) I rearranged DEBUG ifdef's. This is probably the bulk of the patches. From tjarvi at qbang.org Sun Nov 18 18:26:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 18:26:26 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <4740C8A2.6030908@gatworks.com> References: <4740C8A2.6030908@gatworks.com> Message-ID: On Sun, 18 Nov 2007, U. George wrote: > >> I'll need to work with George to do a couple things: >> >> 1) break the patch into smaller pieces to isolate issues for discussion. >> 2) work through the Line Status Register changes so it does not cause >> problems on other systems. >> >> George: If you could do the first one, it would be greatly appreciated. > > there are ( probably ) 3 pieces: > 1) the select() failure when the USB-serial device is unceremoniously > unplugged ( causes rxtx to spin ) > 2) TIOCSERGETLSR, need to have the simulation of it available for all os's . > If the system has the capability, don't simulate for devices that have the > capability. For devices that dont have the capability, but the OS still > defines TIOCSERGETLSR, fall back to simulation. > 3) I rearranged DEBUG ifdef's. This is probably the bulk of the patches. > Hi George, I suspect if you do cvs update, there will be very few conflicts if any. While the list of fixes is fairly long, the changes are small. -- Trent Jarvi tjarvi at qbang.org From EdwardRF at xtremax.com Mon Nov 19 03:32:29 2007 From: EdwardRF at xtremax.com (Edward) Date: Mon, 19 Nov 2007 18:32:29 +0800 Subject: [Rxtx] Cannot Read under Windows XP Message-ID: <4741663D.4070200@xtremax.com> Hi Guys, I have a iTegno 3000 usb GSM modem, it is an usb-serial device. I am trying to use RXTX with it under Windows XP. The problem is it seems RXTX cannot read any data from it, but writing to it seems successful. I blindly issue a series of command to send off a SMS, it is successfully delivered, but neither the echo from the modem nor the "OK" response was received. I tried to connect to the modem directly using hyper terminal, there was no problem reading or writing. So can i assume it is not the driver problem? Then i turned to Serial Port Monitor for help, when I use hyper terminal, monitor shows both way traffic, and nothing abnormal, but when I connect using RXTX, only the data I sent to the modem is being detected, no input was detected. Does anyone else experience similar problem? Best Regards Edward From tjarvi at qbang.org Mon Nov 19 03:38:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Nov 2007 03:38:02 -0700 (MST) Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: <4741663D.4070200@xtremax.com> References: <4741663D.4070200@xtremax.com> Message-ID: On Mon, 19 Nov 2007, Edward wrote: > Hi Guys, > > I have a iTegno 3000 usb GSM modem, it is an usb-serial device. I am > trying to use RXTX with it under Windows XP. > The problem is it seems RXTX cannot read any data from it, but writing > to it seems successful. I blindly issue a series of command to send off > a SMS, it is successfully delivered, but neither the echo from the modem > nor the "OK" response was received. > > I tried to connect to the modem directly using hyper terminal, there was > no problem reading or writing. So can i assume it is not the driver problem? > > Then i turned to Serial Port Monitor for help, when I use hyper > terminal, monitor shows both way traffic, and nothing abnormal, but when > I connect using RXTX, only the data I sent to the modem is being > detected, no input was detected. > > Does anyone else experience similar problem? > Hi Edward, A common mistake is to send Strings to the modem which are i18n. You want to send the bytes. Examples of doing this are in the contrib directory with the sourcecode. ie SimpleSnuV1.java -- Trent Jarvi tjarvi at qbang.org From EdwardRF at xtremax.com Mon Nov 19 04:42:16 2007 From: EdwardRF at xtremax.com (Edward) Date: Mon, 19 Nov 2007 19:42:16 +0800 Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: References: <4741663D.4070200@xtremax.com> Message-ID: <47417698.3060705@xtremax.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071119/b0f08ba9/attachment-0013.html From netbeans at gatworks.com Mon Nov 19 06:31:30 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 19 Nov 2007 08:31:30 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: <4740C8A2.6030908@gatworks.com> Message-ID: <47419032.8080406@gatworks.com> Did the "make install". The install does not want to go to or use Makefiles's prefix = /usr/local/rxtx-devel Not terribly happy that it installed in /home/gat/JAVA/JDK14/j2sdk1.4.2_08/jre/lib/i386 Trent Jarvi wrote: > > I suspect if you do cvs update, there will be very few conflicts if any. > While the list of fixes is fairly long, the changes are small. > > -- > Trent Jarvi > tjarvi at qbang.org > > From Martin.Oberhuber at windriver.com Mon Nov 19 07:00:48 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 19 Nov 2007 15:00:48 +0100 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE6485848039986E6@ism-mail03.corp.ad.wrs.com> It's great to see things progressing - thanks Trent! I checked CVS, and it seems that most of the patch authors are yet missing from the AUTHORS file, is this intentional? The issues areound RXTXPort.close() are interesting for us in the context of Eclipse as well: https://bugs.eclipse.org/bugs/show_bug.cgi?id=208185#c3 I did a quick review and found some issues / comments: http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 http://bugzilla.qbang.org/show_bug.cgi?id=53#c9 Thanks for proposing CVS write access for me. I promise to use these thoughtfully, and discuss potential fixes openly (on bugzilla) before applying them [unless it's really trivial issues only like obvious Javadoc syntax or spelling errors]. Cheers, -- 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 Mon Nov 19 07:24:16 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 19 Nov 2007 15:24:16 +0100 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803998711@ism-mail03.corp.ad.wrs.com> Hi all, I think I've got a better version for RXTXCommDriver.checkSolaris(): http://bugzilla.qbang.org/show_bug.cgi?id=77#c3 Cheers, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From netbeans at gatworks.com Mon Nov 19 09:01:22 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 19 Nov 2007 11:01:22 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <47419032.8080406@gatworks.com> References: <4740C8A2.6030908@gatworks.com> <47419032.8080406@gatworks.com> Message-ID: <4741B352.8070205@gatworks.com> U. George wrote: > Did the "make install". The install does not want to go to or use > Makefiles's prefix = /usr/local/rxtx-devel > > Not terribly happy that it installed in > /home/gat/JAVA/JDK14/j2sdk1.4.2_08/jre/lib/i386 > Put libs and jar in MY preferential places. Ran application. And it loves to spin. Deja gnu all over again. :-/ It did find the avail /dev/ttyUSB0 port connected to LINUX usbserial/pl2303 device driver. Now to find the spin. and apply simpler set of patches From tjarvi at qbang.org Mon Nov 19 10:14:38 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Nov 2007 10:14:38 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <4741B352.8070205@gatworks.com> References: <4740C8A2.6030908@gatworks.com> <47419032.8080406@gatworks.com> <4741B352.8070205@gatworks.com> Message-ID: On Mon, 19 Nov 2007, U. George wrote: > U. George wrote: >> Did the "make install". The install does not want to go to or use >> Makefiles's prefix = /usr/local/rxtx-devel >> >> Not terribly happy that it installed in >> /home/gat/JAVA/JDK14/j2sdk1.4.2_08/jre/lib/i386 >> > Put libs and jar in MY preferential places. Ran application. And it loves to > spin. Deja gnu all over again. :-/ > > It did find the avail /dev/ttyUSB0 port connected to LINUX usbserial/pl2303 > device driver. > > Now to find the spin. and apply simpler set of patches > Hi George, When the prefix code was stomped on and the library was installed in the jre, It wasnt clear how the layout would end up looking. I'm still not sure. My usual attack was to dump a jdk onto the filesystem, set JAVA_HOME and install. When I was done, I would nuke the jdk. Obviously that may not be what people want but I'm not sure a prefix is enough to let us know what they do want. For a shared library prefix /usr/local means the library goes in /usr/local/lib. What would it mean for the jar and shared library in Java? -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Nov 19 10:24:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Nov 2007 10:24:08 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <460801A4097E3D4CA04CC64EE6485848039986E6@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848039986E6@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 19 Nov 2007, Oberhuber, Martin wrote: > > I checked CVS, and it seems that most of the patch > authors are yet missing from the AUTHORS file, > is this intentional? > There isn't a hard rule covering who goes into AUTHORS. If I recognize a person from previous patches, I try to make sure they are in. Everyone contributing (authors) is in the ChangeLog with what they did going all the way back to the first release. AUTHORS is more of a summary of what they did after a few submissions. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Nov 19 11:39:51 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 19 Nov 2007 13:39:51 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: <4740C8A2.6030908@gatworks.com> <47419032.8080406@gatworks.com> <4741B352.8070205@gatworks.com> Message-ID: <4741D877.80203@gatworks.com> For me, the makefile/prefix = /usr/local sorta suggest thats where the libs/bins/jars/... should eventually wind up. If a user does not like /usr/local, then a quick change would put it somewhere else. At this moment I dont care where the jar winds up ( in lib, or a jar directory ). So I like to keep the jre/sdk directory protected from meddling, and changes. But if a user has a penchant to use 'java -jar', then the RXTXcomm.jar file should be stuffed with the other jre/sdk jar files. From ajmas at sympatico.ca Mon Nov 19 11:54:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 19 Nov 2007 13:54:29 -0500 Subject: [Rxtx] CVS updates and closed bugs Message-ID: <20071119185429.SPYK18413.tomts22-srv.bellnexxia.net@smtp1.sympatico.ca> On this day in November "U. George" wrote: > > For me, the makefile/prefix = /usr/local sorta suggest thats where the > libs/bins/jars/... should eventually wind up. > If a user does not like /usr/local, then a quick change would put it > somewhere else. At this moment I dont care where the jar winds up ( in > lib, or a jar directory ). > So I like to keep the jre/sdk directory protected from meddling, and > changes. > But if a user has a penchant to use 'java -jar', then the RXTXcomm.jar > file should be stuffed with the other jre/sdk jar files. It should be noted that some platforms, such as MacOS X might have different conventions. In the case of MacOS X there are two 'correct' places for Java libraries that aren't part of an application: - /Library/Java/Extensions/ - ~/Library/Java/Extensions/ Andre From ajmas at sympatico.ca Mon Nov 19 18:15:37 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 19 Nov 2007 20:15:37 -0500 Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: <47417698.3060705@xtremax.com> References: <4741663D.4070200@xtremax.com> <47417698.3060705@xtremax.com> Message-ID: <3D24B671-06CA-4709-AE3C-BCDB542F427F@sympatico.ca> On 19-Nov-07, at 06:42 , Edward wrote: > Hi Trent, > > First of all, I did sent them as bytes, eg, > > output.write("at\r\n".getBytes()); > > And if writing is every the problem, it wouldn't be able to explain > why i could send out a sms successfully using RXTX. > If you have the section of code that does the communicating, could you share it with us? This should help us tell whether it is a coding issue or something more fundamental with RXTX. Andre From EdwardRF at xtremax.com Mon Nov 19 19:39:36 2007 From: EdwardRF at xtremax.com (EdwardRF) Date: Tue, 20 Nov 2007 10:39:36 +0800 Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: <3D24B671-06CA-4709-AE3C-BCDB542F427F@sympatico.ca> References: <4741663D.4070200@xtremax.com> <47417698.3060705@xtremax.com> <3D24B671-06CA-4709-AE3C-BCDB542F427F@sympatico.ca> Message-ID: <474248E8.7070002@xtremax.com> Hi Guys, Thanks for the help, i've finally found out the problem. It was a flow control issue, i did not set the flow control properly. Btw, what is the default flow control behavior for rxtx2.1.7? was it the same as 2.0? Because i remember i did not need to set the flow control when I use rxtx 2.0 2 years back. Best Regards Edward Andre-John Mas wrote: > > On 19-Nov-07, at 06:42 , Edward wrote: > >> Hi Trent, >> >> First of all, I did sent them as bytes, eg, >> >> output.write("at\r\n".getBytes()); >> >> And if writing is every the problem, it wouldn't be able to explain >> why i could send out a sms successfully using RXTX. >> > > If you have the section of code that does the communicating, could you > share it with us? This should help us tell whether it is a coding > issue or something more fundamental with RXTX. > > Andre > From netbeans at gatworks.com Tue Nov 20 06:23:26 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 20 Nov 2007 08:23:26 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: <4740C8A2.6030908@gatworks.com> Message-ID: <4742DFCE.5070504@gatworks.com> Here is the small subset of diffs just for TIOCSERGETLSR :) Next I'll pull out the usb device, and see if that also causes rxtx to spin. >> 2) TIOCSERGETLSR, need to have the simulation of it available for all >> os's . If the system has the capability, don't simulate for devices >> that have the capability. For devices that dont have the capability, >> but the OS still defines TIOCSERGETLSR, fall back to simulation. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: a Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20071120/2c5c8ee7/attachment-0010.pl From tjarvi at qbang.org Tue Nov 20 08:20:21 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Nov 2007 08:20:21 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <4742DFCE.5070504@gatworks.com> References: <4740C8A2.6030908@gatworks.com> <4742DFCE.5070504@gatworks.com> Message-ID: On Tue, 20 Nov 2007, U. George wrote: > Here is the small subset of diffs just for TIOCSERGETLSR :) > > Next I'll pull out the usb device, and see if that also causes rxtx to spin. > >>> 2) TIOCSERGETLSR, need to have the simulation of it available for all os's >>> . If the system has the capability, don't simulate for devices that have >>> the capability. For devices that dont have the capability, but the OS >>> still defines TIOCSERGETLSR, fall back to simulation. > Hi George, I'll be looking through this patch in detail tonight. I just wanted to make sure you are aware of this line in win32termios.h. The ifdef logic is messy as you noticed. That is combined with the later addition of support for it to windows. #define TIOCSERGETLSR 0x5459 (this is by far the strangest code in rxtx in retrospect) I'll be able to do extensive automated testing once we get to that point. I'm confident we can get something in that has a low probability of causing regressions. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Tue Nov 20 08:42:08 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 20 Nov 2007 10:42:08 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: <4740C8A2.6030908@gatworks.com> <4742DFCE.5070504@gatworks.com> Message-ID: <47430050.1010203@gatworks.com> It is of no difference. 1) If the define does not exist, then it should be as before. 2) If it does exist, then it should also be as before. 3) If it does exist, but the ioctl fails, then it will fallback as if it did not exist in the first place. Trent Jarvi wrote: > On Tue, 20 Nov 2007, U. George wrote: > >> Here is the small subset of diffs just for TIOCSERGETLSR :) >> >> Next I'll pull out the usb device, and see if that also causes rxtx to >> spin. >> >>>> 2) TIOCSERGETLSR, need to have the simulation of it available for >>>> all os's . If the system has the capability, don't simulate for >>>> devices that have the capability. For devices that dont have the >>>> capability, but the OS still defines TIOCSERGETLSR, fall back to >>>> simulation. >> > > Hi George, > > I'll be looking through this patch in detail tonight. I just wanted to > make sure you are aware of this line in win32termios.h. The ifdef logic > is messy as you noticed. That is combined with the later addition of > support for it to windows. > > #define TIOCSERGETLSR 0x5459 > > (this is by far the strangest code in rxtx in retrospect) > > I'll be able to do extensive automated testing once we get to that > point. I'm confident we can get something in that has a low probability > of causing regressions. > > -- > Trent Jarvi > tjarvi at qbang.org > > From netbeans at gatworks.com Tue Nov 20 08:36:56 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 20 Nov 2007 10:36:56 -0500 Subject: [Rxtx] Unplugged Opened USB devices In-Reply-To: <4742DFCE.5070504@gatworks.com> References: <4740C8A2.6030908@gatworks.com> <4742DFCE.5070504@gatworks.com> Message-ID: <4742FF18.3050005@gatworks.com> > Next I'll pull out the usb device, and see if that also causes rxtx to > spin. This is the error on a read. The select() should have failed, as well as the read(). java.io.IOException: Input/output error in nativeavailable at gnu.io.RXTXPort.nativeavailable(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1420) at jGPS.GpsData.DeviceDrivers.SerialPort.SerialPort_NMEA_GNU.serialEvent (SerialPort_NMEA_GNU.java:449) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:771) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1622) But for java program, it sees( when USB device is unplugged ) : 1) event: SerialPortEvent.DATA_AVAILABLE 2) read (non-existant) data. I think that its bad form to say DATA_AVAILABLE, when there is no data to be obtained. There does not seem to be an I/O error event. So basically, I think, and IMHO, that no events should be sent. Rather a thread timeout ( ie no data in X seconds ) AND recovery from user code should be instantiated. From manujnaman at yahoo.com Wed Nov 21 12:35:46 2007 From: manujnaman at yahoo.com (manuj naman) Date: Wed, 21 Nov 2007 11:35:46 -0800 (PST) Subject: [Rxtx] Problem reading 1-wire device using RXTX on Linux Message-ID: <371969.66249.qm@web37911.mail.mud.yahoo.com> Hello, I am trying to use the RXTX library on Ubuntu (Debian) linux to read iButtons. It works perfectly on Windows. However on my linux machines it gives the following errors. I am using DS9490 (USB port adapter) to read the iButtons. I have followed your instructions on the Wiki. I recompiled the rxtx library to produce the .so and .jar files. But still it gives me this: manujnaman at sensor:~/iButton/onewireviewer$ java -cp $CLASSPATH:./OneWireAPI.jar:./OneWireViewer.jar OneWireViewer Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Warning: serial communications API not setup properly, no ports in enumeration Pure-Java DS9097U adapter will not work, not added to adapter enum Standard drivers for 1-Wire are not found. Please download the latest drivers from http://www.ibutton.com Or install RXTX Serial Communications API from http://www.rxtx.org Do you know how to solve the "Serial communications API not setup properly, no ports in enumeration" problem? Also, how to detect which what /dev/* is the port to be used? On Windows this is simply USB1, on linux this is a bit unclear. Many thanks for your advice, Manuj Naman Dallas, TX, US manujnaman at yahoo.com --------------------------------- Be a better pen pal. Text or chat with friends inside Yahoo! Mail. See how. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071121/2760f691/attachment-0009.html From Martin.Oberhuber at windriver.com Wed Nov 21 13:55:25 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 21 Nov 2007 21:55:25 +0100 Subject: [Rxtx] Should RXTX Lixense link to LGPL-2.1 be changed? In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803A21160@ism-mail03.corp.ad.wrs.com> Hi Trent and all, In all the RXTX source files as well as http://users.frii.com/jarvi/rxtx/license.html there is the following lines: | A copy of the LGPL v 2.1 may be found at | http://www.gnu.org/licenses/lgpl.txt on March 4th 2007. A copy is | here for your convenience. But, as of today, at the link provided there is only a copy of the LGPL v3.0. I think there should be a link to the LGPL v2.1, e.g. http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html What do you think? Cheers, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Nov 21 20:46:18 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Nov 2007 20:46:18 -0700 (MST) Subject: [Rxtx] Problem reading 1-wire device using RXTX on Linux In-Reply-To: <371969.66249.qm@web37911.mail.mud.yahoo.com> References: <371969.66249.qm@web37911.mail.mud.yahoo.com> Message-ID: On Wed, 21 Nov 2007, manuj naman wrote: > Hello, > > I am trying to use the RXTX library on Ubuntu (Debian) linux to read iButtons. It works perfectly on Windows. However on my linux machines it gives the following errors. I am using DS9490 (USB port adapter) to read the iButtons. > > I have followed your instructions on the Wiki. I recompiled the rxtx library to produce the .so and .jar files. But still it gives me this: > > manujnaman at sensor:~/iButton/onewireviewer$ java -cp $CLASSPATH:./OneWireAPI.jar:./OneWireViewer.jar OneWireViewer > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > Warning: serial communications API not setup properly, no ports in enumeration > Pure-Java DS9097U adapter will not work, not added to adapter enum > > Standard drivers for 1-Wire are not found. > Please download the latest drivers from http://www.ibutton.com > Or install RXTX Serial Communications API from http://www.rxtx.org > > Do you know how to solve the "Serial communications API not setup properly, no ports in enumeration" problem? > > Also, how to detect which what /dev/* is the port to be used? On Windows this is simply USB1, on linux this is a bit unclear. Hi Manuj What is the output of the following? dmesg |grep tty touch /var/lock/test.lock && rm -f /var/lock/test.lock If you see something like /dev/ttyUSB0 in the dmesg output, what happens if you do something like tail -f /dev/ttyUSB0? These test each of the usual suspects. We are looking for missing USB drivers, no permission to create a lockfile and no read permission for the device. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Nov 21 21:05:23 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Nov 2007 21:05:23 -0700 (MST) Subject: [Rxtx] Should RXTX Lixense link to LGPL-2.1 be changed? In-Reply-To: <460801A4097E3D4CA04CC64EE648584803A21160@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803A21160@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 21 Nov 2007, Oberhuber, Martin wrote: > Hi Trent and all, > > In all the RXTX source files as well as > http://users.frii.com/jarvi/rxtx/license.html > there is the following lines: > > | A copy of the LGPL v 2.1 may be found at > | http://www.gnu.org/licenses/lgpl.txt on March 4th 2007. A copy is > | here for your convenience. > > But, as of today, at the link provided there is only > a copy of the LGPL v3.0. I think there should be a link > to the LGPL v2.1, e.g. > http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html > > What do you think? > Hi Martin, Thanks. I updated the link. Changing licences is a heavy process for me as a free software developer and an employee so I'd rather stay with 2.1 unless the current license becomes a show stopper. I figured that would happen someday so I put the date in to be clear. -- Trent Jarvi tjarvi at qbang.org From beat.arnet at gmail.com Thu Nov 22 08:45:45 2007 From: beat.arnet at gmail.com (Beat Arnet) Date: Thu, 22 Nov 2007 10:45:45 -0500 Subject: [Rxtx] Dual Core Problem Message-ID: <4745A429.9060604@gmail.com> Dear All, I am struggling with an application that uses RXTX 2.1.7 and has been working reliably in the past. When this program runs on a dual-core DELL (Intel T2500), strange things happen with the RS232 communication. The application is missing incoming characters and also often freezes when trying to close the serial port. I highly suspect a threading problem and was wondering if a) anybody had run into a similar problem with dual core processors and b) if there is a list of does and dont's when it comes to RXTX and threads. Regards, Beat From tjarvi at qbang.org Thu Nov 22 13:22:43 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 22 Nov 2007 13:22:43 -0700 (MST) Subject: [Rxtx] Dual Core Problem In-Reply-To: <4745A429.9060604@gmail.com> References: <4745A429.9060604@gmail.com> Message-ID: On Thu, 22 Nov 2007, Beat Arnet wrote: > Dear All, > I am struggling with an application that uses RXTX 2.1.7 and has been > working reliably in the past. When this program runs on a dual-core DELL > (Intel T2500), strange things happen with the RS232 communication. The > application is missing incoming characters and also often freezes when > trying to close the serial port. I highly suspect a threading problem > and was wondering if a) anybody had run into a similar problem with dual > core processors and b) if there is a list of does and dont's when it > comes to RXTX and threads. > I've used rxtx with SMP systems but have not experimented very much with threading and rxtx. One red flag rxtx raises is it stores pointers to java objects in SerialImp.c. If the JVM decides to move things around, rxtx becomes confused. Missing incomming characters is usually caused by someone running two applications. They then fight over the incomming data. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Fri Nov 23 03:12:28 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 23 Nov 2007 11:12:28 +0100 Subject: [Rxtx] Dual Core Problem In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803A84C59@ism-mail03.corp.ad.wrs.com> > Missing incomming characters is usually caused by someone running two > applications. They then fight over the incomming data. I've seen exactly this scenario on Linux with Lockfiles disabled. Usually, port locking (through Lockfiles or Ioctl method) should avoid exactly this problem. I know that on Mac, port locking through Kernel/Ioctl method has been added for the upcoming RXTX 2.1-8. What's the status of this feature for Linux and other Unixes? Cheers, Martin From chris.paton at red61.com Fri Nov 23 05:26:10 2007 From: chris.paton at red61.com (Chris Paton) Date: Fri, 23 Nov 2007 12:26:10 +0000 Subject: [Rxtx] RXTX parallel port issues Message-ID: <4746C6E2.3000304@red61.com> Hi there, I've been happily using RXTX to communicate with a serial based point-of-sale printer for a several months. I've recently received a parallel based printer and have been trying to get RXTX to talk to this too. I've encountered a few problems along the way and just wanted to check if I'm doing anything wrong, or if I've found any bugs. Writing ------- Writing to the parallel port using ParallelPort.getOutputStream works well, except when I use OutputStream.write(byte[]) to write a multiple of 8 bytes (!). Doing this causes the JVM to crash with an EXCEPTION_PRIV_INSTRUCTION on Windows. I worked around this in my application by adding an additional byte if bytesToWrite % 8 == 0. I guess I could also have called write(byte) repeatedly. This also generated a SIGSEGV on Linux but I was unable to reproduce it today using the CVS version of RXTX and a recent kernel. Reading status pins ------------------- On Linux, I've found that ParallelPort.isPaperOut and ParallelPort.isPrinterSelected appear to be inverted; i.e. when the paper is out ParallelPort.isPaperOut returns false, and when there is paper ParallelPort.isPaperOut returns true! I've tested this in both Sun JDK5 and JDK6 on machines running Linux 2.6.21 and 2.6.23. Fortunately it's easy to use a conditional based on System.getProperty("os.name") to hack around this. Reading from InputStream ------------------------ I've had more serious issues trying to read from ParallelPort.getInputStream. On Windows, readByte seems to return -1 (end of stream) any time data isn't available. On Linux, I got a kernel oops, even with a recent 2.6.23.1 kernel. I was able to stop this using a kernel patch that I found via Google. Although this stopped the oops, I still get frequent IOExceptions when calling InputStream.readByte. It appears that instead of blocking, readByte throws an IOException with message "Resource temporarily unavailable in readByte" any time it is called when no data is available. Occasionally, I get an exception instead of the data I was expecting to read, e.g when asking my printer for a version string I get "VER: S3306 * 06.03* 10/*6/06" where the *s indicate that an exception occurred and data was missed. Any advice that anyone can offer would be much appreciated. If you need any more details or debugging information about any of these problems then let me know. Cheers -- Chris Paton Technical Developer Red61 -- Transaction Marketing Software http://www.red61.com -------------- next part -------------- A non-text attachment was scrubbed... Name: chris.paton.vcf Type: text/x-vcard Size: 230 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20071123/00a747b6/attachment-0016.vcf From chris.paton at red61.com Fri Nov 23 05:26:10 2007 From: chris.paton at red61.com (Chris Paton) Date: Fri, 23 Nov 2007 12:26:10 +0000 Subject: [Rxtx] RXTX parallel port issues Message-ID: <4746C6E2.3000304@red61.com> Hi there, I've been happily using RXTX to communicate with a serial based point-of-sale printer for a several months. I've recently received a parallel based printer and have been trying to get RXTX to talk to this too. I've encountered a few problems along the way and just wanted to check if I'm doing anything wrong, or if I've found any bugs. Writing ------- Writing to the parallel port using ParallelPort.getOutputStream works well, except when I use OutputStream.write(byte[]) to write a multiple of 8 bytes (!). Doing this causes the JVM to crash with an EXCEPTION_PRIV_INSTRUCTION on Windows. I worked around this in my application by adding an additional byte if bytesToWrite % 8 == 0. I guess I could also have called write(byte) repeatedly. This also generated a SIGSEGV on Linux but I was unable to reproduce it today using the CVS version of RXTX and a recent kernel. Reading status pins ------------------- On Linux, I've found that ParallelPort.isPaperOut and ParallelPort.isPrinterSelected appear to be inverted; i.e. when the paper is out ParallelPort.isPaperOut returns false, and when there is paper ParallelPort.isPaperOut returns true! I've tested this in both Sun JDK5 and JDK6 on machines running Linux 2.6.21 and 2.6.23. Fortunately it's easy to use a conditional based on System.getProperty("os.name") to hack around this. Reading from InputStream ------------------------ I've had more serious issues trying to read from ParallelPort.getInputStream. On Windows, readByte seems to return -1 (end of stream) any time data isn't available. On Linux, I got a kernel oops, even with a recent 2.6.23.1 kernel. I was able to stop this using a kernel patch that I found via Google. Although this stopped the oops, I still get frequent IOExceptions when calling InputStream.readByte. It appears that instead of blocking, readByte throws an IOException with message "Resource temporarily unavailable in readByte" any time it is called when no data is available. Occasionally, I get an exception instead of the data I was expecting to read, e.g when asking my printer for a version string I get "VER: S3306 * 06.03* 10/*6/06" where the *s indicate that an exception occurred and data was missed. Any advice that anyone can offer would be much appreciated. If you need any more details or debugging information about any of these problems then let me know. Cheers -- Chris Paton Technical Developer Red61 -- Transaction Marketing Software http://www.red61.com -------------- next part -------------- A non-text attachment was scrubbed... Name: chris.paton.vcf Type: text/x-vcard Size: 230 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20071123/00a747b6/attachment-0017.vcf From hho at bibliotheca.dk Fri Nov 23 06:45:36 2007 From: hho at bibliotheca.dk (Hans Hvelplund Odborg) Date: Fri, 23 Nov 2007 14:45:36 +0100 Subject: [Rxtx] RXTX parallel port issues In-Reply-To: <4746C6E2.3000304@red61.com> References: <4746C6E2.3000304@red61.com> Message-ID: <001201c82dd7$21c6e2c0$6a37a8c0@HANSLAPTOP> I've experienced similar crashes in JVM when writing to the parallel port in windows (with rxtx). Unfortunately I did not save the data sent to the parallel port so cannot say anything about the length. Furthermore, I recall having problems with .write(byte) (would never exit if I recall correctly), but I do not recall if this was with serial or parallel or both. In the end, we ended printing through Java's support of the windows driver. Unfortunately I currently don?t have the time to investigate these issues further. I just wanted to let you know that currently there are bugs in rxtx. Med venlig hilsen / Best regards / Med v?nliga h?lsningar Hans Hvelplund Odborg BIBLIOTHECA A/S Vallensb?kvej 20B ? 2605 Br?ndby ? Denmark Tel.: +45 70271008 Fax: +45 70271009 hho at bibliotheca.dk www.bibliotheca.dk -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Chris Paton Sent: 23. november 2007 13:26 To: rxtx at qbang.org Subject: [Rxtx] RXTX parallel port issues Hi there, I've been happily using RXTX to communicate with a serial based point-of-sale printer for a several months. I've recently received a parallel based printer and have been trying to get RXTX to talk to this too. I've encountered a few problems along the way and just wanted to check if I'm doing anything wrong, or if I've found any bugs. Writing ------- Writing to the parallel port using ParallelPort.getOutputStream works well, except when I use OutputStream.write(byte[]) to write a multiple of 8 bytes (!). Doing this causes the JVM to crash with an EXCEPTION_PRIV_INSTRUCTION on Windows. I worked around this in my application by adding an additional byte if bytesToWrite % 8 == 0. I guess I could also have called write(byte) repeatedly. This also generated a SIGSEGV on Linux but I was unable to reproduce it today using the CVS version of RXTX and a recent kernel. Reading status pins ------------------- On Linux, I've found that ParallelPort.isPaperOut and ParallelPort.isPrinterSelected appear to be inverted; i.e. when the paper is out ParallelPort.isPaperOut returns false, and when there is paper ParallelPort.isPaperOut returns true! I've tested this in both Sun JDK5 and JDK6 on machines running Linux 2.6.21 and 2.6.23. Fortunately it's easy to use a conditional based on System.getProperty("os.name") to hack around this. Reading from InputStream ------------------------ I've had more serious issues trying to read from ParallelPort.getInputStream. On Windows, readByte seems to return -1 (end of stream) any time data isn't available. On Linux, I got a kernel oops, even with a recent 2.6.23.1 kernel. I was able to stop this using a kernel patch that I found via Google. Although this stopped the oops, I still get frequent IOExceptions when calling InputStream.readByte. It appears that instead of blocking, readByte throws an IOException with message "Resource temporarily unavailable in readByte" any time it is called when no data is available. Occasionally, I get an exception instead of the data I was expecting to read, e.g when asking my printer for a version string I get "VER: S3306 * 06.03* 10/*6/06" where the *s indicate that an exception occurred and data was missed. Any advice that anyone can offer would be much appreciated. If you need any more details or debugging information about any of these problems then let me know. Cheers -- Chris Paton Technical Developer Red61 -- Transaction Marketing Software http://www.red61.com From tjarvi at qbang.org Fri Nov 23 16:28:23 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 23 Nov 2007 16:28:23 -0700 (MST) Subject: [Rxtx] RXTX parallel port issues In-Reply-To: <001201c82dd7$21c6e2c0$6a37a8c0@HANSLAPTOP> References: <4746C6E2.3000304@red61.com> <001201c82dd7$21c6e2c0$6a37a8c0@HANSLAPTOP> Message-ID: It would be good to create a bug report for this so others can either look into it or find the report to confirm their suspicions. Currently, there is only one parallel port bug report. http://bugzilla.qbang.org/show_bug.cgi?id=40 As we do update the reports when bugs are fixed, it gives people a chance to put themselves on the CC list and get notification of fixes they are interested in. On Fri, 23 Nov 2007, Hans Hvelplund Odborg wrote: > > I've experienced similar crashes in JVM when writing to the parallel port in > windows (with rxtx). > > Unfortunately I did not save the data sent to the parallel port so cannot > say anything about the length. > > Furthermore, I recall having problems with .write(byte) (would never exit if > I recall correctly), but I do not recall if this was with serial or parallel > or both. > > In the end, we ended printing through Java's support of the windows driver. > > Unfortunately I currently don?t have the time to investigate these issues > further. I just wanted to let you know that currently there are bugs in > rxtx. > > > Med venlig hilsen / Best regards / Med v?nliga h?lsningar > Hans Hvelplund Odborg > > BIBLIOTHECA A/S > Vallensb?kvej 20B ? 2605 Br?ndby ? Denmark > Tel.: +45 70271008 > Fax: +45 70271009 > hho at bibliotheca.dk > www.bibliotheca.dk > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Chris Paton > Sent: 23. november 2007 13:26 > To: rxtx at qbang.org > Subject: [Rxtx] RXTX parallel port issues > > Hi there, > > I've been happily using RXTX to communicate with a serial based > point-of-sale printer for a several months. I've recently received a > parallel based printer and have been trying to get RXTX to talk to this > too. I've encountered a few problems along the way and just wanted to > check if I'm doing anything wrong, or if I've found any bugs. > > Writing > ------- > Writing to the parallel port using ParallelPort.getOutputStream works > well, except when I use OutputStream.write(byte[]) to write a multiple > of 8 bytes (!). Doing this causes the JVM to crash with an > EXCEPTION_PRIV_INSTRUCTION on Windows. I worked around this in my > application by adding an additional byte if bytesToWrite % 8 == 0. I > guess I could also have called write(byte) repeatedly. > > This also generated a SIGSEGV on Linux but I was unable to reproduce it > today using the CVS version of RXTX and a recent kernel. > > Reading status pins > ------------------- > On Linux, I've found that ParallelPort.isPaperOut and > ParallelPort.isPrinterSelected appear to be inverted; i.e. when the > paper is out ParallelPort.isPaperOut returns false, and when there is > paper ParallelPort.isPaperOut returns true! I've tested this in both Sun > JDK5 and JDK6 on machines running Linux 2.6.21 and 2.6.23. Fortunately > it's easy to use a conditional based on System.getProperty("os.name") to > hack around this. > > Reading from InputStream > ------------------------ > > I've had more serious issues trying to read from > ParallelPort.getInputStream. On Windows, readByte seems to return -1 > (end of stream) any time data isn't available. > > On Linux, I got a kernel oops, even with a recent 2.6.23.1 > kernel. I was able to stop this using a kernel patch > > that I found via Google. Although this stopped the oops, I still get > frequent IOExceptions when calling InputStream.readByte. It appears that > instead of blocking, readByte throws an IOException with message > "Resource temporarily unavailable in readByte" any time it is called > when no data is available. Occasionally, I get an exception instead of > the data I was expecting to read, e.g when asking my printer for a > version string I get "VER: S3306 * 06.03* 10/*6/06" where the *s > indicate that an exception occurred and data was missed. > > > Any advice that anyone can offer would be much appreciated. If you need > any more details or debugging information about any of these problems > then let me know. > > Cheers > From manujnaman at yahoo.com Sun Nov 25 14:59:21 2007 From: manujnaman at yahoo.com (manuj naman) Date: Sun, 25 Nov 2007 13:59:21 -0800 (PST) Subject: [Rxtx] Problem reading 1-wire device using RXTX on Linux In-Reply-To: Message-ID: <104159.48942.qm@web37909.mail.mud.yahoo.com> Trent, dmesg | grep tty gives nothing. however, greping for usb does. The output for that is below. touch /var/lock/test.lock file does not exist, the directory does exits though. tail -f /dev/ttyUSB0 gives nothing simply because ttyUSB0 does not exist. Seems as if USB ports are not there... however, numerous /dev/tty* exist starting from /dev/tty, /dev/tty0, /dev/tty1... to ... /dev/ttyzf. The result of dmesg | grep usb is as follows: [17179576.220000] usbcore: registered new driver usbfs [17179576.220000] usbcore: registered new driver hub [17179576.572000] usb 1-1: new low speed USB device using uhci_hcd and address 2 [17179576.992000] usb 2-1: new full speed USB device using uhci_hcd and address 2 [17179577.132000] usbcore: registered new driver hiddev [17179577.188000] input: USB HID v1.11 Mouse [Microsoft Microsoft Wireless Optical Mouse� 1.00] on usb-0000:00:1f.2-1 [17179577.188000] usbcore: registered new driver usbhid [17179577.188000] drivers/usb/input/hid-core.c: v2.6:USB HID core driver [17179577.192000] usb-storage: device found at 2 [17179577.192000] usb-storage: waiting for device to settle before scanning [17179577.192000] usbcore: registered new driver usb-storage [17179582.192000] usb-storage: device scan complete [17209993.728000] usb 1-2: new full speed USB device using uhci_hcd and address 3 [17209994.816000] usbcore: registered new driver DS9490R [17248016.760000] usb 1-1: USB disconnect, address 2 [17302939.908000] usb 1-2: USB disconnect, address 3 [17302944.856000] usb 1-2: new full speed USB device using uhci_hcd and address 4 [17794170.232000] usb 1-2: USB disconnect, address 4 Does it help in diagnosis? The name of the 1-wire viewer device is DS9490 Best regards, Manuj Trent Jarvi wrote: On Wed, 21 Nov 2007, manuj naman wrote: > Hello, > > I am trying to use the RXTX library on Ubuntu (Debian) linux to read iButtons. It works perfectly on Windows. However on my linux machines it gives the following errors. I am using DS9490 (USB port adapter) to read the iButtons. > > I have followed your instructions on the Wiki. I recompiled the rxtx library to produce the .so and .jar files. But still it gives me this: > > manujnaman at sensor:~/iButton/onewireviewer$ java -cp $CLASSPATH:./OneWireAPI.jar:./OneWireViewer.jar OneWireViewer > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > Warning: serial communications API not setup properly, no ports in enumeration > Pure-Java DS9097U adapter will not work, not added to adapter enum > > Standard drivers for 1-Wire are not found. > Please download the latest drivers from http://www.ibutton.com > Or install RXTX Serial Communications API from http://www.rxtx.org > > Do you know how to solve the "Serial communications API not setup properly, no ports in enumeration" problem? > > Also, how to detect which what /dev/* is the port to be used? On Windows this is simply USB1, on linux this is a bit unclear. Hi Manuj What is the output of the following? dmesg |grep tty touch /var/lock/test.lock && rm -f /var/lock/test.lock If you see something like /dev/ttyUSB0 in the dmesg output, what happens if you do something like tail -f /dev/ttyUSB0? These test each of the usual suspects. We are looking for missing USB drivers, no permission to create a lockfile and no read permission for the device. -- Trent Jarvi tjarvi at qbang.org --------------------------------- Be a better sports nut! Let your teams follow you with Yahoo Mobile. Try it now. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071125/ef4f80c4/attachment-0005.html From tjarvi at qbang.org Sun Nov 25 16:43:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 25 Nov 2007 16:43:04 -0700 (MST) Subject: [Rxtx] Problem reading 1-wire device using RXTX on Linux In-Reply-To: <104159.48942.qm@web37909.mail.mud.yahoo.com> References: <104159.48942.qm@web37909.mail.mud.yahoo.com> Message-ID: Hi Manuj, This does help diagnose the problem. Sadly the answer is in the system configuration of your debian system. I can only point you towards some areas that are suspect. /dev/tty01->/dev/ttyzz are terminals which are not of interest. It appears that the usb serial kernel module is not loading. That is usually in a directory like the following: /lib/modules/2.6.*/kernel/drivers/usb/serial modprobe is used to manually load the drivers. Your /dev/* may be created based upon the kernel modules loaded or MAKEDEV may be used to create the devices. /etc/modules.conf may be what is misconfigured though I'm not sure. One of the modules in usb/serial is probably responsible for representing your USB dongle as a tty. UDEV is probably responsible for creating ttyUSB01 once the kernel module is loaded. Perhaps someone has been through this before but basically this is a system configuration problem or a missing kernel driver. Once /dev/USB?? are present, rxtx should find the port. On Sun, 25 Nov 2007, manuj naman wrote: > Trent, > > dmesg | grep tty > gives nothing. however, greping for usb does. The output for that is below. > > touch /var/lock/test.lock file does not exist, the directory does exits though. > > tail -f /dev/ttyUSB0 gives nothing simply because ttyUSB0 does not exist. > > Seems as if USB ports are not there... however, numerous /dev/tty* exist starting from /dev/tty, /dev/tty0, /dev/tty1... to ... /dev/ttyzf. > > The result of dmesg | grep usb is as follows: > > [17179576.220000] usbcore: registered new driver usbfs > [17179576.220000] usbcore: registered new driver hub > [17179576.572000] usb 1-1: new low speed USB device using uhci_hcd and address 2 > [17179576.992000] usb 2-1: new full speed USB device using uhci_hcd and address 2 > [17179577.132000] usbcore: registered new driver hiddev > [17179577.188000] input: USB HID v1.11 Mouse [Microsoft Microsoft Wireless Optical Mouse� 1.00] on usb-0000:00:1f.2-1 > [17179577.188000] usbcore: registered new driver usbhid > [17179577.188000] drivers/usb/input/hid-core.c: v2.6:USB HID core driver > [17179577.192000] usb-storage: device found at 2 > [17179577.192000] usb-storage: waiting for device to settle before scanning > [17179577.192000] usbcore: registered new driver usb-storage > [17179582.192000] usb-storage: device scan complete > [17209993.728000] usb 1-2: new full speed USB device using uhci_hcd and address 3 > [17209994.816000] usbcore: registered new driver DS9490R > [17248016.760000] usb 1-1: USB disconnect, address 2 > [17302939.908000] usb 1-2: USB disconnect, address 3 > [17302944.856000] usb 1-2: new full speed USB device using uhci_hcd and address 4 > [17794170.232000] usb 1-2: USB disconnect, address 4 > > Does it help in diagnosis? The name of the 1-wire viewer device is DS9490 > > Best regards, > Manuj > > > Trent Jarvi wrote: On Wed, 21 Nov 2007, manuj naman wrote: > >> Hello, >> >> I am trying to use the RXTX library on Ubuntu (Debian) linux to read iButtons. It works perfectly on Windows. However on my linux machines it gives the following errors. I am using DS9490 (USB port adapter) to read the iButtons. >> >> I have followed your instructions on the Wiki. I recompiled the rxtx library to produce the .so and .jar files. But still it gives me this: >> >> manujnaman at sensor:~/iButton/onewireviewer$ java -cp $CLASSPATH:./OneWireAPI.jar:./OneWireViewer.jar OneWireViewer >> Experimental: JNI_OnLoad called. >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> Warning: serial communications API not setup properly, no ports in enumeration >> Pure-Java DS9097U adapter will not work, not added to adapter enum >> >> Standard drivers for 1-Wire are not found. >> Please download the latest drivers from http://www.ibutton.com >> Or install RXTX Serial Communications API from http://www.rxtx.org >> >> Do you know how to solve the "Serial communications API not setup properly, no ports in enumeration" problem? >> >> Also, how to detect which what /dev/* is the port to be used? On Windows this is simply USB1, on linux this is a bit unclear. > > > Hi Manuj > > What is the output of the following? > > dmesg |grep tty > > touch /var/lock/test.lock && rm -f /var/lock/test.lock > > If you see something like /dev/ttyUSB0 in the dmesg output, what happens > if you do something like > > tail -f /dev/ttyUSB0? > > These test each of the usual suspects. We are looking for missing USB > drivers, no permission to create a lockfile and no read permission for the > device. > > -- > Trent Jarvi > tjarvi at qbang.org > > > > --------------------------------- > Be a better sports nut! Let your teams follow you with Yahoo Mobile. Try it now. From netbeans at gatworks.com Mon Nov 26 06:53:02 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 26 Nov 2007 08:53:02 -0500 Subject: [Rxtx] #undef TIOCSERGETLSR on LINUX Message-ID: <474ACFBE.5050406@gatworks.com> So I undef'ed the define TIOCSERGETLSR on a linux box, I find that RXTX no longer works . this is a :{ It appears that the sigprocmask( SIG_SETMASK, &newmask, &oldmask ) at src/SerialImp.c:1427 seems to unblock more events than it should. On a linux box there are 2 other events that are blocked, and this code un-sets them, and the thread hangs. It also appears that this code is incomplete. Also, if you only add in the block for SIGCHLD ( which I think is what someone wanted ) , the code will (soon) core-dump ( or silently exit ). So has anyone run with this code ? From tjarvi at qbang.org Mon Nov 26 19:32:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 26 Nov 2007 19:32:54 -0700 (MST) Subject: [Rxtx] #undef TIOCSERGETLSR on LINUX In-Reply-To: <474ACFBE.5050406@gatworks.com> References: <474ACFBE.5050406@gatworks.com> Message-ID: On Mon, 26 Nov 2007, U. George wrote: > So I undef'ed the define TIOCSERGETLSR on a linux box, I find that RXTX > no longer works . this is a :{ > > It appears that the sigprocmask( SIG_SETMASK, &newmask, &oldmask ) at > src/SerialImp.c:1427 seems to unblock more events than it should. On a > linux box there are 2 other events that are blocked, and this code > un-sets them, and the thread hangs. > > It also appears that this code is incomplete. > Also, if you only add in the block for SIGCHLD ( which I think is what > someone wanted ) , the code will (soon) core-dump ( or silently exit ). > > So has anyone run with this code ? Hi George, The case when TIOCSERGETLSR is not defined is currently used on Solaris. Linux has used the TIOCSERGETLSR. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Nov 26 19:56:24 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 26 Nov 2007 21:56:24 -0500 Subject: [Rxtx] #undef TIOCSERGETLSR on LINUX In-Reply-To: References: <474ACFBE.5050406@gatworks.com> Message-ID: <474B8758.6010006@gatworks.com> Technically, with, or without TIOCSERGETLSR it *SHOULD* work the same. Still does not explain the SIGSEGV on the current development code Trent Jarvi wrote: > On Mon, 26 Nov 2007, U. George wrote: > >> So I undef'ed the define TIOCSERGETLSR on a linux box, I find that RXTX >> no longer works . this is a :{ From Joshua.Gerdes at xerox.com Tue Nov 27 16:00:07 2007 From: Joshua.Gerdes at xerox.com (Gerdes, Joshua) Date: Tue, 27 Nov 2007 15:00:07 -0800 Subject: [Rxtx] Trying to use RXTX Message-ID: Hello, I've been using Java for a little while, but am no master. This is my story: I'm trying to write a simple program that will use RXTX to open a serial port on com4, read from it and write to it. I must be doing something wrong because this doesn't seem to be working - I sort of hodge-podged this together from an example that was on the rxtx website. Basically I call the connect method I wrote, that seems to work (no exceptions atleast), I call writeSerial method, and though I don't know for sure if this works it doesn't throw any exceptions, but then I try calling readSerial and never get anything. Can anyone tell me why this isn't working? I must just be doing something flat out wrong. I know that my serial device responds fine when communicated to - I've checked it on a serial terminal. Also, what is considered the end of the input stream? I nabbed this from an example and wonder when the while loop in readSerial will end. /******************************************** * name: readSerial * description: reads from serial port until \0? * arguments: none * returns: read bytes from serial port *******************************************/ private byte [] readSerial() throws IOException{ byte [] buffer = new byte [128]; //read until end of stream. whats considered the end? int len = -1; while ( ( len = serialIn.read(buffer)) > -1 ); return(buffer); } /******************************************** * name: writeSerial * description: writes to serial port until * arguments: String to write * returns: none *******************************************/ private void writeSerial(String data) throws IOException{ byte [] buffer = data.getBytes(); serialOut.write(buffer); } /******************************************** * name: connect * description: opens serial port. * arguments: Com port name * returns: none *******************************************/ void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(9600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE); serialIn = serialPort.getInputStream(); serialOut = serialPort.getOutputStream(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } /******************************************** * name: closeSerial * description: close serial port. * arguments: none * returns: none *******************************************/ private void closeSerial() throws IOException{ serialIn.close(); serialOut.close(); } //some globals private InputStream serialIn; private OutputStream serialOut; -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071127/b9b8cae8/attachment-0003.html From tjarvi at qbang.org Tue Nov 27 21:45:07 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Nov 2007 21:45:07 -0700 (MST) Subject: [Rxtx] Trying to use RXTX In-Reply-To: References: Message-ID: On Tue, 27 Nov 2007, Gerdes, Joshua wrote: > Hello, > > I've been using Java for a little while, but am no master. This is my > story: > > I'm trying to write a simple program that will use RXTX to open a serial > port on com4, read from it and write to it. I must be doing something > wrong because this doesn't seem to be working - I sort of hodge-podged > this together from an example that was on the rxtx website. Basically I > call the connect method I wrote, that seems to work (no exceptions > atleast), I call writeSerial method, and though I don't know for sure if > this works it doesn't throw any exceptions, but then I try calling > readSerial and never get anything. Can anyone tell me why this isn't > working? I must just be doing something flat out wrong. I know that my > serial device responds fine when communicated to - I've checked it on a > serial terminal. Also, what is considered the end of the input stream? I > nabbed this from an example and wonder when the while loop in readSerial > will end. > It is hard to tell for sure without seeing main(). Here are a few hints. Sometimes when you try to communicate with a device, the white space is important. Perhaps the device knows that you are done transmitting a message when it reads a new line. Maybe it is a null character. Maybe you typed the same string into the terminal and then hit not thinking that was a character too. Serial communication can now go 3 Mb/sec with the right hardware but most of use don't have that :). Don't read right after you right. You can look at the bytes available with tha API. You can wait for bytes available events. Give the electrons a running head start if in doubt; they have been doing this since the 1960's and need a break now and then. The exact behavior of read depends upon the timeout and threshold. A 0 timeout and 0 threshold should block. There is no end of to a stream. Some terminals consider control-d the EOF and close. That is always the interesting part of serial communication. Often you end up creating some sort of packet based communication to know when you are done reading. Other times, you eat a byte at a time and make some decision. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 27 22:40:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Nov 2007 22:40:41 -0700 (MST) Subject: [Rxtx] #undef TIOCSERGETLSR on LINUX In-Reply-To: <474B8758.6010006@gatworks.com> References: <474ACFBE.5050406@gatworks.com> <474B8758.6010006@gatworks.com> Message-ID: Hi George, The last time I saw a segv it was related to 64 bit processors and how we stored pointers. Could you describe your system a bit and the serial device being used? I might just make sure I have access to one before the next release. I agree that doing an undef on TIOCSERGETLSR is a good thing to try. But given the afterthought/reaction nature of the ifdefs in rxtx, I would not put it past silly preprocessing mistakes that may be as simple as you don't have a Solaris machine or have a Linux machine and we didn't handle that case right. The ifdefs go both ways there. It is possible to attach gdb to the jvm. HP and IBM have published some info on that that google can find. Usually when rxtx segv's it is so blatant, the eventThread does not even start. I've usually just sprinkled some debug messages then stared at the sillyness. The Linux code should not be hard to figure out with an example system. The w32 issues have been what takes me time to figure out. On Mon, 26 Nov 2007, U. George wrote: > Technically, with, or without TIOCSERGETLSR it *SHOULD* work the same. > Still does not explain the SIGSEGV on the current development code > > Trent Jarvi wrote: >> On Mon, 26 Nov 2007, U. George wrote: >> >>> So I undef'ed the define TIOCSERGETLSR on a linux box, I find that RXTX >>> no longer works . this is a :{ > From netbeans at gatworks.com Wed Nov 28 07:16:17 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 28 Nov 2007 09:16:17 -0500 Subject: [Rxtx] #undef TIOCSERGETLSR on LINUX In-Reply-To: References: <474ACFBE.5050406@gatworks.com> <474B8758.6010006@gatworks.com> Message-ID: <474D7831.5010300@gatworks.com> Box is a PIII laptop, with a USB 1 port. Device is a serialUSB device ( as per linux/redhat ) Debugging is not terribly easy on LINUX when there are pthreads involved. Its not getting easier when SUN/java has placed extensive hooks in catching and logging ( catchable ) events. for example this logfile excerp: > # > # An unexpected error has been detected by Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0xb50ad67b, pid=4291, tid=16386 > # > # Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, sharing) > # Problematic frame: > # C [librxtxSerial.so+0x567b] Java_gnu_io_RXTXPort_interruptEventLoop+0xd3 > # > # If you would like to submit a bug report, please visit: > # http://java.sun.com/webapps/bugreport/crash.jsp > # > > --------------- T H R E A D --------------- > > Current thread (0x08291800): JavaThread "main" [_thread_in_native, id=4293] > > siginfo:si_signo=11, si_errno=0, si_code=1, si_addr=0xb50a77a0 > There are more java magical switches to aid in debugging, but they appear to be undocumented. So I have to go back to some old e-mails Right now I think its the SIGABRT that is sent a second time ( the first is caught ) to interrupt the drain_loop thread. > > The Linux code should not be hard to figure out with an example system. > The w32 issues have been what takes me time to figure out. From dwippermann at gmx.net Wed Nov 28 08:47:04 2007 From: dwippermann at gmx.net (Daniel Wippermann) Date: Wed, 28 Nov 2007 16:47:04 +0100 Subject: [Rxtx] Dual Core Problem In-Reply-To: References: Message-ID: Hi all, > I am struggling with an application that uses RXTX 2.1.7 and has been > working reliably in the past. When this program runs on a dual-core DELL > (Intel T2500), strange things happen with the RS232 communication. The > application is missing incoming characters and also often freezes when > trying to close the serial port. I highly suspect a threading problem > and was wondering if a) anybody had run into a similar problem with dual > core processors and b) if there is a list of does and dont's when it > comes to RXTX and threads. I just stumbled over the same "freeze" of the application while trying to "close()" the RXTXPort. In this rare circumstances the "IOLocked" variable of the RXTXPort class still has a value greater than 0 although no action is pending. That makes the close() method sleep forever in expectation of some other thread to end its work... I believe this is caused by the "IOLocked++" and "IOLocked--" instructions not being synchronized. I suspect that in a multi-core- CPU environment there is a chance that this instructions may interfere if two threads are operating on the same port, but in different CPU cores. In my example the monitor thread is reading the port, while the main thread, that opened the port, is writing to it. I just changed my application so that every port handling method call is done from within a synchronized method or block. I have not observed another freeze since then, although I did an extensive stress test. But I think it would be nice if you could do the synchronisation from within the library in a future release. Best regards, Daniel From keithvz at verizon.net Thu Nov 1 08:08:58 2007 From: keithvz at verizon.net (Keith) Date: Thu, 01 Nov 2007 10:08:58 -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: <4729DDFA.7080206@verizon.net> Trent Jarvi wrote: > 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? Well, I honestly don't know how all this fits together. I think it's just a matter of enabling the right flow control option within the standard serial framework to tell the device driver, "HEY START USING DTR/DSR FOR FLOW CONTROL." If what UGeorge said,(about that type of nitty-gritty lead control being done within the device driver), is true, then this confirms my suspicion. I tried narrowing down within the Linux drivers what you are looking for, but I can't entirely tell wth I'm looking at. (virtual com port drivers -- they are included compiled by default with Ubuntu, source included) http://www.ftdichip.com/Drivers/VCP/Linux/ftdi_sio.tar.gz Hahahaa, they make a reference to DTR flow control being supported but say (UGH) in parenthesis. You can also use their direct device driver library on Ubuntu -- libftd2xx.so.0.4.13. No source code. http://www.ftdichip.com/Drivers/D2XX/Linux/libftd2xx0.4.13.tar.gz In that case, you make a call to their FT_SetFlowControl() function. FT_STATUS FT_SetFlowControl (FT_HANDLE ftHandle, USHORT usFlowControl, UCHAR uXon,UCHAR uXoff) Parameters ftHandle Handle of the device. usFlowControl Must be one of FT_FLOW_NONE, FT_FLOW_RTS_CTS, ****FT_FLOW_DTR_DSR**** or FT_FLOW_XON_XOFF. uXon Character used to signal Xon. Only used if flow control is FT_FLOW_XON_XOFF. uXoff Character used to signal Xoff. Only used if flow control is FT_FLOW_XON_XOFF. This is from their programming guide http://www.ftdichip.com/Documents/ProgramGuides/D2XXPG34.pdf I actually want to take this a step further and say that I think the flow control is actually handled right on the device itself in hardware/firmware. It's enabled through the device driver, but I think the maintaining of buffers, asserting/deasserting of leads, etc is handled by the device. For the time being, I've switched to jd2xx, https://jd2xx.dev.java.net/ and http://bleyer.org/jd2xx/ These are Java wrappers for the device driver libraries. It allows almost direct access to the well-documented device drivers from Java. I hope this helps Keith From tjarvi at qbang.org Thu Nov 1 11:09:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:09:51 -0600 (MDT) 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: Hi Martin, What I usually have done is allow changes that do not impact working software including changes to methods not documented in CommAPI (which remain undocumented in rxtx) and fixes to known problems in the documented portions. That way if you use the documented API, the releases should only become better with time. If you use the undocumented portions, the behavior is not as predictable but open for improvement. On Wed, 31 Oct 2007, 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 >> > From tjarvi at qbang.org Thu Nov 1 11:15:52 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:15:52 -0600 (MDT) 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: I too use rxtx in commercial products. The problem I've been trying to address while bringing the server back was how to make it possible for hobby folks to build the same software as companies so we can move rxtx along a little faster. Exposing internal tools is not an option at this time, the public rxtx builds have been done on my home machine which has drives hanging out of it all over the place dying one at a time. This isn't maintainable. I'm currently looking at the possibility of making an S3 image available on Amazon's EC. These are machines you can rent for ~10 cents an hour which is more than enough to build rxtx. The S3 image is not changed when people use it so everyone has the same starting point. With this, we could all build rxtx for ~20 platforms for a small price and eliminate tool issues. On Wed, 31 Oct 2007, Greg Johnson wrote: > 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 tjarvi at qbang.org Thu Nov 1 11:19:55 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:19:55 -0600 (MDT) 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: On Wed, 31 Oct 2007, 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. I was helping Dmitry do the Mac OS X port without access to a machine when we put that in. In the archives there is information (easily found with google on Apple's site) that describes how their API (and others) can determine if a port is used and ignore it. I think these changes are in CVS but need to confirm. The bottom line is that rxtx should not have used lock files on Mac. It was just ignorance of the system on my part. -- Trent Jarvi tjarvi at qbang.org From fabioanjos at gmail.com Thu Nov 1 12:35:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Thu, 1 Nov 2007 15:35:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Hi, I was using SerialEventListener in my project. But, as was said here, id doesnt work very well with virtual serial ports. So, I changed the strategy using the code posted here in this thread: try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > 0) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } The thing is that in my tests I could notice that in.read(buffer) never blocks. Even when there's nothing to read. Instead of blocking when there's nothing to read it returns 0. So, my questions are: 1. Am I doing something wrong? 2. If not, wouldnt this decrease performance? (the thread would be locked in a loop that does nothing.) 3. Is there a better way to do the job? Thanks in advance!! F?bio -------- On 10/31/07, Andre-John Mas wrote: > > > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/0aee59d0/attachment-0031.html From ajmas at sympatico.ca Thu Nov 1 16:07:55 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Nov 2007 18:07:55 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Message-ID: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From sarah_662005 at yahoo.com Thu Nov 1 17:10:05 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Thu, 1 Nov 2007 16:10:05 -0700 (PDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Message-ID: <351433.37166.qm@web55814.mail.re3.yahoo.com> Thank you very much for your help. Now the application works fine. the serialEvent gets triggered. Rxtx is cool! ----- Original Message ---- From: Andre-John Mas To: Sara Hugh ; RXTX Developers and Users Sent: Wednesday, October 31, 2007 9:55:45 AM Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered 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 __________________________________________________ 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/20071101/4a86bea6/attachment-0031.html From tjarvi at qbang.org Thu Nov 1 17:58:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 17:58:02 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx Message-ID: The rxtx.org site is primarily interested in the hobby aspects of rxtx. Obviously, there are some companies following the work too. These interests bring larger workflows and concerns about details hobby folks may not care about. They also bring many more users. I know the company I work for has a quality engineering effort going on which includes rxtx. While the server was down, I was contacted by another company that was missing the binaries for their testing. Several people have mentioned concerns about a stable release for like reasons. Would there be interest on the quality side of the coin to get together? It could be just sharing email's with each other or a seperate list for QE/QA. I can not say for sure, but we may be able to share some of our efforts/results that could help keep rxtx releases stable. -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Fri Nov 2 01:42:55 2007 From: scldad at sdc.com.au (Stephen Davies) Date: Fri, 2 Nov 2007 18:12:55 +1030 Subject: [Rxtx] Multiple modems Message-ID: <200711021812.56047.scldad@sdc.com.au> This may or may not be related to the Multiple Ports thread. I have an application which uses rxtx on Linux (via cron jobs) to connect multiple modems to remote sensing devices. The application works fine most of the time but occasionally fails to connect if two (or more) connection attempts happen at about the same time. When it fails, it looks as if it may get confused as to which port it is talking to. The app has a "base" component that looks for an available port, opens it and then creates an input thread and an output thread for the connection and data transfer. The "base" component uses this code: // loop round all known ports until one is available. Give up after three minutes Counter ptimeout = new Counter(); while(!portFound && ptimeout.elapsed() < 180000) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // special case. ttyS0 is not available to us on this server. if (!portId.isCurrentlyOwned() && !portId.getName().equals("/dev/ttyS0")) { gLog.debug(lognm + ": Found port " + portId.getName()); try { serialPort = (RXTXPort) portId.open("AguaModem", 10000); } catch (Exception e) { gLog.error(lognm + ": Port " + portId.getName() + " will not open."); gLog.error(e.getMessage()); continue; } AguaModem aguamodem = new AguaModem(); portFound = true; break; } gLog.debug(lognm + ": Port " + portId.getName() + " is busy"); } } } I am wondering about the isCurrentlyOwned method. Does this actually tell me whether a port is currently being used by another process? TIA, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From fabioanjos at gmail.com Fri Nov 2 04:59:58 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 07:59:58 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Message-ID: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/9009eb1d/attachment-0031.html From netbeans at gatworks.com Fri Nov 2 06:28:13 2007 From: netbeans at gatworks.com (U. George) Date: Fri, 02 Nov 2007 08:28:13 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <472B17DD.1050508@gatworks.com> It should normally block ( unless eof / event ) . so its a :{ whats the device ( to recreate if possible ) and how do u open. > My question is, is there a way to make in.read block the thead until > there's something to read? > From fabioanjos at gmail.com Fri Nov 2 06:34:46 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 09:34:46 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > On 11/1/07, Andre-John Mas wrote: > > > > Fabio, > > > > Turns out there was a small error in my example. The test should be: > > > > (numBytes = in.read(buffer)) > -1 > > > > This is because -1 indicates an end of file (end of data stream) > > > > Andre > > > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > > > Hi, > > > > > > I was using SerialEventListener in my project. But, as was said > > > here, id doesnt work very well with virtual serial ports. > > > So, I changed the strategy using the code posted here in this thread: > > > > > > try{ > > > in = port.getInputStream(); > > > out = port.getOutputStream(); > > > int numBytes = 0; > > > while(active){ > > > > > > byte[] buffer = new byte[10]; > > > > > > while ( (numBytes = in.read(buffer)) > 0) > > > { > > > String dataValue = new String(buffer,0,numBytes); > > > processInput(dataValue); > > > } > > > > > > if(numBytes==-1){ > > > break; > > > } > > > > > > Thread.sleep(50); > > > } > > > > > > }catch(IOException e){ > > > logger.info("falha de comunicacao "+ > > > getReceptor().getPort() ); > > > > > > }catch(InterruptedException e){ > > > logger.info ("Interrompendo leitura da porta "+ > > > getReceptor().getPort() ); > > > } > > > > > > The thing is that in my tests I could notice that in.read(buffer) > > > never blocks. Even when there's nothing to read. Instead of blocking > > > when there's nothing to read it returns 0. > > > > > > So, my questions are: > > > > > > 1. Am I doing something wrong? > > > 2. If not, wouldnt this decrease performance? (the thread would be > > > locked in a loop that does nothing.) > > > 3. Is there a better way to do the job? > > > > > > Thanks in advance!! > > > > > > F?bio > > > -------- > > > > > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > > 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 > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > > > > > -- > > > Atenciosamente, > > > F?bio Cristiano dos Anjos > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/5306c4b1/attachment-0031.html From nick.circelli at infrasafe.com Fri Nov 2 07:01:17 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Fri, 2 Nov 2007 08:01:17 -0500 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com><29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com><90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca><29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Message-ID: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> I'm pretty sure that not blocking has to do with you virtual ports. Cause it should block. Maybe you should try: while ((numBytes = in.available()) > 0) { If (numBytes > buffer.length) { numBytes = buffer.length; // in case you have buffer overflow } numBytes = in.read(buffer, 0 , numBytes)); String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } Also, just for optimization, I'd move that byte[] buffer = new byte[10]; out of the while since you don't need to reallocate it every iteration. ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of F?bio Cristiano dos Anjos Sent: Friday, November 02, 2007 8:35 AM To: RXTX Developers and Users Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream (); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas < ajmas at sympatico.ca > wrote: Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info ("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Atenciosamente, F?bio Cristiano dos Anjos -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/4de7f6a3/attachment-0031.html From fabioanjos at gmail.com Fri Nov 2 07:36:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 10:36:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> Message-ID: <29788b250711020636q1588c88fgaa5e27f5504164fb@mail.gmail.com> Hi Nick, Actually, it doesnt block for physical ports too. And, the method avaiable does not block either, so when there's nothing avaiable the loop ends and the thread stops lintening to the port. But I did some more test with serialEventListener, and now its working. I realy dont know what I've done to get it working. I just start woking as soon as I decided to test it again. It was said here that serialEventListener is not reliable for virtual serial ports. Is there another way to read it, without compromising performance? Tanks again!! F?bio ------- On 11/2/07, Nick Circelli wrote: > > I'm pretty sure that not blocking has to do with you virtual ports. > Cause it should block. > > Maybe you should try: > > > > while ((numBytes = in.available()) > 0) > > { > > If (numBytes > buffer.length) { > > numBytes = buffer.length; // in case you have buffer overflow > > } > > numBytes = in.read(buffer, 0 , numBytes)); > > String dataValue = new String(buffer,0,numBytes,"ASCII"); > > processInput(dataValue); > > } > > > > Also, just for optimization, I'd move that byte[] buffer = new > byte[10]; > > out of the while since you don't need to reallocate it every iteration. > > > ------------------------------ > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On Behalf > Of *F?bio Cristiano dos Anjos > *Sent:* Friday, November 02, 2007 8:35 AM > *To:* RXTX Developers and Users > *Subject:* Re: [Rxtx] serialEvent(SerialPortEvent event) never be > triggered > > > > Hi, > > I think i missunderstand something here. > The code you post here was meant to be used inside serialEvent method, > right? > > The think is, that i cannot user SerialEventListener to read serial ports, > because i need to read virual serial ports and id does not behaves well, as > said here before. serialEvent is never triggered. > > So what I quit using SerialEventListener and created a thread to listen to > the port: > > public void run(){ > try{ > in = port.getInputStream(); > out = port.getOutputStream (); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new > String(buffer,0,numBytes,"ASCII"); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ getReceptor().getPort() > ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > } > > > So, the problem is that in.read(buffer) always returns 0 when there is > nothing to read, instead of blocking the flow, and the thread becames locked > in the loop. > > I hope you can help me solve this. > > Thanks in advance! > > F?bio > -------- > > On 11/2/07, *F?bio Cristiano dos Anjos* wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > > > On 11/1/07, *Andre-John Mas* < ajmas at sympatico.ca> wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info ("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/571df6ea/attachment-0030.html From tjarvi at qbang.org Fri Nov 2 08:32:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Nov 2007 08:32:15 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: References: Message-ID: On Fri, 2 Nov 2007, Greg Johnson wrote: > Hi Trent, folks, > Having a single rxtx that is suitable for commercial uses and hobbyists both > would be a great idea? Perhaps it would be worth submitting rxtx as a > proposal to Codehaus - they not only provide excellent tools (Jira (bug > tracker), Confluence (wiki)) but also support build management ( > maestro, continuum, bamboo). Relying on your personal machine (btw, frii.com > / rxtx.org is down again?) seems like a burden you shouldn't have to shoulder > alone. Hi Greg, There may be a little confusion here. There is no need to have two seperate rxtx releases. What I'm trying to encourage is a discussion between some of the people responsible for making sure rxtx does not break their products each release. Usually these people are interested in testing a set of functionality their product depends upon. They do not work with rxtx code but rather traps to catch when rxtx developers break something. This goes on all the time in isolated labs. There are many services that offer to do various pieces of a project for you if you... Anyone is free to do the 'if you' portion with rxtx and see how it goes. I'm actually interested in doing less of that than more. The rxtx.org work I do just happens to overlap with other things I do for personal/family use. The reason I suggest the amazon solution is that anyone can take full control of the environment for a day and it costs less than a package of gum without causing harm to what anyone else is doing. I assume the down question was with respect to a mod_security setting that has been resolved. If not, please post a url to the problem. -- Trent Jarvi tjarvi at qbang.org From nsayer at kfu.com Sat Nov 3 20:17:49 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 19:17:49 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? Message-ID: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Has anyone got RXTX working with an app under Leopard? My app hangs on port open (it works fine with Tiger). The relevant thread looks like this in the activity monitor: 1536 JVM_InvokeMethod 1536 0x48ccd0 1536 0x46f8a0 1536 0x4c3ff4 1536 0x4c4284 1536 0x357d160 1536 0x357faac 1536 Java_gnu_io_RXTXPort_open 1536 open $NOCANCEL$UNIX2003 1536 open $NOCANCEL$UNIX2003 From ajmas at sympatico.ca Sat Nov 3 22:02:04 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 00:02:04 -0400 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> RXTX works for me with Leopard. I am currently using it communicate with a Bluetooth GPS. What computer and device are you trying to use? Is the driver for your serial device compatible with MacOS X 10.5? Andre On 3-Nov-07, at 22:17 , Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From nsayer at kfu.com Sat Nov 3 22:17:47 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 21:17:47 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> Message-ID: <1720F723-3643-438C-B3AB-E09A67536977@kfu.com> On Nov 3, 2007, at 9:02 PM, Andre-John Mas wrote: > RXTX works for me with Leopard. I am currently using it communicate > with a Bluetooth GPS. > > What computer and device are you trying to use? Is the driver for > your serial device compatible with MacOS X 10.5? An Intel mac mini The FTDI USB serial driver an XMPCR, which is just a fancy serial controlled radio and an FTDI usb-to-serial chip I've successfully used the FTDI driver with another FTDI device in another context. > > > Andre > > On 3-Nov-07, at 22:17 , Nick Sayer wrote: > >> Has anyone got RXTX working with an app under Leopard? >> >> My app hangs on port open (it works fine with Tiger). The relevant >> thread looks like this in the activity monitor: >> >> 1536 JVM_InvokeMethod >> 1536 0x48ccd0 >> 1536 0x46f8a0 >> 1536 0x4c3ff4 >> 1536 0x4c4284 >> 1536 0x357d160 >> 1536 0x357faac >> 1536 >> Java_gnu_io_RXTXPort_open >> 1536 open >> $NOCANCEL$UNIX2003 >> 1536 open >> $NOCANCEL$UNIX2003 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From racecar at gmail.com Sat Nov 3 22:25:53 2007 From: racecar at gmail.com (Kevin Mateo Lim) Date: Sat, 3 Nov 2007 21:25:53 -0700 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: Message-ID: I am alternating between two errors. After i run the macosx_setup.command, "everyone" is set to Read only in /var/lock. I notice in the terminal that the group for these perms is _uucp, not uucp. In that state, I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 check_group_uucp(): error testing lock file creation Error details:Permission deniedcheck_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException : Error inside Serial.() at processing.serial.Serial.errorMessage(Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.( Serial.java:102) at Temporary_829_3245.setup(Temporary_829_3245.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java :690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) Then, I hand edit the "everyone" permissions for /var/lock/ to Read and Write (note /var/spool/uucp is Read/Write in all cases, and doesn't change). I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX uucp_lock() /var/lock/LK.003.009.000 is there gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException: Error inside Serial.() at processing.serial.Serial.errorMessage (Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.(Serial.java:102) at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java:690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) See here: http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071103/f1a2c467/attachment-0029.html From greg.johnson at manchester.ac.uk Sun Nov 4 02:31:13 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sun, 4 Nov 2007 10:31:13 +0100 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <28B5E0A0-0802-4C74-AC21-87ED35F3B9A2@manchester.ac.uk> Hi Nick, I also had problems initially with Leopard, but it was resolved by reinstalling the serial USB driver (FTDI in my case). The symptoms were a non-detection of any ports (but I twigged when I tried ZTerm and it had the same problem). Good luck! Cheers, greg PS I did a "Archive and install" which may be the reason my FTDI driver had disappeared - I don't think the driver has changed for 10.5 ------------------------------------------------------------------------- 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 4 Nov 2007, at 03:17, Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Sun Nov 4 13:01:12 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 15:01:12 -0500 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: Message-ID: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Hi, You will need to get the 2.1-8 code from CVS. See the FAQ for more information: http://rxtx.qbang.org/wiki/index.php/FAQ Andre On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > I am alternating between two errors. > > After i run the macosx_setup.command, "everyone" is set to Read only > in /var/lock. I notice in the terminal that the group for these > perms is _uucp, not uucp. > > In that state, I get this error: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > check_group_uucp(): error testing lock file creation Error > details:Permission deniedcheck_lock_status: No permission to create > lock file. > please see: How can I use Lock Files with rxtx? in INSTALL > gnu.io.PortInUseException: Unknown Application > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > java.lang.RuntimeException : Error inside Serial.() > > at processing.serial.Serial.errorMessage(Serial.java:583) > > at processing.serial.Serial.(Serial.java:148) > > at processing.serial.Serial.( Serial.java:102) > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > at processing.core.PApplet.run(PApplet.java:1556) > > at java.lang.Thread.run(Thread.java:613) > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > and Write (note /var/spool/uucp is Read/Write in all cases, and > doesn't change). I get this error: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > gnu.io.PortInUseException: Unknown Application > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > java.lang.RuntimeException: Error inside Serial.() > > at processing.serial.Serial.errorMessage (Serial.java:583) > > at processing.serial.Serial.(Serial.java:148) > > at processing.serial.Serial.(Serial.java:102) > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > at processing.core.PApplet.run(PApplet.java:1556) > > at java.lang.Thread.run(Thread.java:613) > > See here: > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From netbeans at gatworks.com Sun Nov 4 14:33:35 2007 From: netbeans at gatworks.com (U. George) Date: Sun, 04 Nov 2007 16:33:35 -0500 Subject: [Rxtx] #ifndef TIOCSERGETLSR Message-ID: <472E3AAF.7050709@gatworks.com> For Linux, it seems that you need the code for both *having* a TIOCSERGETLSR, and *not having* a TIOCSERGETLSR. Maybe the ioctl exists system wide, but not necessarily for the device driver itself ( always returns -1 ) . Are there systems that have a *functioning* TIOCSERGETLSR for all their devices? Then this would be the case where the "#ifndef TIOCSERGETLSR" directive could be useful is eliminating the unnecessary code and tests. And for those systems that dont have a TIOCSERGETLSR, then the code for TIOCSERGETLSR can be eliminated. It would be a simple case to have, as a foundation, all the code to simulate the missing TIOCSERGETLSR ioctl. If the system does have the ioctl, then that code can be ifdef'd in, and co-exist with the functionality of the code that simulates the missing TIOCSERGETLSR ioctl. From racecar at gmail.com Sun Nov 4 17:30:19 2007 From: racecar at gmail.com (Kevin Mateo Lim) Date: Sun, 4 Nov 2007 17:30:19 -0700 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: the README.OSX reads: Put libSerial.jnilib in the directory of the application (the JavaVM will find it there). Add RXTXComm.jar to the application classpath or include the classes in the application jar. (Some applications already include the RXTX classes in their application jar, in which case only the file libSerial.jnilib is required). I can't find libSerial.jnilib I put librxtxSerial.jnilib into my Processing /libraries/serial/library/ directory. Yet it still sees the old version: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 On 11/4/07, Andre-John Mas wrote: > > Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > 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/20071104/c0a83f91/attachment-0028.html From ajmas at sympatico.ca Sun Nov 4 17:41:47 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 19:41:47 -0500 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> If you are wanting it to be available for all applications, - for all users: /Library/Java/Extensions - for your user: ~/Library/Java/Extensions Or just for your application, then it should be in the same directory from which yo are launching your application. If you are getting the 2.1-8 source, then the library built is called: librxtxSerial.jnilib despite what the docs say. Andre On 4-Nov-07, at 19:30 , Kevin Mateo Lim wrote: > > the README.OSX reads: > Put > libSerial.jnilib > in the directory of the application (the JavaVM will find it there). > Add > RXTXComm.jar > to the application classpath or include the classes in the > application jar. > (Some applications already include the RXTX classes in their > application jar, > in which case only the file libSerial.jnilib is required). > > > I can't find libSerial.jnilib > I put librxtxSerial.jnilib into my Processing /libraries/serial/ > library/ directory. > > Yet it still sees the old version: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > On 11/4/07, Andre-John Mas wrote: Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial .(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay (PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > From bschlining at gmail.com Sun Nov 4 19:46:23 2007 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 4 Nov 2007 18:46:23 -0800 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> Message-ID: > > Or just for your application, then it should be in the same directory > from which yo are launching your application. Just wanted to add one more way of specifying the native lib location... If you don't want to define it globally by putting it in /Library/Java/Extensions (and you don't, it's a very very bad practice) you can also specify the location of the native library when starting the JVM by specifying the 'java.library.path' property. For example: java -Djava.library.path=/Path/To/Directory/With/RXTX/Library YourMainClass -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071104/c5af6980/attachment-0028.html From greg.johnson at manchester.ac.uk Mon Nov 5 01:39:02 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Mon, 5 Nov 2007 09:39:02 +0100 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: The 2.1-8 code reports 2.1-7, hence your (and my) confusion. But as long as you've removed all traces of the old library, it really _is_ 2.1-8. And if you specify the library path to the VM, don't make my mistake (on OSX at least) - you need to respecify the entire library path it had by default, as the command line argument replaces the path, rather than appending to it. 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 5 Nov 2007, at 01:30, Kevin Mateo Lim wrote: > > the README.OSX reads: > Put > libSerial.jnilib > in the directory of the application (the JavaVM will find it there). > Add > RXTXComm.jar > to the application classpath or include the classes in the > application jar. > (Some applications already include the RXTX classes in their > application jar, > in which case only the file libSerial.jnilib is required). > > > I can't find libSerial.jnilib > I put librxtxSerial.jnilib into my Processing /libraries/serial/ > library/ directory. > > Yet it still sees the old version: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > On 11/4/07, Andre-John Mas wrote: > Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial .(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay (PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > 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 HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071105/7f50506d/attachment-0028.html From cyrille.dumont at tatexpress.fr Mon Nov 5 05:46:03 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 05 Nov 2007 13:46:03 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: References: <472727F1.1000704@tatexpress.fr> Message-ID: <472F108B.2090101@tatexpress.fr> Thanks a lot for your solution ... but I'm not a expert in JAVA ... (sorry) For the moment I've this function : """ public void serialEvent(SerialPortEvent e) { StringBuffer inputBuffer = new StringBuffer(); int newData = 0; switch (e.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } //-- Manag. Data from Scanner this.MngDataScanner(inputBuffer.toString()); break; case SerialPortEvent.BI:; //-- Break Received } } """ How can I do what you write ? ( maybe a simple ex ? ) PS : I don't know the PDF417 size (could be, for example, 338 char, or 500 ... ; what I know is that it can't be more than 800 char) Thanks in advance. Best regards. Trent Jarvi a ?crit : > 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 Martin.Oberhuber at windriver.com Mon Nov 5 08:47:50 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 5 Nov 2007 16:47:50 +0100 Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> Hi Trent, are the interestes of hobbyists really so different from commercial ones? Both should be interested in high quality and innovation the like. I haven't seen too many Open Source projects from the "inside" but those that I have seen did not have separate mailing lists for quality/testing/qa versus innovation/development. What I have seen with the Open Source projects that one would call "successful" is a good deal of process around automated builds, automated unit tests, predictable release dates and milestones, and policies around commiting/contributing/reviewing changes. I think that all of these benefit commercial users and hobbyists the like. If you were just asking about who's interested in discussing changes to foster more quality, count me in. I'm just not sure whether discussing these on a separate mailing list or other channel is the right thing to do. Cheers, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From toupsz at cs.tamu.edu Tue Nov 6 14:27:04 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 15:27:04 -0600 Subject: [Rxtx] reading TTL level signals from serial? Message-ID: Dear RXTX community- I've been using RXTX to handle communicating with several hardware devices in Java (a GPS and some custom audio circuitry for my dissertation work). I have a new, high-accuracy GPS which only communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there any way to communicate with this device using RXTX, perhaps by modding the native code for Windows? If so, does anyone have any tips on how to do it? Has it perhaps already been done? Another option is for me to invert / amplify the signal in hardware, but this is difficult for me to pull off due to the sensitivity of the electronics involved...I'll likely end up using a much less accurate piece of equipment rather than go that far! If anyone could help out, I'd really appreciate it! Thanks! -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/b6c59c2b/attachment-0026.html From netbeans at gatworks.com Tue Nov 6 14:55:22 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 06 Nov 2007 16:55:22 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: Message-ID: <4730E2CA.3090009@gatworks.com> This is really a hardware issue. Is there any device ( ie the serial port ) on your computer that will accept the voltage signals ( and load ) that your device produces? Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it happen safely ( ie u dont cook the GPS device ) I have a new, high-accuracy GPS which only > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there > any way to communicate with this device using RXTX, From toupsz at cs.tamu.edu Tue Nov 6 15:14:01 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 16:14:01 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4730E2CA.3090009@gatworks.com> References: <4730E2CA.3090009@gatworks.com> Message-ID: Actually, the device runs over USB, but shows up as a virtual serial port and is outputting these signals. The software that comes with the device (a u-blox ANTARIS 4 eval kit) is able to communicate. RXTX is able to detect and properly configure the port, but does not get any of the data from it. :-/ It seems like there must be some way to do it (obviously, ublox knows how)... -Zach On Nov 6, 2007 3:55 PM, U. George wrote: > This is really a hardware issue. > Is there any device ( ie the serial port ) on your computer that will > accept the voltage signals ( and load ) that your device produces? > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it > happen safely ( ie u dont cook the GPS device ) > > > I have a new, high-accuracy GPS which only > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there > > any way to communicate with this device using RXTX, > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/15ae7a0b/attachment-0026.html From keithvz at verizon.net Tue Nov 6 16:16:55 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 06 Nov 2007 18:16:55 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> Message-ID: <4730F5E7.1030704@verizon.net> Zach Toups wrote: > On Nov 6, 2007 3:55 PM, U. George > wrote: > > This is really a hardware issue. > Is there any device ( ie the serial port ) on your computer that will > accept the voltage signals ( and load ) that your device produces? > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it > happen safely ( ie u dont cook the GPS device ) > > > I have a new, high-accuracy GPS which only > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is > there > > any way to communicate with this device using RXTX, > _______________________________________________ As UGeorge intimated, it's a hardware issue. If your device outputs TTL level voltages, and your USB to serial converter is RS-232, then you've got a physical hardware differences. Inverted leads and voltage issues are mainly the problem. MAXIM makes a neat little chip called the MAX233 (better than the 232, no extern caps required) You can't solve this in software. Now, there are TTL level compatible USB to serial converters available, I happen to be using one right now. This unit below is from a UK company (there might be sources in the US) http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm Parallax makes one that does 3.3 and 5v http://www.parallax.com/detail.asp?product_id=32201 (but only supports RX, TX, GND, AND DTR towards device) (i've tested a variant of the unit above, and it works with RXTX) In both cases, you'll need some creative wiring depending on the interface on your GPS. Hope this helps Keith From toupsz at cs.tamu.edu Tue Nov 6 16:53:01 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 17:53:01 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4730F5E7.1030704@verizon.net> References: <4730E2CA.3090009@gatworks.com> <4730F5E7.1030704@verizon.net> Message-ID: Yeah...I used an FTDI chip to handle USB/serial conversion on the audio equipment I built. I'm leery of trying to build a board for this ublox GPS due to all the grounding/shielding issues around it. Anyway, I apreciate the help...just sad that I can't handle the problem in software! Ublox did send me the source code for their USB drivers...but as a Java programmer, it's a bit tough for me to sort out. ;) Thanks again! -Zach On Nov 6, 2007 5:16 PM, Keith Monahan wrote: > Zach Toups wrote: > > > On Nov 6, 2007 3:55 PM, U. George > > wrote: > > > > This is really a hardware issue. > > Is there any device ( ie the serial port ) on your computer that > will > > accept the voltage signals ( and load ) that your device produces? > > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make > it > > happen safely ( ie u dont cook the GPS device ) > > > > > > I have a new, high-accuracy GPS which only > > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is > > there > > > any way to communicate with this device using RXTX, > > _______________________________________________ > > As UGeorge intimated, it's a hardware issue. > > If your device outputs TTL level voltages, and your USB to serial > converter is RS-232, then you've got a physical hardware differences. > Inverted leads and voltage issues are mainly the problem. MAXIM makes a > neat little chip called the MAX233 (better than the 232, no extern caps > required) > > You can't solve this in software. > > Now, there are TTL level compatible USB to serial converters available, > I happen to be using one right now. > > This unit below is from a UK company (there might be sources in the US) > > http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm > > Parallax makes one that does 3.3 and 5v > > http://www.parallax.com/detail.asp?product_id=32201 > (but only supports RX, TX, GND, AND DTR towards device) > > (i've tested a variant of the unit above, and it works with RXTX) > > In both cases, you'll need some creative wiring depending on the > interface on your GPS. > > Hope this helps > > Keith > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/06e88ad4/attachment-0026.html From netbeans at gatworks.com Tue Nov 6 17:14:01 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 06 Nov 2007 19:14:01 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> <4730F5E7.1030704@verizon.net> Message-ID: <47310349.5000406@gatworks.com> what gps chipset do u have? > Ublox did send me the source code for their USB drivers...but as a Java > programmer, it's a bit tough for me to sort out. ;) From Steffen.DETTMER at ingenico.com Wed Nov 7 03:10:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 7 Nov 2007 11:10:01 +0100 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> Message-ID: <20071107101000.GN10978@elberon.bln.de.ingenico.com> * Zach Toups wrote on Tue, Nov 06, 2007 at 16:14 -0600: > Actually, the device runs over USB, but shows up as a virtual > serial port and is outputting these signals. Ahh, so what you want is to use rxtx on the serial port that is created by the driver and mapped maybe as some COM8 or whatever? I this case then IMHO it would be no hardware question but maybe a problem in your application, or some driver or indeed a rxtx issue. > The software that > comes with the device (a u-blox ANTARIS 4 eval kit) is able to > communicate. Is it sure that this software is really using the virtual serial port and only this port? oki, Steffen -- About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Wed Nov 7 04:59:10 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 06:59:10 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <20071107101000.GN10978@elberon.bln.de.ingenico.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> Message-ID: <4731A88E.6080705@gatworks.com> >> The software that >> comes with the device (a u-blox ANTARIS 4 eval kit) is able to >> communicate. > > Is it sure that this software is really using the virtual serial > port and only this port? > I have tried to read the docs. I have yet to find any explanation on a (windoz) device driver for this device ( the usb device ). That magic is not explained. For a developer thats important magic. Maybe a call to their support team is in order? From netbeans at gatworks.com Wed Nov 7 05:01:38 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 07:01:38 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <20071107101000.GN10978@elberon.bln.de.ingenico.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> Message-ID: <4731A922.7@gatworks.com> Steffen DETTMER wrote: > * Zach Toups wrote on Tue, Nov 06, 2007 at 16:14 -0600: >> Actually, the device runs over USB, but shows up as a virtual BTW: it seems that I am not getting all the Rxtx mail. Is there still a problem? From toupsz at cs.tamu.edu Wed Nov 7 07:36:20 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Wed, 7 Nov 2007 08:36:20 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4731A88E.6080705@gatworks.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> <4731A88E.6080705@gatworks.com> Message-ID: When I emailed them about this issue, they sent me their WinCE drivers, which are apparently based on this open source driver: http://www.yetanotherhomepage.com/j7xx/j7xx.html?/j7xx/software/util/usbdriver.html These include srcdll, and x86 subfolders, though it's not 100% clear to me that these are useful. The ublox communication suite appears to only communicate with serial ports...I've communicated with the ublox on two different comm ports (one with the serial adapter plugged into the serial port, one with the main USB connection), as well as a Garmin bluetooth GPS (which comes up as a bluetooth serial device). I'm not well versed in code this close to the hardware, but it seems to me that if you're running a virtual serial port, then you're virtually controlling the "voltages" that come in on this "port"...so why would they be "ttl level"? :-/ Shouldn't the USB driver be able to interpret the signals in whatever way it wants and just supply software with the binary interpretation? Thanks for all the help, guys, it's really appreciated! -Zach On Nov 7, 2007 5:59 AM, U. George wrote: > > >> The software that > >> comes with the device (a u-blox ANTARIS 4 eval kit) is able to > >> communicate. > > > > Is it sure that this software is really using the virtual serial > > port and only this port? > > > > I have tried to read the docs. I have yet to find any explanation on a > (windoz) device driver for this device ( the usb device ). That magic > is not explained. For a developer thats important magic. Maybe a call > to their support team is in order? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071107/18a13314/attachment-0025.html From netbeans at gatworks.com Wed Nov 7 08:55:55 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 10:55:55 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> <4731A88E.6080705@gatworks.com> Message-ID: <4731E00B.9030902@gatworks.com> There are 2 components to talking to hardware. There is the electrical specification, and then there is the software specification. there is the rs232 specification, parallel port specification, and the USB electrical specification. Generally these are used to plug in the various devices, and hook up electrically. Then there is the software side. There is the device driver, a software component that sits somewhere in the kernel that handles the USB ( in your case ) controller. The device driver generally does not care about the electrical component. There are various chips that handle USB signals, and these chips have I/O addresses so that signals and data can be properly routed. There is also the side that communicates to the user via the COM port device-name. The device driver that you mentioned is for the "Support PL2303 serial chip". This device driver, which hopefully works, handles the USB chip, and eventually recognzes the gps device, and hopefully creates an COM port so the user can open up and communicate. These are a lot of "HOPES". Since u have the web address of the device driver, and developer, I would think that the developer, and any docs, might be better able to help u to first determine if the GPS device is recognized, and the COM port ( maybe its called by another name ) is created, as per documentation. > > These include srcdll, and x86 subfolders, though it's not 100% clear to > me that these are useful. From tjarvi at qbang.org Sat Nov 10 17:46:13 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Nov 2007 17:46:13 -0700 (MST) Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 5 Nov 2007, Oberhuber, Martin wrote: > Hi Trent, > > are the interestes of hobbyists really so different > from commercial ones? Both should be interested in > high quality and innovation the like. > > I haven't seen too many Open Source projects from the > "inside" but those that I have seen did not have > separate mailing lists for quality/testing/qa > versus innovation/development. > > What I have seen with the Open Source projects that > one would call "successful" is a good deal of > process around automated builds, automated unit > tests, predictable release dates and milestones, > and policies around commiting/contributing/reviewing > changes. > > I think that all of these benefit commercial users > and hobbyists the like. > > If you were just asking about who's interested in > discussing changes to foster more quality, count > me in. I'm just not sure whether discussing these > on a separate mailing list or other channel is the > right thing to do. > Hi Martin, There are two issues I'm thinking about. The first is the generic unit testing and quality initiatives required to move rxtx forward. The second is the inevitable fact that rxtx connects to external hardware. The discussion deals with a different set of problems. Here is a simple example of what I'm getting at. We have the capability of setting custom baud rates in rxtx. We may be interested in seeing regressions in rxtx, the C library or the kernel. Some people may be doing some tests with loopback connections. These will always work even if the baud rate is not set to the expected value. Some people may use null modems between two ports. This may be able to catch the problem but not always. Will the build machines be able to test this? (no - for a few reasons) Will people be trying to catch these type of regressions? (yes) What type of coverage does the community have in the end? (?) We could include the discussions in the same list or another equally open list that may be of interest to some folks that deal with these types of problems on a regular basis. -- Trent Jarvi tjarvi at qbang.org From timlow84 at gmail.com Mon Nov 12 00:31:17 2007 From: timlow84 at gmail.com (Timothy Low) Date: Mon, 12 Nov 2007 15:31:17 +0800 Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> Message-ID: <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> ---------- Forwarded message ---------- From: Timothy Low Date: Nov 12, 2007 3:02 PM Subject: Building RXTX From Source To: taj at www.linux.org.uk Cc: ferdinand.tang at tangs.net, Timothy Low , chweehuat.ng at tangs.net Hi Trent, I tried building RXTX from source, and I got this error. I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm trying to get the necessary ".so" files to use for my serial port communication through java. My linux kernal information is: *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 x86_64 x86_64 x86_64 GNU/Linux* I'll most glad if you can provide me some direction on this. Thanks ! ---------------- [root at smsgateway rxtx-2.0-7pre1]# ./configure checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu configure: WARNING: Trying libtool. If the following fails install libtool checking for gcc... gcc checking for C compiler default output... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking for ld used by GCC... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking for a sed that does not truncate output... /bin/sed checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking command to parse /usr/bin/nm -B output... ok checking how to run the C preprocessor... gcc -E checking for egrep... grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for ranlib... ranlib checking for strip... strip checking for objdir... .libs checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.lo... yes checking if gcc supports -fno-rtti -fno-exceptions... yes checking whether the linker (/usr/bin/ld) supports shared libraries... yes checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking dynamic linker characteristics... GNU/Linux ld.so checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no checking whether -lc should be explicitly linked in... no creating libtool checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking for style of include used by make... GNU checking dependency style of gcc... none checking fcntl.h usability... yes checking fcntl.h presence... yes checking for fcntl.h... yes checking sys/fcntl.h usability... yes checking sys/fcntl.h presence... yes checking for sys/fcntl.h... yes checking sys/file.h usability... yes checking sys/file.h presence... yes checking for sys/file.h... yes checking sys/time.h usability... yes checking sys/time.h presence... yes checking for sys/time.h... yes checking sys/signal.h usability... yes checking sys/signal.h presence... yes checking for sys/signal.h... yes checking signal.h usability... yes checking signal.h presence... yes checking for signal.h.. . yes checking termios.h usability... yes checking termios.h presence... yes checking for termios.h... yes checking asm/termbits.h usability... yes checking asm/termbits.h presence... yes checking for asm/termbits.h... yes checking grp.h usability... yes checking grp.h presence... yes checking for grp.h... yes checking pwd.h usability... yes checking pwd.h presence... yes checking for pwd.h... yes checking whether gcc needs -traditional... no checking whether to enable maintainer-specific portions of Makefiles... no /usr/java/jdk1.5.0_13 configure: WARNING: using JAVA_HOME environmental variable adjusted java.home is /usr/java/jdk1.5.0_13 checking os.name Linux checking os.arch i386 checking java.vendor Sun Microsystems Inc. checking java.version 1.5.0_13 checking os.version 2.6.18-8.el5xen comm.jar appears to be installed already. conftest.c: In function 'main': conftest.c:6: warning: incompatible implicit declaration of built-in function 'printf' conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:6: error: (Each undeclared identifier is reported only once conftest.c:6: error: for each function it appears in.) conftest.c:6: error: expected ')' before string constant conftest.c:7: warning: incompatible implicit declaration of built-in function 'exit' ./configure: line 9649: ./conftest: No such file or directory ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected conftest.c: In function 'main': conftest.c:5: warning: incompatible implicit declaration of built-in function 'printf' conftest.c:10: warning: incompatible implicit declaration of built-in function 'exit' configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status : config.h is unchanged config.status: executing depfiles commands [root at smsgateway rxtx-2.0-7pre1]# make install /usr/java/jdk1.5.0_13/bin/javac -classpath .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d /home/jboss/sources/rxtx- 2.0-7pre1/ -O /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java /home/jboss/sources/rxtx-2.0-7pre1/./src/UnSupportedLoggerException.java /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o /home/jboss/sources/rxtx-2.0-7pre1/x86_64-unknown-linux-gnu/SerialImp.lo /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'init_threads': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: cast from pointer to integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_nativeDrain': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: cast to pointer from integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'read_byte_array': /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: cast to pointer from integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_readArray': /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: comparison is always false due to limited range of data type /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_readTerminatedArray': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: comparison is always false due to limited range of data type mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial- 2.0.7pre1.* gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so -o .libs/librxtxSerial-2.0.7pre1.so (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.0.7pre1.so librxtxSerial.so) creating librxtxSerial.la (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la librxtxSerial.la) gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/ParallelImp.lo /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function 'Java_javax_comm_LPRPort_readArray': /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: comparison is always false due to limited range of data type rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* .libs/librxtxParallel-2.0.7pre1.* gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so -o .libs/librxtxParallel- 2.0.7pre1.so (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.0.7pre1.so librxtxParallel.so) creating librxtxParallel.la (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la librxtxParallel.la) make all-am make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' libtool: install: `x86_64-unknown-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 ------------- Regards, Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071112/27758c3c/attachment-0021.html From tjarvi at qbang.org Mon Nov 12 01:02:09 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Nov 2007 01:02:09 -0700 (MST) Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> Message-ID: On Mon, 12 Nov 2007, Timothy Low wrote: > > Hi Trent, Hi Tim, Comments are inline. As I mentioned off the list, rxtx 2.0 is on the edge of deprecation. We can get it working but this is not the path of least resistance for future work. You will probably need to bounce another round of questions off the list. The following is intended to isolate the problem. > > I tried building RXTX from source, and I got this error. > > > I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm trying > to get the necessary ".so" files to use for my serial port communication > through java. > My linux kernal information is: > > *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 x86_64 > x86_64 x86_64 GNU/Linux* > > I'll most glad if you can provide me some direction on this. Thanks ! > > ---------------- > [root at smsgateway rxtx-2.0-7pre1]# ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > checking for C compiler default output... a.out > checking whether the C compiler works... yes > checking whether we are cross compiling... no > checking for suffix of executables... > checking for suffix of object files... o > checking whether we are using the GNU C compiler... yes > checking whether gcc accepts -g... yes > checking for gcc option to accept ANSI C... none needed > checking for ld used by GCC... /usr/bin/ld > checking if the linker (/usr/bin/ld) is GNU ld... yes > checking for /usr/bin/ld option to reload object files... -r > checking for BSD-compatible nm... /usr/bin/nm -B > checking for a sed that does not truncate output... /bin/sed > checking whether ln -s works... yes > checking how to recognise dependent libraries... pass_all > checking command to parse /usr/bin/nm -B output... ok > checking how to run the C preprocessor... gcc -E > checking for egrep... grep -E > checking for ANSI C header files... yes > checking for sys/types.h... yes > checking for sys/stat.h... yes > checking for stdlib.h... yes > checking for string.h... yes > checking for memory.h... yes > checking for strings.h... yes > checking for inttypes.h... yes > checking for stdint.h... yes > checking for unistd.h... yes > checking dlfcn.h usability... yes > checking dlfcn.h presence... yes > checking for dlfcn.h... yes > checking for ranlib... ranlib > checking for strip... strip > checking for objdir... .libs > checking for gcc option to produce PIC... -fPIC > checking if gcc PIC flag -fPIC works... yes > checking if gcc static flag -static works... yes > checking if gcc supports -c -o file.o... yes > checking if gcc supports -c -o file.lo... yes > checking if gcc supports -fno-rtti -fno-exceptions... yes > checking whether the linker (/usr/bin/ld) supports shared libraries... yes > checking how to hardcode library paths into programs... immediate > checking whether stripping libraries is possible... yes > checking dynamic linker characteristics... GNU/Linux ld.so > checking if libtool supports shared libraries... yes > checking whether to build shared libraries... yes > checking whether to build static libraries... no > checking whether -lc should be explicitly linked in... no > creating libtool > checking for a BSD-compatible install... /usr/bin/install -c > checking whether build environment is sane... yes > checking for gawk... gawk > checking whether make sets $(MAKE)... yes > checking for style of include used by make... GNU > checking dependency style of gcc... none > checking fcntl.h usability... yes > checking fcntl.h presence... yes > checking for fcntl.h... yes > checking sys/fcntl.h usability... yes > checking sys/fcntl.h presence... yes > checking for sys/fcntl.h... yes > checking sys/file.h usability... yes > checking sys/file.h presence... yes > checking for sys/file.h... yes > checking sys/time.h usability... yes > checking sys/time.h presence... yes > checking for sys/time.h... yes > checking sys/signal.h usability... yes > checking sys/signal.h presence... yes > checking for sys/signal.h... yes > checking signal.h usability... yes > checking signal.h presence... yes > checking for signal.h.. . yes > checking termios.h usability... yes > checking termios.h presence... yes > checking for termios.h... yes > checking asm/termbits.h usability... yes > checking asm/termbits.h presence... yes > checking for asm/termbits.h... yes > checking grp.h usability... yes > checking grp.h presence... yes > checking for grp.h... yes > checking pwd.h usability... yes > checking pwd.h presence... yes > checking for pwd.h... yes > checking whether gcc needs -traditional... no > checking whether to enable maintainer-specific portions of Makefiles... no > /usr/java/jdk1.5.0_13 > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /usr/java/jdk1.5.0_13 > checking os.name Linux > checking os.arch i386 > checking java.vendor Sun Microsystems Inc. > checking java.version 1.5.0_13 > checking os.version 2.6.18-8.el5xen > comm.jar appears to be installed already. > conftest.c: In function 'main': > conftest.c:6: warning: incompatible implicit declaration of built-in > function 'printf' > conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:6: error: (Each undeclared identifier is reported only once > conftest.c:6: error: for each function it appears in.) > conftest.c:6: error: expected ')' before string constant This is an outdated kernel version check for when headers and kernels could cause problems for rxtx. If we made it past this, then you are OK. > conftest.c:7: warning: incompatible implicit declaration of built-in > function 'exit' > ./configure: line 9649: ./conftest: No such file or directory > ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected It blew up but continues.. > conftest.c: In function 'main': > conftest.c:5: warning: incompatible implicit declaration of built-in > function 'printf' > conftest.c:10: warning: incompatible implicit declaration of built-in > function 'exit' > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status : config.h is unchanged > config.status: executing depfiles commands > [root at smsgateway rxtx-2.0-7pre1]# make install > /usr/java/jdk1.5.0_13/bin/javac -classpath > .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d > /home/jboss/sources/rxtx- 2.0-7pre1/ -O > /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java > /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/UnSupportedLoggerException.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java > Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or > overrides a deprecated API. > Note: Recompile with -Xlint:deprecation for details. > /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* The java jar should be fine now. You may need to change the source files as mentioned below. > gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. > -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g > -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o > /home/jboss/sources/rxtx-2.0-7pre1/x86_64-unknown-linux-gnu/SerialImp.lo > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'init_threads': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: cast > from pointer to integer of different size > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_nativeDrain': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: cast to > pointer from integer of different size > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'read_byte_array': > /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: cast to > pointer from integer of different size As I recall, this was caused by pointers (now 64 bit rather than 32 bit) being stored in java ints (jints). I would look at the diff between the CVS 2.1 SerialImp.c and RXTXPort.java files against 2.0. We did fix those issues. You have a .so file but the different pointer sizes will cause runtime errors. > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_readArray': > /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: > comparison is always false due to limited range of data type > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_readTerminatedArray': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: > comparison is always false due to limited range of data type > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial- > 2.0.7pre1.* > gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so -o > .libs/librxtxSerial-2.0.7pre1.so > (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.0.7pre1.so > librxtxSerial.so) > creating librxtxSerial.la > (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la > librxtxSerial.la) > gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. > -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g > -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o > /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/ParallelImp.lo > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function > 'Java_javax_comm_LPRPort_readArray': > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: > comparison is always false due to limited range of data type > rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* > .libs/librxtxParallel-2.0.7pre1.* > gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so -o > .libs/librxtxParallel- 2.0.7pre1.so > (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.0.7pre1.so > librxtxParallel.so) > creating librxtxParallel.la > (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la > librxtxParallel.la) > make all-am > make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' > make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' > libtool: install: `x86_64-unknown-linux-gnu' must be an absolute directory > name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 A libtool change? Assuming you ran configure && make install in /home/jboss/sources/rxtx- 2.0-7pre1, libtool is looking for /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/.libs/librxtxSerial-2.0.7pre1.so. I think you have this? The file is just being copied to ~JAVA/jre/lib/$(JAVA_ARCH). -- Trent Jarvi tjarvi at qbang.org From sarah_662005 at yahoo.com Mon Nov 12 16:10:28 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Mon, 12 Nov 2007 15:10:28 -0800 (PST) Subject: [Rxtx] [urgent] device's power off detection Message-ID: <766782.10076.qm@web55803.mail.re3.yahoo.com> Hello all, I have a small application built on top of rxtx api. This application can retrieve the incoming data from a device through a port. The device can be powered off after the port get closed from the application. I have been trying a couple of hours to find a way to detect the power switching from device. If anyone knows how to handle it through rxtx, could you please give me a help? Thank you very much. r, Sara ____________________________________________________________________________________ Get easy, one-click access to your favorites. Make Yahoo! your homepage. http://www.yahoo.com/r/hs -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071112/4599f3ec/attachment-0020.html From netbeans at gatworks.com Mon Nov 12 17:52:22 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 12 Nov 2007 19:52:22 -0500 Subject: [Rxtx] [urgent] device's power off detection In-Reply-To: <766782.10076.qm@web55803.mail.re3.yahoo.com> References: <766782.10076.qm@web55803.mail.re3.yahoo.com> Message-ID: <4738F546.5010101@gatworks.com> Not sure what u are asking for. Are u asking for a way to detect if the device is OFF? Are u asking how to power off the device - via software ? Is it a Serial device? is it a parallel device? is it a usb device? Sara Hugh wrote: > Hello all, > I have a small application built on top of rxtx api. This application > can retrieve the incoming data from a device through a port. The device > can be powered off after the port get closed from the application. I > have been trying a couple of hours to find a way to detect the power > switching from device. If anyone knows how to handle it through rxtx, > could you please give me a help? Thank you very much. From tjarvi at qbang.org Mon Nov 12 22:48:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Nov 2007 22:48:11 -0700 (MST) Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711120225x562db8cbxb750767ade3b0d73@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> <900c6ba90711120031p66edc001ted76f7ba24e34b98@mail.gmail.com> <900c6ba90711120225x562db8cbxb750767ade3b0d73@mail.gmail.com> Message-ID: Hi Tim, The gnu.io namespace looks just like the javax.comm 2.0 namespace. There are additional (discouraged) undocumented methods in gnu.io that you need not use. We just used the different namespace to avoid poluting Sun's by mistake and to make sure we stayed off any potential licensing related radar. Usuaully, you just change your imports and make sure you do not use the javax.comm namespace for anything like exception handling. As I mentioned off the list, there are no issues with rxtx going through the JSR process to be more Sun friendly other than time. rxtx has no hidden intentions there; anything that does not work like CommAPI 2.0 documented is a bug. The reason we do not support CommAPI 2.1 is technical in nature and is in the list archives as well as the front page of www.rxtx.org. On Mon, 12 Nov 2007, Timothy Low wrote: > Hi Trent, > > I'll move to use a JDK1.5 64-bit version... but do I need to make any source > code changes to use the package (gnu.io) in the RTXTcomm.jar instead of the > ones from the javacomm api ? > > > Regards, > Tim > > On Nov 12, 2007 5:22 PM, Trent Jarvi wrote: > >> >> Hi Tim, >> >> I see a couple things here. >> >> First your jdk is for i686 yet the library is compiled on a x86_64 >> machine. You may try passing configure the --target=i686-unknown-linux to >> try using the i686 backend to gcc if it is available. Or move to the 64 >> bit jdk. >> >> The other error I see is again the moved UTF_RELEASE define that we need >> to fix. You can probably get around that with: >> >> make -DUTF_RELEASE=`uname -r` >> >> even more simple would be to just specify the serial library which should >> be in configure --help. >> >> You can remove the UTF_RELEASE check from configure by editing >> configure.in, searching for the simple C program check and deleting it. >> Running autoconf after that will regenerate a new configure without the >> check. >> >> Note that you should remove the previous native libraries >> (librxtxSerial.so) when moving from rxtx 2.0 to 2.1. These are compiled >> for different namespaces (javax.comm/gnu.io). >> >> On Mon, 12 Nov 2007, Timothy Low wrote: >> >>> *Hi Trent, >>> >>> I moved on to rxtx 2.1.7r2, and updated my jre to 1.6.0 (64-bit)... I >> tried >>> the following 2 methods: >>> >>> (1) using the rxtx 2.1.7 binaries from the RXTX website* >>> *Are these binaries suitable for a 64-bit OS ? There mentioning of the >>> gnu.io that you've talked about previously...* >>> ------ >>> [root at smsgateway sources]# java -Djava.library.path=/usr/lib PortLister >>> Experimental: JNI_OnLoad called. >>> >>> java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion >>> ()Ljava/lang/String; >>> at gnu.io.RXTXCommDriver.nativeGetVersion(Native Method) >>> at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:85) >>> at java.lang.Class.forName0(Native Method) >>> at java.lang.Class.forName(Unknown Source) >>> at javax.comm.CommPortIdentifier.loadDriver( >> CommPortIdentifier.java >>> :237) >>> at javax.comm.CommPortIdentifier.(CommPortIdentifier.java >>> :109) >>> at PortLister.(PortLister.java:6) >>> at PortLister.main(PortLister.java:25) >>> Exception in thread "main" java.lang.UnsatisfiedLinkError: >>> com.sun.comm.SunrayInfo.isSessionActive()Z >>> at com.sun.comm.SunrayInfo.isSessionActive(Native Method) >>> at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java >> :155) >>> at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java >>> :100) >>> at javax.comm.CommPortIdentifier.(CommPortIdentifier.java >>> :138) >>> at PortLister.(PortLister.java:6) >>> at PortLister.main(PortLister.java:25) >>> >>> ------ >>> >>> (2) compiling the rxtx 2.1.7 from source >>> *but i got the following error while running ./configure and make all* >>> >>> ------ >>> [root at smsgateway rxtx-2.1-7r2]# ./configure >>> checking build system type... x86_64-unknown-linux-gnu >>> checking host system type... x86_64-unknown-linux-gnu >>> checking target system type... x86_64-unknown-linux-gnu >>> configure: WARNING: Trying libtool. If the following fails install >> libtool >>> checking for gcc... gcc >>> checking for C compiler default output file name... a.out >>> checking whether the C compiler works... yes >>> checking whether we are cross compiling... no >>> checking for suffix of executables... >>> checking for suffix of object files... o >>> checking whether we are using the GNU C compiler... yes >>> checking whether gcc accepts -g... yes >>> checking for gcc option to accept ANSI C... none needed >>> checking for a sed that does not truncate output... /bin/sed >>> checking for egrep... grep -E >>> checking for ld used by gcc... /usr/bin/ld >>> checking if the linker (/usr/bin/ld) is GNU ld... yes >>> checking for /usr/bin/ld option to reload object files... -r >>> checking for BSD-compatible nm... /usr/bin/nm -B >>> checking whether ln -s works... yes >>> checking how to recognise dependent libraries... pass_all >>> checking how to run the C preprocessor... gcc -E >>> checking for ANSI C header files... yes >>> checking for sys/types.h... yes >>> checking for sys/stat.h... yes >>> checking for stdlib.h... yes >>> checking for string.h... yes >>> checking for memory.h... yes >>> checking for strings.h... yes >>> checking for inttypes.h... yes >>> checking for stdint.h... yes >>> checking for unistd.h... yes >>> checking dlfcn.h usability... yes >>> checking dlfcn.h presence... yes >>> checking for dlfcn.h... yes >>> checking for g++... g++ >>> checking whether we are using the GNU C++ compiler... yes >>> checking whether g++ accepts -g... yes >>> checking how to run the C++ preprocessor... g++ -E >>> checking for g77... no >>> checking for f77... no >>> checking for xlf... no >>> checking for frt... no >>> checking for pgf77... no >>> checking for fort77... no >>> checking for fl32... no >>> checking for af77... no >>> checking for f90... no >>> checking for xlf90... no >>> checking for pgf90... no >>> checking for epcf90... no >>> checking for f95... f95 >>> checking whether we are using the GNU Fortran 77 compiler... yes >>> checking whether f95 accepts -g... yes >>> checking the maximum length of command line arguments... 32768 >>> checking command to parse /usr/bin/nm -B output from gcc object... ok >>> checking for objdir... .libs >>> checking for ar... ar >>> checking for ranlib... ranlib >>> checking for strip... strip >>> checking if gcc static flag works... yes >>> checking if gcc supports -fno-rtti -fno-exceptions... no >>> checking for gcc option to produce PIC... -fPIC >>> checking if gcc PIC flag -fPIC works... yes >>> checking if gcc supports -c -o file.o... yes >>> checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking whether -lc should be explicitly linked in... no >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> checking if libtool supports shared libraries... yes >>> checking whether to build shared libraries... yes >>> checking whether to build static libraries... no >>> configure: creating libtool >>> appending configuration tag "CXX" to libtool >>> checking for ld used by g++... /usr/bin/ld -m elf_x86_64 >>> checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes >>> checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking for g++ option to produce PIC... -fPIC >>> checking if g++ PIC flag -fPIC works... yes >>> checking if g++ supports -c -o file.o... yes >>> checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> appending configuration tag "F77" to libtool >>> checking if libtool supports shared libraries... yes >>> checking whether to build shared libraries... yes >>> checking whether to build static libraries... no >>> checking for f95 option to produce PIC... -fPIC >>> checking if f95 PIC flag -fPIC works... yes >>> checking if f95 supports -c -o file.o... yes >>> checking whether the f95 linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> checking for a BSD-compatible install... /usr/bin/install -c >>> checking whether build environment is sane... yes >>> checking for gawk... gawk >>> checking whether make sets $(MAKE)... yes >>> checking for style of include used by make... GNU >>> checking dependency style of gcc... none >>> checking dependency style of g++... none >>> checking fcntl.h usability... yes >>> checking fcntl.h presence... yes >>> checking for fcntl.h... yes >>> checking sys/fcntl.h usability... yes >>> checking sys/fcntl.h presence... yes >>> checking for sys/fcntl.h... yes >>> checking sys/file.h usability... yes >>> checking sys/file.h presence... yes >>> checking for sys/file.h... yes >>> checking sys/time.h usability... yes >>> checking sys/time.h presence... yes >>> checking for sys/time.h... yes >>> checking sys/signal.h usability... yes >>> checking sys/signal.h presence... yes >>> checking for sys/signal.h... yes >>> checking signal.h usability... yes >>> checking signal.h presence... yes >>> checking for signal.h... yes >>> checking termios.h usability... yes >>> checking termios.h presence... yes >>> checking for termios.h... yes >>> checking grp.h usability... yes >>> checking grp.h presence... yes >>> checking for grp.h... yes >>> checking pwd.h usability... yes >>> checking pwd.h presence... yes >>> checking for pwd.h... yes >>> checking whether gcc needs -traditional... no >>> checking whether to enable maintainer-specific portions of Makefiles... >> no >>> /usr/java/jdk1.5.0_13 >>> configure: WARNING: using JAVA_HOME environmental variable >>> adjusted java.home is /usr/java/jdk1.5.0_13 >>> checking os.name Linux >>> checking os.arch i386 >>> checking java.vendor Sun Microsystems Inc. >>> checking java.version 1.5.0_13 >>> checking os.version 2.6.18-8.el5xen >>> conftest.c: In function 'main': >>> conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this >> function) >>> conftest.c:8: error: (Each undeclared identifier is reported only once >>> conftest.c:8: error: for each function it appears in.) >>> conftest.c:8: error: expected ')' before string constant >>> ./configure: line 21462: ./conftest: No such file or directory >>> ./configure: line 21462: test: 2.6.18-8.el5xen: unary operator expected >>> configure: creating ./config.status >>> config.status: creating Makefile >>> config.status: creating config.h >>> config.status: executing depfiles commands >>> [root at smsgateway rxtx-2.1-7r2]# make install >>> /usr/java/jdk1.5.0_13/bin/javac -classpath .:/home/jboss/sources/rxtx- >>> >> 2.1-7r2:/home/jboss/sources/rxtx-2.1-7r2/src:/usr/java/jdk1.5.0_13/jre/lib/ext/RXTXcomm.jar-d >>> /home/jboss/sources/rxtx- >>> 2.1-7r2/ -O -source 1.3 -target 1.3 >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommDriver.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortEnumerator.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortIdentifier.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortOwnershipListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Configure.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2C.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/I2CPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/LPRPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/NoSuchPortException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/PortInUseException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Raw.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/RawPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RawPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RawPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/RS485PortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485PortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485Port.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXCommDriver.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXVersion.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPort.java >>> /home/jboss/sources/rxtx-2.1-7r2 >> /./src/UnsupportedCommOperationException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/UnSupportedLoggerException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Zystem.java >>> /usr/java/jdk1.5.0_13/bin/javah -classpath .:/home/jboss/sources/rxtx- >>> >> 2.1-7r2:/home/jboss/sources/rxtx-2.1-7r2/src:/usr/java/jdk1.5.0_13/jre/lib/ext/RXTXcomm.jar-d >>> x86_64-unknown-linux-gnu -jni `(for i in CommDriver CommPortEnumerator >>> CommPortIdentifier CommPort CommPortOwnershipListener Configure I2C >>> I2CPortEvent I2CPortEventListener I2CPort LPRPort NoSuchPortException >>> ParallelPortEvent ParallelPortEventListener ParallelPort >> PortInUseException >>> Raw RawPortEvent RawPortEventListener RawPort RS485 RS485PortEvent >>> RS485PortEventListener RS485Port RXTXCommDriver RXTXPort RXTXVersion >>> SerialPortEvent SerialPortEventListener SerialPort >>> UnsupportedCommOperationException UnSupportedLoggerException Zystem;do \ >>> if grep > /dev/null native.*\( /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/$i.java; then \ >>> echo gnu.io.$i; \ >>> fi; \ >>> done)` >>> /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialImp.c -o >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo; >>> \ >>> if [ "Serial" = "Serial" ]; >>> then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxSerial.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxSerial.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo; >> \ >>> fi; \ >>> ) >>> mkdir /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/.libs >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/SerialImp.o >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/fuserImp.o >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c: In function >> 'show_user': >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c:238: warning: cast >> from >>> pointer to integer of different size >>> gcc -shared /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/SerialImp.o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/fuserImp.o >>> -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7.so -o >> .libs/librxtxSerial- >>> 2.1-7.so >>> (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.1-7.so >>> librxtxSerial.so) >>> creating librxtxSerial.la >>> (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la >>> librxtxSerial.la) >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelImp.c -o >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/ParallelImp.lo; >>> \ >>> if [ "Parallel" = "Serial" ]; >>> then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxParallel.la -rpath >>> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/ParallelImp.lo >>> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxParallel.la -rpath >>> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/ParallelImp.lo; >>> \ >>> fi; \ >>> ) >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >>> /x86_64-unknown-linux-gnu/.libs/ParallelImp.o >>> gcc -shared /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/ParallelImp.o >>> -lpthread -Wl,-soname -Wl,librxtxParallel-2.1-7.so -o >>> .libs/librxtxParallel-2.1-7.so >>> (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.1-7.so >>> librxtxParallel.so) >>> creating librxtxParallel.la >>> (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la >>> librxtxParallel.la) >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo; >>> \ >>> if [ "I2C" = "Serial" ]; then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxI2C.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo >>> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxI2C.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo; >>> \ >>> fi; \ >>> ) >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/.libs/I2CImp.o >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c: In function >>> 'Java_gnu_io_I2CPort_Initialize': >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: 'UTS_RELEASE' >>> undeclared (first use in this function) >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: (Each >> undeclared >>> identifier is reported only once >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: for each >> function >>> it appears in.) >>> libtool: link: `/home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/I2CImp.lo' >>> is not a valid libtool object >>> make: *** [x86_64-unknown-linux-gnu/librxtxI2C.la] Error 1 >>> >>> ------ >>> >>> >>> >>> On Nov 12, 2007 4:02 PM, Trent Jarvi wrote: >>> >>>> On Mon, 12 Nov 2007, Timothy Low wrote: >>>>> >>>>> Hi Trent, >>>> >>>> Hi Tim, >>>> >>>> Comments are inline. As I mentioned off the list, rxtx 2.0 is on the >> edge >>>> of deprecation. We can get it working but this is not the path of >> least >>>> resistance for future work. >>>> >>>> You will probably need to bounce another round of questions off the >> list. >>>> The following is intended to isolate the problem. >>>> >>>>> >>>>> I tried building RXTX from source, and I got this error. >>>>> >>>>> >>>>> I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm >>>> trying >>>>> to get the necessary ".so" files to use for my serial port >> communication >>>>> through java. >>>>> My linux kernal information is: >>>>> >>>>> *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 >>>> x86_64 >>>>> x86_64 x86_64 GNU/Linux* >>>>> >>>>> I'll most glad if you can provide me some direction on this. Thanks ! >>>>> >>>>> ---------------- >>>>> [root at smsgateway rxtx-2.0-7pre1]# ./configure >>>>> checking build system type... x86_64-unknown-linux-gnu >>>>> checking host system type... x86_64-unknown-linux-gnu >>>>> checking target system type... x86_64-unknown-linux-gnu >>>>> configure: WARNING: Trying libtool. If the following fails install >>>> libtool >>>>> checking for gcc... gcc >>>>> checking for C compiler default output... a.out >>>>> checking whether the C compiler works... yes >>>>> checking whether we are cross compiling... no >>>>> checking for suffix of executables... >>>>> checking for suffix of object files... o >>>>> checking whether we are using the GNU C compiler... yes >>>>> checking whether gcc accepts -g... yes >>>>> checking for gcc option to accept ANSI C... none needed >>>>> checking for ld used by GCC... /usr/bin/ld >>>>> checking if the linker (/usr/bin/ld) is GNU ld... yes >>>>> checking for /usr/bin/ld option to reload object files... -r >>>>> checking for BSD-compatible nm... /usr/bin/nm -B >>>>> checking for a sed that does not truncate output... /bin/sed >>>>> checking whether ln -s works... yes >>>>> checking how to recognise dependent libraries... pass_all >>>>> checking command to parse /usr/bin/nm -B output... ok >>>>> checking how to run the C preprocessor... gcc -E >>>>> checking for egrep... grep -E >>>>> checking for ANSI C header files... yes >>>>> checking for sys/types.h... yes >>>>> checking for sys/stat.h... yes >>>>> checking for stdlib.h... yes >>>>> checking for string.h... yes >>>>> checking for memory.h... yes >>>>> checking for strings.h... yes >>>>> checking for inttypes.h... yes >>>>> checking for stdint.h... yes >>>>> checking for unistd.h... yes >>>>> checking dlfcn.h usability... yes >>>>> checking dlfcn.h presence... yes >>>>> checking for dlfcn.h... yes >>>>> checking for ranlib... ranlib >>>>> checking for strip... strip >>>>> checking for objdir... .libs >>>>> checking for gcc option to produce PIC... -fPIC >>>>> checking if gcc PIC flag -fPIC works... yes >>>>> checking if gcc static flag -static works... yes >>>>> checking if gcc supports -c -o file.o... yes >>>>> checking if gcc supports -c -o file.lo... yes >>>>> checking if gcc supports -fno-rtti -fno-exceptions... yes >>>>> checking whether the linker (/usr/bin/ld) supports shared libraries... >>>> yes >>>>> checking how to hardcode library paths into programs... immediate >>>>> checking whether stripping libraries is possible... yes >>>>> checking dynamic linker characteristics... GNU/Linux ld.so >>>>> checking if libtool supports shared libraries... yes >>>>> checking whether to build shared libraries... yes >>>>> checking whether to build static libraries... no >>>>> checking whether -lc should be explicitly linked in... no >>>>> creating libtool >>>>> checking for a BSD-compatible install... /usr/bin/install -c >>>>> checking whether build environment is sane... yes >>>>> checking for gawk... gawk >>>>> checking whether make sets $(MAKE)... yes >>>>> checking for style of include used by make... GNU >>>>> checking dependency style of gcc... none >>>>> checking fcntl.h usability... yes >>>>> checking fcntl.h presence... yes >>>>> checking for fcntl.h... yes >>>>> checking sys/fcntl.h usability... yes >>>>> checking sys/fcntl.h presence... yes >>>>> checking for sys/fcntl.h... yes >>>>> checking sys/file.h usability... yes >>>>> checking sys/file.h presence... yes >>>>> checking for sys/file.h... yes >>>>> checking sys/time.h usability... yes >>>>> checking sys/time.h presence... yes >>>>> checking for sys/time.h... yes >>>>> checking sys/signal.h usability... yes >>>>> checking sys/signal.h presence... yes >>>>> checking for sys/signal.h... yes >>>>> checking signal.h usability... yes >>>>> checking signal.h presence... yes >>>>> checking for signal.h.. . yes >>>>> checking termios.h usability... yes >>>>> checking termios.h presence... yes >>>>> checking for termios.h... yes >>>>> checking asm/termbits.h usability... yes >>>>> checking asm/termbits.h presence... yes >>>>> checking for asm/termbits.h... yes >>>>> checking grp.h usability... yes >>>>> checking grp.h presence... yes >>>>> checking for grp.h... yes >>>>> checking pwd.h usability... yes >>>>> checking pwd.h presence... yes >>>>> checking for pwd.h... yes >>>>> checking whether gcc needs -traditional... no >>>>> checking whether to enable maintainer-specific portions of >> Makefiles... >>>> no >>>>> /usr/java/jdk1.5.0_13 >>>>> configure: WARNING: using JAVA_HOME environmental variable >>>>> adjusted java.home is /usr/java/jdk1.5.0_13 >>>>> checking os.name Linux >>>>> checking os.arch i386 >>>>> checking java.vendor Sun Microsystems Inc. >>>>> checking java.version 1.5.0_13 >>>>> checking os.version 2.6.18-8.el5xen >>>>> comm.jar appears to be installed already. >>>>> conftest.c: In function 'main': >>>>> conftest.c:6: warning: incompatible implicit declaration of built-in >>>>> function 'printf' >>>>> conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this >>>> function) >>>>> conftest.c:6: error: (Each undeclared identifier is reported only once >>>>> conftest.c:6: error: for each function it appears in.) >>>>> conftest.c:6: error: expected ')' before string constant >>>> >>>> >>>> This is an outdated kernel version check for when headers and kernels >>>> could cause problems for rxtx. If we made it past this, then you are >> OK. >>>> >>>> >>>>> conftest.c:7: warning: incompatible implicit declaration of built-in >>>>> function 'exit' >>>>> ./configure: line 9649: ./conftest: No such file or directory >>>>> ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected >>>> >>>> It blew up but continues.. >>>> >>>>> conftest.c: In function 'main': >>>>> conftest.c:5: warning: incompatible implicit declaration of built-in >>>>> function 'printf' >>>>> conftest.c:10: warning: incompatible implicit declaration of built-in >>>>> function 'exit' >>>>> configure: creating ./config.status >>>>> config.status: creating Makefile >>>>> config.status: creating config.h >>>>> config.status : config.h is unchanged >>>>> config.status: executing depfiles commands >>>>> [root at smsgateway rxtx-2.0-7pre1]# make install >>>>> /usr/java/jdk1.5.0_13/bin/javac -classpath >>>>> .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/ -O >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1 >> /./src/UnSupportedLoggerException.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java >>>>> Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or >>>>> overrides a deprecated API. >>>>> Note: Recompile with -Xlint:deprecation for details. >>>>> /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* >>>> >>>> >>>> The java jar should be fine now. You may need to change the source >> files >>>> as mentioned below. >>>> >>>>> gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu >> -I. >>>>> -I/usr/java/jdk1.5.0_13/include >> -I/usr/java/jdk1.5.0_13/include/./linux/ >>>> -g >>>>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o >>>>> /home/jboss/sources/rxtx-2.0-7pre1 >> /x86_64-unknown-linux-gnu/SerialImp.lo >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'init_threads': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: >>>> cast >>>>> from pointer to integer of different size >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_nativeDrain': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: >>>> cast to >>>>> pointer from integer of different size >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'read_byte_array': >>>>> /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: >>>> cast to >>>>> pointer from integer of different size >>>> >>>> >>>> As I recall, this was caused by pointers (now 64 bit rather than 32 >> bit) >>>> being stored in java ints (jints). I would look at the diff between >> the >>>> CVS 2.1 SerialImp.c and RXTXPort.java files against 2.0. We >>>> did fix those issues. >>>> >>>> You have a .so file but the different pointer sizes will cause runtime >>>> errors. >>>> >>>> >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_readArray': >>>>> /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: >>>>> comparison is always false due to limited range of data type >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_readTerminatedArray': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: >>>>> comparison is always false due to limited range of data type >>>>> mkdir .libs >>>>> rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* >> .libs/librxtxSerial- >>>>> 2.0.7pre1.* >>>>> gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so-o >>>>> .libs/librxtxSerial-2.0.7pre1.so >>>>> (cd .libs && rm -f librxtxSerial.so && ln -s >> librxtxSerial-2.0.7pre1.so >>>>> librxtxSerial.so) >>>>> creating librxtxSerial.la >>>>> (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la >>>>> librxtxSerial.la) >>>>> gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu >> -I. >>>>> -I/usr/java/jdk1.5.0_13/include >> -I/usr/java/jdk1.5.0_13/include/./linux/ >>>> -g >>>>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o >>>>> /home/jboss/sources/rxtx- 2.0-7pre1 >>>> /x86_64-unknown-linux-gnu/ParallelImp.lo >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function >>>>> 'Java_javax_comm_LPRPort_readArray': >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: >>>>> comparison is always false due to limited range of data type >>>>> rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* >>>>> .libs/librxtxParallel-2.0.7pre1.* >>>>> gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so-o >>>>> .libs/librxtxParallel- 2.0.7pre1.so >>>>> (cd .libs && rm -f librxtxParallel.so && ln -s >>>> librxtxParallel-2.0.7pre1.so >>>>> librxtxParallel.so) >>>>> creating librxtxParallel.la >>>>> (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la >>>>> librxtxParallel.la) >>>>> make all-am >>>>> make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' >>>>> make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' >>>>> libtool: install: `x86_64-unknown-linux-gnu' must be an absolute >>>> directory >>>>> name >>>>> Try `libtool --help --mode=install' for more information. >>>>> make: *** [install] Error 1 >>>> >>>> A libtool change? Assuming you ran configure && make install in >>>> /home/jboss/sources/rxtx- 2.0-7pre1, libtool is looking for >>>> /home/jboss/sources/rxtx- >>>> 2.0-7pre1/x86_64-unknown-linux-gnu/.libs/librxtxSerial-2.0.7pre1.so. >>>> >>>> I think you have this? The file is just being copied to >>>> ~JAVA/jre/lib/$(JAVA_ARCH). >>>> >>>> -- >>>> Trent Jarvi >>>> tjarvi at qbang.org >>>> >>> >> > From guido.vogt at celsi.ch Tue Nov 13 00:28:01 2007 From: guido.vogt at celsi.ch (Guido Vogt) Date: Tue, 13 Nov 2007 08:28:01 +0100 Subject: [Rxtx] RTS Line can't be set Message-ID: <47395201.1050400@celsi.ch> I'm working on an Windows XP /SP2 System. Version of RXTX: 2.1.7. The serial line is connected to a modem. As I can see, the RTS-Line of the serial Port is inactive, when the port is opened (flowcontrol=none). Obviously, no data is coming from the modem. If I use the setRTS(true) command after open, the comport does not send out my data any more. This behaviour is regardless of flowcontrol. Anybody has an idea what do do? Thanks for help. From Martin.Oberhuber at windriver.com Tue Nov 13 08:58:23 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 13 Nov 2007 16:58:23 +0100 Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803880918@ism-mail03.corp.ad.wrs.com> Hi Trent, as said before, I like the idea of discussing such quality engineering issues, but why hide these away from the rest of the public? Anyways, if you do want to create a new mailing list for these kinds of things I'll happily subscribe. 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: Sunday, November 11, 2007 1:46 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: RE: [Rxtx] Quality Engineering with rxtx > > On Mon, 5 Nov 2007, Oberhuber, Martin wrote: > > > Hi Trent, > > > > are the interestes of hobbyists really so different > > from commercial ones? Both should be interested in > > high quality and innovation the like. > > > > I haven't seen too many Open Source projects from the > > "inside" but those that I have seen did not have > > separate mailing lists for quality/testing/qa > > versus innovation/development. > > > > What I have seen with the Open Source projects that > > one would call "successful" is a good deal of > > process around automated builds, automated unit > > tests, predictable release dates and milestones, > > and policies around commiting/contributing/reviewing > > changes. > > > > I think that all of these benefit commercial users > > and hobbyists the like. > > > > If you were just asking about who's interested in > > discussing changes to foster more quality, count > > me in. I'm just not sure whether discussing these > > on a separate mailing list or other channel is the > > right thing to do. > > > > Hi Martin, > > There are two issues I'm thinking about. The first is the > generic unit > testing and quality initiatives required to move rxtx > forward. The second > is the inevitable fact that rxtx connects to external hardware. The > discussion deals with a different set of problems. > > Here is a simple example of what I'm getting at. > > We have the capability of setting custom baud rates in rxtx. > We may be > interested in seeing regressions in rxtx, the C library or > the kernel. > Some people may be doing some tests with loopback > connections. These will > always work even if the baud rate is not set to the expected > value. Some > people may use null modems between two ports. This may be > able to catch > the problem but not always. > > Will the build machines be able to test this? (no - for a few reasons) > Will people be trying to catch these type of regressions? (yes) > What type of coverage does the community have in the end? (?) > > We could include the discussions in the same list or another > equally open > list that may be of interest to some folks that deal with > these types of > problems on a regular basis. > > -- > Trent Jarvi > tjarvi at qbang.org > From toupsz at cs.tamu.edu Tue Nov 13 10:33:03 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 13 Nov 2007 11:33:03 -0600 Subject: [Rxtx] [urgent] device's power off detection In-Reply-To: <4738F546.5010101@gatworks.com> References: <766782.10076.qm@web55803.mail.re3.yahoo.com> <4738F546.5010101@gatworks.com> Message-ID: Lacking any other specification on it...but can you set up the device to notify your software when it turns off? Send a message or somesuch? Maybe it can signal using RTS or DTR? -Zach On Nov 12, 2007 6:52 PM, U. George wrote: > Not sure what u are asking for. Are u asking for a way to detect if the > device is OFF? Are u asking how to power off the device - via software ? > Is it a Serial device? > is it a parallel device? > is it a usb device? > > Sara Hugh wrote: > > Hello all, > > I have a small application built on top of rxtx api. This application > > can retrieve the incoming data from a device through a port. The device > > can be powered off after the port get closed from the application. I > > have been trying a couple of hours to find a way to detect the power > > switching from device. If anyone knows how to handle it through rxtx, > > could you please give me a help? Thank you very much. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071113/e5859e4d/attachment-0019.html From tjarvi at qbang.org Tue Nov 13 20:02:03 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 13 Nov 2007 20:02:03 -0700 (MST) Subject: [Rxtx] #ifndef TIOCSERGETLSR In-Reply-To: <472E3AAF.7050709@gatworks.com> References: <472E3AAF.7050709@gatworks.com> Message-ID: On Sun, 4 Nov 2007, U. George wrote: > For Linux, it seems that you need the code for both *having* a > TIOCSERGETLSR, and *not having* a TIOCSERGETLSR. Maybe the ioctl exists > system wide, but not necessarily for the device driver itself ( always > returns -1 ) . > > Are there systems that have a *functioning* TIOCSERGETLSR for all their > devices? Then this would be the case where the "#ifndef TIOCSERGETLSR" > directive could be useful is eliminating the unnecessary code and tests. > > And for those systems that dont have a TIOCSERGETLSR, then the code for > TIOCSERGETLSR can be eliminated. > > It would be a simple case to have, as a foundation, all the code to > simulate the missing TIOCSERGETLSR ioctl. If the system does have the > ioctl, then that code can be ifdef'd in, and co-exist with the > functionality of the code that simulates the missing TIOCSERGETLSR ioctl. > Ah, there is the post. Sorry I was on vacation. Hi George, Yes there are systems that have functioning TIOCSERGETLSR for all of their devices. These are machines that just use traditional UARTs. If you mean operating systems, then probably not. Let me explain a bit about the history of those #ifdefs to help clear up a mess. RXTX aims to follow POSIX. TIOCSERGETLSR turns out to not be POSIX at all as I understand. It isn't in BSD, Solaris, AIX or HP-UX. It certainly provides access to important information. I assumed it was standard when I coded rxtx on a Linux system. Ya, laugh. Then I looked at Win32.. Oh you are still laughing? ..I could not navigate msft's web site at the time [still can't really find anything today]. So google pointed me to someones 'reverse documentation' of the w32 API and an example msft put together back in the win3.0 days. It was enough but maybe not 100% correct. They covered overlapped IO which was important for events in rxtx. Looking at Win32 and Linux, it made sense to implement TIOCSERGETLSR for win32 with the way rxtx works. That was how things matched up. But when I got feedback about other systems, it didn't match up. When people used multiport cards with money saving designs in Linux, it didn't match up. And today, there are drivers for unusual serial ports that don't match up. Now we have some ugly logic that mostly works for most serial ports. It isn't right though. The important aspect of TIOSERGETLSR is knowing when the output is really gone. But POSIX tcdrain tells us the same thing. So there is logic in the ifdefs to match that up as you suggest. Perhaps a more formal solution along those lines would be worth looking into. I would suggest the roles should be switched though. We should use POSIX calls on all systems and hide things that don't work on everything like we have with other undocumented calls. TIOSERGETLSR is nice and would be great if it was standard. It isn't as far as I can tell. In the end, many people write Java code because they want portability. The TIOSERGETLSR does not really fit. In someways, this is limiting to the least common denominator which is Solaris if you have seen it's serial kernel driver code. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 15 09:10:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 15 Nov 2007 17:10:59 +0100 Subject: [Rxtx] RXTX blocking on unconnected virtual port Message-ID: <460801A4097E3D4CA04CC64EE648584803919080@ism-mail03.corp.ad.wrs.com> Hello, we came across the following issue: * Set up a virtual serial port, e.g. with com0com: http://com0com.sourceforge.net/ * Connect RXTX to one end, e.g. cnc1a * Do not connect the other end, e.g. cnc1b * Have RXTX write data to the port --> Since the data is not being read, RXTX blocks - RXTXPort.SerialOutputStream.write increases the RXTXPort.IOLocked variable - it then calls the native writeByte or writeArray method (which blocks) closing the RXTXPort hangs for ever too: - RXTXPort.close() has a while( IOLocked > 0 ) {..Thread.sleep(500);...} which spins for ever ==> once the communication hangs, it cannot recover. Has anybody else seen such a problem before, or even got an idea how to solve it? When I connect Hyperterminal to the same half-open port, and type a character, it hangs for about 3 seconds but then times out and is available again. I guess that's what I'd like to see in RXTX as well, with a (configurable) timeout. Our big problem with the current situation is that once RXTX gets stuck, there is nothing at all we can do to make it go live again - that's why our original workaround of writing to the port in a background thread is not good enough. For more background information, the issue is being tracked in https://bugs.eclipse.org/bugs/show_bug.cgi?id=208185 Thanks for any hints or ideas, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Sun Nov 18 09:43:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 09:43:26 -0700 (MST) Subject: [Rxtx] PortInUseException - Cannot close and reopen serial port In-Reply-To: <460801A4097E3D4CA04CC64EE64858480351C711@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858480351C711@ism-mail03.corp.ad.wrs.com> Message-ID: These have been submitted to CVS and the bugzilla entries have been changed to reflect the changes. ChangeLog: find ports which were added after program startup on Mac OS X. Martin Oberhuber http://bugzilla.qbang.org/show_bug.cgi?id=48 Clean up CommPort Ownership code, avoid possible deadlocks, fix lost commport ownership events. http://bugzilla.qbang.org/show_bug.cgi?id=83 Martin Oberhuber On Wed, 24 Oct 2007, Oberhuber, Martin wrote: > 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) > > > > > > > > > > > > > > > From tjarvi at qbang.org Sun Nov 18 09:45:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 09:45:39 -0700 (MST) Subject: [Rxtx] PortInUseException - Cannot close and reopen serial port In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848020CAF26@ism-mail03.corp.ad.wrs.com> Message-ID: The current CVS code should have all the entries. With version information, I usually do not change the version until we tag and release a zip file. Any feedback would be appreciated. On Wed, 27 Jun 2007, Greg Johnson wrote: > 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) >> >> >> >> >> > From tjarvi at qbang.org Sun Nov 18 13:51:27 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 13:51:27 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs Message-ID: The following bugs have been closed and CVS updated as needed: CommPortIdentifier.getPortIdentifier throws NoSuchPortException http://bugzilla.qbang.org/show_bug.cgi?id=48 CommPortOwnership events not sent http://bugzilla.qbang.org/show_bug.cgi?id=83 JVM 1.6 builds http://bugzilla.qbang.org/show_bug.cgi?id=84 I'd like to give Martin Oberhuber CVS write access. He has been doing a great job of pushing safe patches into rxtx. I'll be preparing seperate patches for the changes I have and submitting them to the list. I'll need to work with George to do a couple things: 1) break the patch into smaller pieces to isolate issues for discussion. 2) work through the Line Status Register changes so it does not cause problems on other systems. George: If you could do the first one, it would be greatly appreciated. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Nov 18 15:33:36 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 15:33:36 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: Message-ID: I'm not running any tests at this point, I'm trying to apply the small safe patches and make sure everything is compiling. As mentioned at the bottom, there are 3 patches + the USB fix posted here that need more review before accepting. The following bugs have been closed and CVS updated as needed. Most of these are already in CVS. The diff will be small. configure script failed at line UTS_RELEASE megov http://bugzilla.qbang.org/show_bug.cgi?id=80 code cleanup patch (extra ';' creates bug for if statements + new String() calls removed) Xavier Le Vourch http://bugzilla.qbang.org/show_bug.cgi?id=77 Wont compile on linux ppc with glibc 2.5 - no sys/io.h Brian Johnson http://bugzilla.qbang.org/show_bug.cgi?id=72 rxtx overwrites System properties Andrew Gillett Nektarios K. Papadopoulos Neboj??a http://bugzilla.qbang.org/show_bug.cgi?id=64 Solaris ACM port support Dave Cleal http://bugzilla.qbang.org/show_bug.cgi?id=59 Setting of non-standard baud rate fails. Andrew Prunicki http://bugzilla.qbang.org/show_bug.cgi?id=58 RXTX uses lockfiles on MacOS X (instead of ioctl TIOCEXCL) Joachim Buechse http://bugzilla.qbang.org/show_bug.cgi?id=50 JavaDoc fixes Joachim Buechse http://bugzilla.qbang.org/show_bug.cgi?id=49 I need to further review the following: http://bugzilla.qbang.org/show_bug.cgi?id=53 http://bugzilla.qbang.org/show_bug.cgi?id=46 http://bugzilla.qbang.org/show_bug.cgi?id=41 On Sun, 18 Nov 2007, Trent Jarvi wrote: > > The following bugs have been closed and CVS updated as needed: > > CommPortIdentifier.getPortIdentifier throws NoSuchPortException > http://bugzilla.qbang.org/show_bug.cgi?id=48 > CommPortOwnership events not sent > http://bugzilla.qbang.org/show_bug.cgi?id=83 > JVM 1.6 builds > http://bugzilla.qbang.org/show_bug.cgi?id=84 > > I'd like to give Martin Oberhuber CVS write access. He has been doing a > great job of pushing safe patches into rxtx. > > I'll be preparing seperate patches for the changes I have and submitting > them to the list. > > I'll need to work with George to do a couple things: > > 1) break the patch into smaller pieces to isolate issues for discussion. > 2) work through the Line Status Register changes so it does not cause > problems on other systems. > > George: If you could do the first one, it would be greatly appreciated. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From netbeans at gatworks.com Sun Nov 18 16:20:02 2007 From: netbeans at gatworks.com (U. George) Date: Sun, 18 Nov 2007 18:20:02 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: Message-ID: <4740C8A2.6030908@gatworks.com> > I'll need to work with George to do a couple things: > > 1) break the patch into smaller pieces to isolate issues for discussion. > 2) work through the Line Status Register changes so it does not cause > problems on other systems. > > George: If you could do the first one, it would be greatly appreciated. there are ( probably ) 3 pieces: 1) the select() failure when the USB-serial device is unceremoniously unplugged ( causes rxtx to spin ) 2) TIOCSERGETLSR, need to have the simulation of it available for all os's . If the system has the capability, don't simulate for devices that have the capability. For devices that dont have the capability, but the OS still defines TIOCSERGETLSR, fall back to simulation. 3) I rearranged DEBUG ifdef's. This is probably the bulk of the patches. From tjarvi at qbang.org Sun Nov 18 18:26:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 18:26:26 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <4740C8A2.6030908@gatworks.com> References: <4740C8A2.6030908@gatworks.com> Message-ID: On Sun, 18 Nov 2007, U. George wrote: > >> I'll need to work with George to do a couple things: >> >> 1) break the patch into smaller pieces to isolate issues for discussion. >> 2) work through the Line Status Register changes so it does not cause >> problems on other systems. >> >> George: If you could do the first one, it would be greatly appreciated. > > there are ( probably ) 3 pieces: > 1) the select() failure when the USB-serial device is unceremoniously > unplugged ( causes rxtx to spin ) > 2) TIOCSERGETLSR, need to have the simulation of it available for all os's . > If the system has the capability, don't simulate for devices that have the > capability. For devices that dont have the capability, but the OS still > defines TIOCSERGETLSR, fall back to simulation. > 3) I rearranged DEBUG ifdef's. This is probably the bulk of the patches. > Hi George, I suspect if you do cvs update, there will be very few conflicts if any. While the list of fixes is fairly long, the changes are small. -- Trent Jarvi tjarvi at qbang.org From EdwardRF at xtremax.com Mon Nov 19 03:32:29 2007 From: EdwardRF at xtremax.com (Edward) Date: Mon, 19 Nov 2007 18:32:29 +0800 Subject: [Rxtx] Cannot Read under Windows XP Message-ID: <4741663D.4070200@xtremax.com> Hi Guys, I have a iTegno 3000 usb GSM modem, it is an usb-serial device. I am trying to use RXTX with it under Windows XP. The problem is it seems RXTX cannot read any data from it, but writing to it seems successful. I blindly issue a series of command to send off a SMS, it is successfully delivered, but neither the echo from the modem nor the "OK" response was received. I tried to connect to the modem directly using hyper terminal, there was no problem reading or writing. So can i assume it is not the driver problem? Then i turned to Serial Port Monitor for help, when I use hyper terminal, monitor shows both way traffic, and nothing abnormal, but when I connect using RXTX, only the data I sent to the modem is being detected, no input was detected. Does anyone else experience similar problem? Best Regards Edward From tjarvi at qbang.org Mon Nov 19 03:38:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Nov 2007 03:38:02 -0700 (MST) Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: <4741663D.4070200@xtremax.com> References: <4741663D.4070200@xtremax.com> Message-ID: On Mon, 19 Nov 2007, Edward wrote: > Hi Guys, > > I have a iTegno 3000 usb GSM modem, it is an usb-serial device. I am > trying to use RXTX with it under Windows XP. > The problem is it seems RXTX cannot read any data from it, but writing > to it seems successful. I blindly issue a series of command to send off > a SMS, it is successfully delivered, but neither the echo from the modem > nor the "OK" response was received. > > I tried to connect to the modem directly using hyper terminal, there was > no problem reading or writing. So can i assume it is not the driver problem? > > Then i turned to Serial Port Monitor for help, when I use hyper > terminal, monitor shows both way traffic, and nothing abnormal, but when > I connect using RXTX, only the data I sent to the modem is being > detected, no input was detected. > > Does anyone else experience similar problem? > Hi Edward, A common mistake is to send Strings to the modem which are i18n. You want to send the bytes. Examples of doing this are in the contrib directory with the sourcecode. ie SimpleSnuV1.java -- Trent Jarvi tjarvi at qbang.org From EdwardRF at xtremax.com Mon Nov 19 04:42:16 2007 From: EdwardRF at xtremax.com (Edward) Date: Mon, 19 Nov 2007 19:42:16 +0800 Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: References: <4741663D.4070200@xtremax.com> Message-ID: <47417698.3060705@xtremax.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071119/b0f08ba9/attachment-0014.html From netbeans at gatworks.com Mon Nov 19 06:31:30 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 19 Nov 2007 08:31:30 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: <4740C8A2.6030908@gatworks.com> Message-ID: <47419032.8080406@gatworks.com> Did the "make install". The install does not want to go to or use Makefiles's prefix = /usr/local/rxtx-devel Not terribly happy that it installed in /home/gat/JAVA/JDK14/j2sdk1.4.2_08/jre/lib/i386 Trent Jarvi wrote: > > I suspect if you do cvs update, there will be very few conflicts if any. > While the list of fixes is fairly long, the changes are small. > > -- > Trent Jarvi > tjarvi at qbang.org > > From Martin.Oberhuber at windriver.com Mon Nov 19 07:00:48 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 19 Nov 2007 15:00:48 +0100 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE6485848039986E6@ism-mail03.corp.ad.wrs.com> It's great to see things progressing - thanks Trent! I checked CVS, and it seems that most of the patch authors are yet missing from the AUTHORS file, is this intentional? The issues areound RXTXPort.close() are interesting for us in the context of Eclipse as well: https://bugs.eclipse.org/bugs/show_bug.cgi?id=208185#c3 I did a quick review and found some issues / comments: http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 http://bugzilla.qbang.org/show_bug.cgi?id=53#c9 Thanks for proposing CVS write access for me. I promise to use these thoughtfully, and discuss potential fixes openly (on bugzilla) before applying them [unless it's really trivial issues only like obvious Javadoc syntax or spelling errors]. Cheers, -- 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 Mon Nov 19 07:24:16 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 19 Nov 2007 15:24:16 +0100 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803998711@ism-mail03.corp.ad.wrs.com> Hi all, I think I've got a better version for RXTXCommDriver.checkSolaris(): http://bugzilla.qbang.org/show_bug.cgi?id=77#c3 Cheers, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From netbeans at gatworks.com Mon Nov 19 09:01:22 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 19 Nov 2007 11:01:22 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <47419032.8080406@gatworks.com> References: <4740C8A2.6030908@gatworks.com> <47419032.8080406@gatworks.com> Message-ID: <4741B352.8070205@gatworks.com> U. George wrote: > Did the "make install". The install does not want to go to or use > Makefiles's prefix = /usr/local/rxtx-devel > > Not terribly happy that it installed in > /home/gat/JAVA/JDK14/j2sdk1.4.2_08/jre/lib/i386 > Put libs and jar in MY preferential places. Ran application. And it loves to spin. Deja gnu all over again. :-/ It did find the avail /dev/ttyUSB0 port connected to LINUX usbserial/pl2303 device driver. Now to find the spin. and apply simpler set of patches From tjarvi at qbang.org Mon Nov 19 10:14:38 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Nov 2007 10:14:38 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <4741B352.8070205@gatworks.com> References: <4740C8A2.6030908@gatworks.com> <47419032.8080406@gatworks.com> <4741B352.8070205@gatworks.com> Message-ID: On Mon, 19 Nov 2007, U. George wrote: > U. George wrote: >> Did the "make install". The install does not want to go to or use >> Makefiles's prefix = /usr/local/rxtx-devel >> >> Not terribly happy that it installed in >> /home/gat/JAVA/JDK14/j2sdk1.4.2_08/jre/lib/i386 >> > Put libs and jar in MY preferential places. Ran application. And it loves to > spin. Deja gnu all over again. :-/ > > It did find the avail /dev/ttyUSB0 port connected to LINUX usbserial/pl2303 > device driver. > > Now to find the spin. and apply simpler set of patches > Hi George, When the prefix code was stomped on and the library was installed in the jre, It wasnt clear how the layout would end up looking. I'm still not sure. My usual attack was to dump a jdk onto the filesystem, set JAVA_HOME and install. When I was done, I would nuke the jdk. Obviously that may not be what people want but I'm not sure a prefix is enough to let us know what they do want. For a shared library prefix /usr/local means the library goes in /usr/local/lib. What would it mean for the jar and shared library in Java? -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Nov 19 10:24:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Nov 2007 10:24:08 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <460801A4097E3D4CA04CC64EE6485848039986E6@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848039986E6@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 19 Nov 2007, Oberhuber, Martin wrote: > > I checked CVS, and it seems that most of the patch > authors are yet missing from the AUTHORS file, > is this intentional? > There isn't a hard rule covering who goes into AUTHORS. If I recognize a person from previous patches, I try to make sure they are in. Everyone contributing (authors) is in the ChangeLog with what they did going all the way back to the first release. AUTHORS is more of a summary of what they did after a few submissions. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Nov 19 11:39:51 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 19 Nov 2007 13:39:51 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: <4740C8A2.6030908@gatworks.com> <47419032.8080406@gatworks.com> <4741B352.8070205@gatworks.com> Message-ID: <4741D877.80203@gatworks.com> For me, the makefile/prefix = /usr/local sorta suggest thats where the libs/bins/jars/... should eventually wind up. If a user does not like /usr/local, then a quick change would put it somewhere else. At this moment I dont care where the jar winds up ( in lib, or a jar directory ). So I like to keep the jre/sdk directory protected from meddling, and changes. But if a user has a penchant to use 'java -jar', then the RXTXcomm.jar file should be stuffed with the other jre/sdk jar files. From ajmas at sympatico.ca Mon Nov 19 11:54:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 19 Nov 2007 13:54:29 -0500 Subject: [Rxtx] CVS updates and closed bugs Message-ID: <20071119185429.SPYK18413.tomts22-srv.bellnexxia.net@smtp1.sympatico.ca> On this day in November "U. George" wrote: > > For me, the makefile/prefix = /usr/local sorta suggest thats where the > libs/bins/jars/... should eventually wind up. > If a user does not like /usr/local, then a quick change would put it > somewhere else. At this moment I dont care where the jar winds up ( in > lib, or a jar directory ). > So I like to keep the jre/sdk directory protected from meddling, and > changes. > But if a user has a penchant to use 'java -jar', then the RXTXcomm.jar > file should be stuffed with the other jre/sdk jar files. It should be noted that some platforms, such as MacOS X might have different conventions. In the case of MacOS X there are two 'correct' places for Java libraries that aren't part of an application: - /Library/Java/Extensions/ - ~/Library/Java/Extensions/ Andre From ajmas at sympatico.ca Mon Nov 19 18:15:37 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 19 Nov 2007 20:15:37 -0500 Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: <47417698.3060705@xtremax.com> References: <4741663D.4070200@xtremax.com> <47417698.3060705@xtremax.com> Message-ID: <3D24B671-06CA-4709-AE3C-BCDB542F427F@sympatico.ca> On 19-Nov-07, at 06:42 , Edward wrote: > Hi Trent, > > First of all, I did sent them as bytes, eg, > > output.write("at\r\n".getBytes()); > > And if writing is every the problem, it wouldn't be able to explain > why i could send out a sms successfully using RXTX. > If you have the section of code that does the communicating, could you share it with us? This should help us tell whether it is a coding issue or something more fundamental with RXTX. Andre From EdwardRF at xtremax.com Mon Nov 19 19:39:36 2007 From: EdwardRF at xtremax.com (EdwardRF) Date: Tue, 20 Nov 2007 10:39:36 +0800 Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: <3D24B671-06CA-4709-AE3C-BCDB542F427F@sympatico.ca> References: <4741663D.4070200@xtremax.com> <47417698.3060705@xtremax.com> <3D24B671-06CA-4709-AE3C-BCDB542F427F@sympatico.ca> Message-ID: <474248E8.7070002@xtremax.com> Hi Guys, Thanks for the help, i've finally found out the problem. It was a flow control issue, i did not set the flow control properly. Btw, what is the default flow control behavior for rxtx2.1.7? was it the same as 2.0? Because i remember i did not need to set the flow control when I use rxtx 2.0 2 years back. Best Regards Edward Andre-John Mas wrote: > > On 19-Nov-07, at 06:42 , Edward wrote: > >> Hi Trent, >> >> First of all, I did sent them as bytes, eg, >> >> output.write("at\r\n".getBytes()); >> >> And if writing is every the problem, it wouldn't be able to explain >> why i could send out a sms successfully using RXTX. >> > > If you have the section of code that does the communicating, could you > share it with us? This should help us tell whether it is a coding > issue or something more fundamental with RXTX. > > Andre > From netbeans at gatworks.com Tue Nov 20 06:23:26 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 20 Nov 2007 08:23:26 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: <4740C8A2.6030908@gatworks.com> Message-ID: <4742DFCE.5070504@gatworks.com> Here is the small subset of diffs just for TIOCSERGETLSR :) Next I'll pull out the usb device, and see if that also causes rxtx to spin. >> 2) TIOCSERGETLSR, need to have the simulation of it available for all >> os's . If the system has the capability, don't simulate for devices >> that have the capability. For devices that dont have the capability, >> but the OS still defines TIOCSERGETLSR, fall back to simulation. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: a Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20071120/2c5c8ee7/attachment-0011.pl From tjarvi at qbang.org Tue Nov 20 08:20:21 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Nov 2007 08:20:21 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <4742DFCE.5070504@gatworks.com> References: <4740C8A2.6030908@gatworks.com> <4742DFCE.5070504@gatworks.com> Message-ID: On Tue, 20 Nov 2007, U. George wrote: > Here is the small subset of diffs just for TIOCSERGETLSR :) > > Next I'll pull out the usb device, and see if that also causes rxtx to spin. > >>> 2) TIOCSERGETLSR, need to have the simulation of it available for all os's >>> . If the system has the capability, don't simulate for devices that have >>> the capability. For devices that dont have the capability, but the OS >>> still defines TIOCSERGETLSR, fall back to simulation. > Hi George, I'll be looking through this patch in detail tonight. I just wanted to make sure you are aware of this line in win32termios.h. The ifdef logic is messy as you noticed. That is combined with the later addition of support for it to windows. #define TIOCSERGETLSR 0x5459 (this is by far the strangest code in rxtx in retrospect) I'll be able to do extensive automated testing once we get to that point. I'm confident we can get something in that has a low probability of causing regressions. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Tue Nov 20 08:42:08 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 20 Nov 2007 10:42:08 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: <4740C8A2.6030908@gatworks.com> <4742DFCE.5070504@gatworks.com> Message-ID: <47430050.1010203@gatworks.com> It is of no difference. 1) If the define does not exist, then it should be as before. 2) If it does exist, then it should also be as before. 3) If it does exist, but the ioctl fails, then it will fallback as if it did not exist in the first place. Trent Jarvi wrote: > On Tue, 20 Nov 2007, U. George wrote: > >> Here is the small subset of diffs just for TIOCSERGETLSR :) >> >> Next I'll pull out the usb device, and see if that also causes rxtx to >> spin. >> >>>> 2) TIOCSERGETLSR, need to have the simulation of it available for >>>> all os's . If the system has the capability, don't simulate for >>>> devices that have the capability. For devices that dont have the >>>> capability, but the OS still defines TIOCSERGETLSR, fall back to >>>> simulation. >> > > Hi George, > > I'll be looking through this patch in detail tonight. I just wanted to > make sure you are aware of this line in win32termios.h. The ifdef logic > is messy as you noticed. That is combined with the later addition of > support for it to windows. > > #define TIOCSERGETLSR 0x5459 > > (this is by far the strangest code in rxtx in retrospect) > > I'll be able to do extensive automated testing once we get to that > point. I'm confident we can get something in that has a low probability > of causing regressions. > > -- > Trent Jarvi > tjarvi at qbang.org > > From netbeans at gatworks.com Tue Nov 20 08:36:56 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 20 Nov 2007 10:36:56 -0500 Subject: [Rxtx] Unplugged Opened USB devices In-Reply-To: <4742DFCE.5070504@gatworks.com> References: <4740C8A2.6030908@gatworks.com> <4742DFCE.5070504@gatworks.com> Message-ID: <4742FF18.3050005@gatworks.com> > Next I'll pull out the usb device, and see if that also causes rxtx to > spin. This is the error on a read. The select() should have failed, as well as the read(). java.io.IOException: Input/output error in nativeavailable at gnu.io.RXTXPort.nativeavailable(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1420) at jGPS.GpsData.DeviceDrivers.SerialPort.SerialPort_NMEA_GNU.serialEvent (SerialPort_NMEA_GNU.java:449) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:771) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1622) But for java program, it sees( when USB device is unplugged ) : 1) event: SerialPortEvent.DATA_AVAILABLE 2) read (non-existant) data. I think that its bad form to say DATA_AVAILABLE, when there is no data to be obtained. There does not seem to be an I/O error event. So basically, I think, and IMHO, that no events should be sent. Rather a thread timeout ( ie no data in X seconds ) AND recovery from user code should be instantiated. From manujnaman at yahoo.com Wed Nov 21 12:35:46 2007 From: manujnaman at yahoo.com (manuj naman) Date: Wed, 21 Nov 2007 11:35:46 -0800 (PST) Subject: [Rxtx] Problem reading 1-wire device using RXTX on Linux Message-ID: <371969.66249.qm@web37911.mail.mud.yahoo.com> Hello, I am trying to use the RXTX library on Ubuntu (Debian) linux to read iButtons. It works perfectly on Windows. However on my linux machines it gives the following errors. I am using DS9490 (USB port adapter) to read the iButtons. I have followed your instructions on the Wiki. I recompiled the rxtx library to produce the .so and .jar files. But still it gives me this: manujnaman at sensor:~/iButton/onewireviewer$ java -cp $CLASSPATH:./OneWireAPI.jar:./OneWireViewer.jar OneWireViewer Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Warning: serial communications API not setup properly, no ports in enumeration Pure-Java DS9097U adapter will not work, not added to adapter enum Standard drivers for 1-Wire are not found. Please download the latest drivers from http://www.ibutton.com Or install RXTX Serial Communications API from http://www.rxtx.org Do you know how to solve the "Serial communications API not setup properly, no ports in enumeration" problem? Also, how to detect which what /dev/* is the port to be used? On Windows this is simply USB1, on linux this is a bit unclear. Many thanks for your advice, Manuj Naman Dallas, TX, US manujnaman at yahoo.com --------------------------------- Be a better pen pal. Text or chat with friends inside Yahoo! Mail. See how. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071121/2760f691/attachment-0010.html From Martin.Oberhuber at windriver.com Wed Nov 21 13:55:25 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 21 Nov 2007 21:55:25 +0100 Subject: [Rxtx] Should RXTX Lixense link to LGPL-2.1 be changed? In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803A21160@ism-mail03.corp.ad.wrs.com> Hi Trent and all, In all the RXTX source files as well as http://users.frii.com/jarvi/rxtx/license.html there is the following lines: | A copy of the LGPL v 2.1 may be found at | http://www.gnu.org/licenses/lgpl.txt on March 4th 2007. A copy is | here for your convenience. But, as of today, at the link provided there is only a copy of the LGPL v3.0. I think there should be a link to the LGPL v2.1, e.g. http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html What do you think? Cheers, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Nov 21 20:46:18 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Nov 2007 20:46:18 -0700 (MST) Subject: [Rxtx] Problem reading 1-wire device using RXTX on Linux In-Reply-To: <371969.66249.qm@web37911.mail.mud.yahoo.com> References: <371969.66249.qm@web37911.mail.mud.yahoo.com> Message-ID: On Wed, 21 Nov 2007, manuj naman wrote: > Hello, > > I am trying to use the RXTX library on Ubuntu (Debian) linux to read iButtons. It works perfectly on Windows. However on my linux machines it gives the following errors. I am using DS9490 (USB port adapter) to read the iButtons. > > I have followed your instructions on the Wiki. I recompiled the rxtx library to produce the .so and .jar files. But still it gives me this: > > manujnaman at sensor:~/iButton/onewireviewer$ java -cp $CLASSPATH:./OneWireAPI.jar:./OneWireViewer.jar OneWireViewer > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > Warning: serial communications API not setup properly, no ports in enumeration > Pure-Java DS9097U adapter will not work, not added to adapter enum > > Standard drivers for 1-Wire are not found. > Please download the latest drivers from http://www.ibutton.com > Or install RXTX Serial Communications API from http://www.rxtx.org > > Do you know how to solve the "Serial communications API not setup properly, no ports in enumeration" problem? > > Also, how to detect which what /dev/* is the port to be used? On Windows this is simply USB1, on linux this is a bit unclear. Hi Manuj What is the output of the following? dmesg |grep tty touch /var/lock/test.lock && rm -f /var/lock/test.lock If you see something like /dev/ttyUSB0 in the dmesg output, what happens if you do something like tail -f /dev/ttyUSB0? These test each of the usual suspects. We are looking for missing USB drivers, no permission to create a lockfile and no read permission for the device. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Nov 21 21:05:23 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Nov 2007 21:05:23 -0700 (MST) Subject: [Rxtx] Should RXTX Lixense link to LGPL-2.1 be changed? In-Reply-To: <460801A4097E3D4CA04CC64EE648584803A21160@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803A21160@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 21 Nov 2007, Oberhuber, Martin wrote: > Hi Trent and all, > > In all the RXTX source files as well as > http://users.frii.com/jarvi/rxtx/license.html > there is the following lines: > > | A copy of the LGPL v 2.1 may be found at > | http://www.gnu.org/licenses/lgpl.txt on March 4th 2007. A copy is > | here for your convenience. > > But, as of today, at the link provided there is only > a copy of the LGPL v3.0. I think there should be a link > to the LGPL v2.1, e.g. > http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html > > What do you think? > Hi Martin, Thanks. I updated the link. Changing licences is a heavy process for me as a free software developer and an employee so I'd rather stay with 2.1 unless the current license becomes a show stopper. I figured that would happen someday so I put the date in to be clear. -- Trent Jarvi tjarvi at qbang.org From beat.arnet at gmail.com Thu Nov 22 08:45:45 2007 From: beat.arnet at gmail.com (Beat Arnet) Date: Thu, 22 Nov 2007 10:45:45 -0500 Subject: [Rxtx] Dual Core Problem Message-ID: <4745A429.9060604@gmail.com> Dear All, I am struggling with an application that uses RXTX 2.1.7 and has been working reliably in the past. When this program runs on a dual-core DELL (Intel T2500), strange things happen with the RS232 communication. The application is missing incoming characters and also often freezes when trying to close the serial port. I highly suspect a threading problem and was wondering if a) anybody had run into a similar problem with dual core processors and b) if there is a list of does and dont's when it comes to RXTX and threads. Regards, Beat From tjarvi at qbang.org Thu Nov 22 13:22:43 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 22 Nov 2007 13:22:43 -0700 (MST) Subject: [Rxtx] Dual Core Problem In-Reply-To: <4745A429.9060604@gmail.com> References: <4745A429.9060604@gmail.com> Message-ID: On Thu, 22 Nov 2007, Beat Arnet wrote: > Dear All, > I am struggling with an application that uses RXTX 2.1.7 and has been > working reliably in the past. When this program runs on a dual-core DELL > (Intel T2500), strange things happen with the RS232 communication. The > application is missing incoming characters and also often freezes when > trying to close the serial port. I highly suspect a threading problem > and was wondering if a) anybody had run into a similar problem with dual > core processors and b) if there is a list of does and dont's when it > comes to RXTX and threads. > I've used rxtx with SMP systems but have not experimented very much with threading and rxtx. One red flag rxtx raises is it stores pointers to java objects in SerialImp.c. If the JVM decides to move things around, rxtx becomes confused. Missing incomming characters is usually caused by someone running two applications. They then fight over the incomming data. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Fri Nov 23 03:12:28 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 23 Nov 2007 11:12:28 +0100 Subject: [Rxtx] Dual Core Problem In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803A84C59@ism-mail03.corp.ad.wrs.com> > Missing incomming characters is usually caused by someone running two > applications. They then fight over the incomming data. I've seen exactly this scenario on Linux with Lockfiles disabled. Usually, port locking (through Lockfiles or Ioctl method) should avoid exactly this problem. I know that on Mac, port locking through Kernel/Ioctl method has been added for the upcoming RXTX 2.1-8. What's the status of this feature for Linux and other Unixes? Cheers, Martin From chris.paton at red61.com Fri Nov 23 05:26:10 2007 From: chris.paton at red61.com (Chris Paton) Date: Fri, 23 Nov 2007 12:26:10 +0000 Subject: [Rxtx] RXTX parallel port issues Message-ID: <4746C6E2.3000304@red61.com> Hi there, I've been happily using RXTX to communicate with a serial based point-of-sale printer for a several months. I've recently received a parallel based printer and have been trying to get RXTX to talk to this too. I've encountered a few problems along the way and just wanted to check if I'm doing anything wrong, or if I've found any bugs. Writing ------- Writing to the parallel port using ParallelPort.getOutputStream works well, except when I use OutputStream.write(byte[]) to write a multiple of 8 bytes (!). Doing this causes the JVM to crash with an EXCEPTION_PRIV_INSTRUCTION on Windows. I worked around this in my application by adding an additional byte if bytesToWrite % 8 == 0. I guess I could also have called write(byte) repeatedly. This also generated a SIGSEGV on Linux but I was unable to reproduce it today using the CVS version of RXTX and a recent kernel. Reading status pins ------------------- On Linux, I've found that ParallelPort.isPaperOut and ParallelPort.isPrinterSelected appear to be inverted; i.e. when the paper is out ParallelPort.isPaperOut returns false, and when there is paper ParallelPort.isPaperOut returns true! I've tested this in both Sun JDK5 and JDK6 on machines running Linux 2.6.21 and 2.6.23. Fortunately it's easy to use a conditional based on System.getProperty("os.name") to hack around this. Reading from InputStream ------------------------ I've had more serious issues trying to read from ParallelPort.getInputStream. On Windows, readByte seems to return -1 (end of stream) any time data isn't available. On Linux, I got a kernel oops, even with a recent 2.6.23.1 kernel. I was able to stop this using a kernel patch that I found via Google. Although this stopped the oops, I still get frequent IOExceptions when calling InputStream.readByte. It appears that instead of blocking, readByte throws an IOException with message "Resource temporarily unavailable in readByte" any time it is called when no data is available. Occasionally, I get an exception instead of the data I was expecting to read, e.g when asking my printer for a version string I get "VER: S3306 * 06.03* 10/*6/06" where the *s indicate that an exception occurred and data was missed. Any advice that anyone can offer would be much appreciated. If you need any more details or debugging information about any of these problems then let me know. Cheers -- Chris Paton Technical Developer Red61 -- Transaction Marketing Software http://www.red61.com -------------- next part -------------- A non-text attachment was scrubbed... Name: chris.paton.vcf Type: text/x-vcard Size: 230 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20071123/00a747b6/attachment-0018.vcf From chris.paton at red61.com Fri Nov 23 05:26:10 2007 From: chris.paton at red61.com (Chris Paton) Date: Fri, 23 Nov 2007 12:26:10 +0000 Subject: [Rxtx] RXTX parallel port issues Message-ID: <4746C6E2.3000304@red61.com> Hi there, I've been happily using RXTX to communicate with a serial based point-of-sale printer for a several months. I've recently received a parallel based printer and have been trying to get RXTX to talk to this too. I've encountered a few problems along the way and just wanted to check if I'm doing anything wrong, or if I've found any bugs. Writing ------- Writing to the parallel port using ParallelPort.getOutputStream works well, except when I use OutputStream.write(byte[]) to write a multiple of 8 bytes (!). Doing this causes the JVM to crash with an EXCEPTION_PRIV_INSTRUCTION on Windows. I worked around this in my application by adding an additional byte if bytesToWrite % 8 == 0. I guess I could also have called write(byte) repeatedly. This also generated a SIGSEGV on Linux but I was unable to reproduce it today using the CVS version of RXTX and a recent kernel. Reading status pins ------------------- On Linux, I've found that ParallelPort.isPaperOut and ParallelPort.isPrinterSelected appear to be inverted; i.e. when the paper is out ParallelPort.isPaperOut returns false, and when there is paper ParallelPort.isPaperOut returns true! I've tested this in both Sun JDK5 and JDK6 on machines running Linux 2.6.21 and 2.6.23. Fortunately it's easy to use a conditional based on System.getProperty("os.name") to hack around this. Reading from InputStream ------------------------ I've had more serious issues trying to read from ParallelPort.getInputStream. On Windows, readByte seems to return -1 (end of stream) any time data isn't available. On Linux, I got a kernel oops, even with a recent 2.6.23.1 kernel. I was able to stop this using a kernel patch that I found via Google. Although this stopped the oops, I still get frequent IOExceptions when calling InputStream.readByte. It appears that instead of blocking, readByte throws an IOException with message "Resource temporarily unavailable in readByte" any time it is called when no data is available. Occasionally, I get an exception instead of the data I was expecting to read, e.g when asking my printer for a version string I get "VER: S3306 * 06.03* 10/*6/06" where the *s indicate that an exception occurred and data was missed. Any advice that anyone can offer would be much appreciated. If you need any more details or debugging information about any of these problems then let me know. Cheers -- Chris Paton Technical Developer Red61 -- Transaction Marketing Software http://www.red61.com -------------- next part -------------- A non-text attachment was scrubbed... Name: chris.paton.vcf Type: text/x-vcard Size: 230 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20071123/00a747b6/attachment-0019.vcf From hho at bibliotheca.dk Fri Nov 23 06:45:36 2007 From: hho at bibliotheca.dk (Hans Hvelplund Odborg) Date: Fri, 23 Nov 2007 14:45:36 +0100 Subject: [Rxtx] RXTX parallel port issues In-Reply-To: <4746C6E2.3000304@red61.com> References: <4746C6E2.3000304@red61.com> Message-ID: <001201c82dd7$21c6e2c0$6a37a8c0@HANSLAPTOP> I've experienced similar crashes in JVM when writing to the parallel port in windows (with rxtx). Unfortunately I did not save the data sent to the parallel port so cannot say anything about the length. Furthermore, I recall having problems with .write(byte) (would never exit if I recall correctly), but I do not recall if this was with serial or parallel or both. In the end, we ended printing through Java's support of the windows driver. Unfortunately I currently don?t have the time to investigate these issues further. I just wanted to let you know that currently there are bugs in rxtx. Med venlig hilsen / Best regards / Med v?nliga h?lsningar Hans Hvelplund Odborg BIBLIOTHECA A/S Vallensb?kvej 20B ? 2605 Br?ndby ? Denmark Tel.: +45 70271008 Fax: +45 70271009 hho at bibliotheca.dk www.bibliotheca.dk -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Chris Paton Sent: 23. november 2007 13:26 To: rxtx at qbang.org Subject: [Rxtx] RXTX parallel port issues Hi there, I've been happily using RXTX to communicate with a serial based point-of-sale printer for a several months. I've recently received a parallel based printer and have been trying to get RXTX to talk to this too. I've encountered a few problems along the way and just wanted to check if I'm doing anything wrong, or if I've found any bugs. Writing ------- Writing to the parallel port using ParallelPort.getOutputStream works well, except when I use OutputStream.write(byte[]) to write a multiple of 8 bytes (!). Doing this causes the JVM to crash with an EXCEPTION_PRIV_INSTRUCTION on Windows. I worked around this in my application by adding an additional byte if bytesToWrite % 8 == 0. I guess I could also have called write(byte) repeatedly. This also generated a SIGSEGV on Linux but I was unable to reproduce it today using the CVS version of RXTX and a recent kernel. Reading status pins ------------------- On Linux, I've found that ParallelPort.isPaperOut and ParallelPort.isPrinterSelected appear to be inverted; i.e. when the paper is out ParallelPort.isPaperOut returns false, and when there is paper ParallelPort.isPaperOut returns true! I've tested this in both Sun JDK5 and JDK6 on machines running Linux 2.6.21 and 2.6.23. Fortunately it's easy to use a conditional based on System.getProperty("os.name") to hack around this. Reading from InputStream ------------------------ I've had more serious issues trying to read from ParallelPort.getInputStream. On Windows, readByte seems to return -1 (end of stream) any time data isn't available. On Linux, I got a kernel oops, even with a recent 2.6.23.1 kernel. I was able to stop this using a kernel patch that I found via Google. Although this stopped the oops, I still get frequent IOExceptions when calling InputStream.readByte. It appears that instead of blocking, readByte throws an IOException with message "Resource temporarily unavailable in readByte" any time it is called when no data is available. Occasionally, I get an exception instead of the data I was expecting to read, e.g when asking my printer for a version string I get "VER: S3306 * 06.03* 10/*6/06" where the *s indicate that an exception occurred and data was missed. Any advice that anyone can offer would be much appreciated. If you need any more details or debugging information about any of these problems then let me know. Cheers -- Chris Paton Technical Developer Red61 -- Transaction Marketing Software http://www.red61.com From tjarvi at qbang.org Fri Nov 23 16:28:23 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 23 Nov 2007 16:28:23 -0700 (MST) Subject: [Rxtx] RXTX parallel port issues In-Reply-To: <001201c82dd7$21c6e2c0$6a37a8c0@HANSLAPTOP> References: <4746C6E2.3000304@red61.com> <001201c82dd7$21c6e2c0$6a37a8c0@HANSLAPTOP> Message-ID: It would be good to create a bug report for this so others can either look into it or find the report to confirm their suspicions. Currently, there is only one parallel port bug report. http://bugzilla.qbang.org/show_bug.cgi?id=40 As we do update the reports when bugs are fixed, it gives people a chance to put themselves on the CC list and get notification of fixes they are interested in. On Fri, 23 Nov 2007, Hans Hvelplund Odborg wrote: > > I've experienced similar crashes in JVM when writing to the parallel port in > windows (with rxtx). > > Unfortunately I did not save the data sent to the parallel port so cannot > say anything about the length. > > Furthermore, I recall having problems with .write(byte) (would never exit if > I recall correctly), but I do not recall if this was with serial or parallel > or both. > > In the end, we ended printing through Java's support of the windows driver. > > Unfortunately I currently don?t have the time to investigate these issues > further. I just wanted to let you know that currently there are bugs in > rxtx. > > > Med venlig hilsen / Best regards / Med v?nliga h?lsningar > Hans Hvelplund Odborg > > BIBLIOTHECA A/S > Vallensb?kvej 20B ? 2605 Br?ndby ? Denmark > Tel.: +45 70271008 > Fax: +45 70271009 > hho at bibliotheca.dk > www.bibliotheca.dk > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Chris Paton > Sent: 23. november 2007 13:26 > To: rxtx at qbang.org > Subject: [Rxtx] RXTX parallel port issues > > Hi there, > > I've been happily using RXTX to communicate with a serial based > point-of-sale printer for a several months. I've recently received a > parallel based printer and have been trying to get RXTX to talk to this > too. I've encountered a few problems along the way and just wanted to > check if I'm doing anything wrong, or if I've found any bugs. > > Writing > ------- > Writing to the parallel port using ParallelPort.getOutputStream works > well, except when I use OutputStream.write(byte[]) to write a multiple > of 8 bytes (!). Doing this causes the JVM to crash with an > EXCEPTION_PRIV_INSTRUCTION on Windows. I worked around this in my > application by adding an additional byte if bytesToWrite % 8 == 0. I > guess I could also have called write(byte) repeatedly. > > This also generated a SIGSEGV on Linux but I was unable to reproduce it > today using the CVS version of RXTX and a recent kernel. > > Reading status pins > ------------------- > On Linux, I've found that ParallelPort.isPaperOut and > ParallelPort.isPrinterSelected appear to be inverted; i.e. when the > paper is out ParallelPort.isPaperOut returns false, and when there is > paper ParallelPort.isPaperOut returns true! I've tested this in both Sun > JDK5 and JDK6 on machines running Linux 2.6.21 and 2.6.23. Fortunately > it's easy to use a conditional based on System.getProperty("os.name") to > hack around this. > > Reading from InputStream > ------------------------ > > I've had more serious issues trying to read from > ParallelPort.getInputStream. On Windows, readByte seems to return -1 > (end of stream) any time data isn't available. > > On Linux, I got a kernel oops, even with a recent 2.6.23.1 > kernel. I was able to stop this using a kernel patch > > that I found via Google. Although this stopped the oops, I still get > frequent IOExceptions when calling InputStream.readByte. It appears that > instead of blocking, readByte throws an IOException with message > "Resource temporarily unavailable in readByte" any time it is called > when no data is available. Occasionally, I get an exception instead of > the data I was expecting to read, e.g when asking my printer for a > version string I get "VER: S3306 * 06.03* 10/*6/06" where the *s > indicate that an exception occurred and data was missed. > > > Any advice that anyone can offer would be much appreciated. If you need > any more details or debugging information about any of these problems > then let me know. > > Cheers > From manujnaman at yahoo.com Sun Nov 25 14:59:21 2007 From: manujnaman at yahoo.com (manuj naman) Date: Sun, 25 Nov 2007 13:59:21 -0800 (PST) Subject: [Rxtx] Problem reading 1-wire device using RXTX on Linux In-Reply-To: Message-ID: <104159.48942.qm@web37909.mail.mud.yahoo.com> Trent, dmesg | grep tty gives nothing. however, greping for usb does. The output for that is below. touch /var/lock/test.lock file does not exist, the directory does exits though. tail -f /dev/ttyUSB0 gives nothing simply because ttyUSB0 does not exist. Seems as if USB ports are not there... however, numerous /dev/tty* exist starting from /dev/tty, /dev/tty0, /dev/tty1... to ... /dev/ttyzf. The result of dmesg | grep usb is as follows: [17179576.220000] usbcore: registered new driver usbfs [17179576.220000] usbcore: registered new driver hub [17179576.572000] usb 1-1: new low speed USB device using uhci_hcd and address 2 [17179576.992000] usb 2-1: new full speed USB device using uhci_hcd and address 2 [17179577.132000] usbcore: registered new driver hiddev [17179577.188000] input: USB HID v1.11 Mouse [Microsoft Microsoft Wireless Optical Mouse� 1.00] on usb-0000:00:1f.2-1 [17179577.188000] usbcore: registered new driver usbhid [17179577.188000] drivers/usb/input/hid-core.c: v2.6:USB HID core driver [17179577.192000] usb-storage: device found at 2 [17179577.192000] usb-storage: waiting for device to settle before scanning [17179577.192000] usbcore: registered new driver usb-storage [17179582.192000] usb-storage: device scan complete [17209993.728000] usb 1-2: new full speed USB device using uhci_hcd and address 3 [17209994.816000] usbcore: registered new driver DS9490R [17248016.760000] usb 1-1: USB disconnect, address 2 [17302939.908000] usb 1-2: USB disconnect, address 3 [17302944.856000] usb 1-2: new full speed USB device using uhci_hcd and address 4 [17794170.232000] usb 1-2: USB disconnect, address 4 Does it help in diagnosis? The name of the 1-wire viewer device is DS9490 Best regards, Manuj Trent Jarvi wrote: On Wed, 21 Nov 2007, manuj naman wrote: > Hello, > > I am trying to use the RXTX library on Ubuntu (Debian) linux to read iButtons. It works perfectly on Windows. However on my linux machines it gives the following errors. I am using DS9490 (USB port adapter) to read the iButtons. > > I have followed your instructions on the Wiki. I recompiled the rxtx library to produce the .so and .jar files. But still it gives me this: > > manujnaman at sensor:~/iButton/onewireviewer$ java -cp $CLASSPATH:./OneWireAPI.jar:./OneWireViewer.jar OneWireViewer > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > Warning: serial communications API not setup properly, no ports in enumeration > Pure-Java DS9097U adapter will not work, not added to adapter enum > > Standard drivers for 1-Wire are not found. > Please download the latest drivers from http://www.ibutton.com > Or install RXTX Serial Communications API from http://www.rxtx.org > > Do you know how to solve the "Serial communications API not setup properly, no ports in enumeration" problem? > > Also, how to detect which what /dev/* is the port to be used? On Windows this is simply USB1, on linux this is a bit unclear. Hi Manuj What is the output of the following? dmesg |grep tty touch /var/lock/test.lock && rm -f /var/lock/test.lock If you see something like /dev/ttyUSB0 in the dmesg output, what happens if you do something like tail -f /dev/ttyUSB0? These test each of the usual suspects. We are looking for missing USB drivers, no permission to create a lockfile and no read permission for the device. -- Trent Jarvi tjarvi at qbang.org --------------------------------- Be a better sports nut! Let your teams follow you with Yahoo Mobile. Try it now. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071125/ef4f80c4/attachment-0006.html From tjarvi at qbang.org Sun Nov 25 16:43:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 25 Nov 2007 16:43:04 -0700 (MST) Subject: [Rxtx] Problem reading 1-wire device using RXTX on Linux In-Reply-To: <104159.48942.qm@web37909.mail.mud.yahoo.com> References: <104159.48942.qm@web37909.mail.mud.yahoo.com> Message-ID: Hi Manuj, This does help diagnose the problem. Sadly the answer is in the system configuration of your debian system. I can only point you towards some areas that are suspect. /dev/tty01->/dev/ttyzz are terminals which are not of interest. It appears that the usb serial kernel module is not loading. That is usually in a directory like the following: /lib/modules/2.6.*/kernel/drivers/usb/serial modprobe is used to manually load the drivers. Your /dev/* may be created based upon the kernel modules loaded or MAKEDEV may be used to create the devices. /etc/modules.conf may be what is misconfigured though I'm not sure. One of the modules in usb/serial is probably responsible for representing your USB dongle as a tty. UDEV is probably responsible for creating ttyUSB01 once the kernel module is loaded. Perhaps someone has been through this before but basically this is a system configuration problem or a missing kernel driver. Once /dev/USB?? are present, rxtx should find the port. On Sun, 25 Nov 2007, manuj naman wrote: > Trent, > > dmesg | grep tty > gives nothing. however, greping for usb does. The output for that is below. > > touch /var/lock/test.lock file does not exist, the directory does exits though. > > tail -f /dev/ttyUSB0 gives nothing simply because ttyUSB0 does not exist. > > Seems as if USB ports are not there... however, numerous /dev/tty* exist starting from /dev/tty, /dev/tty0, /dev/tty1... to ... /dev/ttyzf. > > The result of dmesg | grep usb is as follows: > > [17179576.220000] usbcore: registered new driver usbfs > [17179576.220000] usbcore: registered new driver hub > [17179576.572000] usb 1-1: new low speed USB device using uhci_hcd and address 2 > [17179576.992000] usb 2-1: new full speed USB device using uhci_hcd and address 2 > [17179577.132000] usbcore: registered new driver hiddev > [17179577.188000] input: USB HID v1.11 Mouse [Microsoft Microsoft Wireless Optical Mouse� 1.00] on usb-0000:00:1f.2-1 > [17179577.188000] usbcore: registered new driver usbhid > [17179577.188000] drivers/usb/input/hid-core.c: v2.6:USB HID core driver > [17179577.192000] usb-storage: device found at 2 > [17179577.192000] usb-storage: waiting for device to settle before scanning > [17179577.192000] usbcore: registered new driver usb-storage > [17179582.192000] usb-storage: device scan complete > [17209993.728000] usb 1-2: new full speed USB device using uhci_hcd and address 3 > [17209994.816000] usbcore: registered new driver DS9490R > [17248016.760000] usb 1-1: USB disconnect, address 2 > [17302939.908000] usb 1-2: USB disconnect, address 3 > [17302944.856000] usb 1-2: new full speed USB device using uhci_hcd and address 4 > [17794170.232000] usb 1-2: USB disconnect, address 4 > > Does it help in diagnosis? The name of the 1-wire viewer device is DS9490 > > Best regards, > Manuj > > > Trent Jarvi wrote: On Wed, 21 Nov 2007, manuj naman wrote: > >> Hello, >> >> I am trying to use the RXTX library on Ubuntu (Debian) linux to read iButtons. It works perfectly on Windows. However on my linux machines it gives the following errors. I am using DS9490 (USB port adapter) to read the iButtons. >> >> I have followed your instructions on the Wiki. I recompiled the rxtx library to produce the .so and .jar files. But still it gives me this: >> >> manujnaman at sensor:~/iButton/onewireviewer$ java -cp $CLASSPATH:./OneWireAPI.jar:./OneWireViewer.jar OneWireViewer >> Experimental: JNI_OnLoad called. >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> Warning: serial communications API not setup properly, no ports in enumeration >> Pure-Java DS9097U adapter will not work, not added to adapter enum >> >> Standard drivers for 1-Wire are not found. >> Please download the latest drivers from http://www.ibutton.com >> Or install RXTX Serial Communications API from http://www.rxtx.org >> >> Do you know how to solve the "Serial communications API not setup properly, no ports in enumeration" problem? >> >> Also, how to detect which what /dev/* is the port to be used? On Windows this is simply USB1, on linux this is a bit unclear. > > > Hi Manuj > > What is the output of the following? > > dmesg |grep tty > > touch /var/lock/test.lock && rm -f /var/lock/test.lock > > If you see something like /dev/ttyUSB0 in the dmesg output, what happens > if you do something like > > tail -f /dev/ttyUSB0? > > These test each of the usual suspects. We are looking for missing USB > drivers, no permission to create a lockfile and no read permission for the > device. > > -- > Trent Jarvi > tjarvi at qbang.org > > > > --------------------------------- > Be a better sports nut! Let your teams follow you with Yahoo Mobile. Try it now. From netbeans at gatworks.com Mon Nov 26 06:53:02 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 26 Nov 2007 08:53:02 -0500 Subject: [Rxtx] #undef TIOCSERGETLSR on LINUX Message-ID: <474ACFBE.5050406@gatworks.com> So I undef'ed the define TIOCSERGETLSR on a linux box, I find that RXTX no longer works . this is a :{ It appears that the sigprocmask( SIG_SETMASK, &newmask, &oldmask ) at src/SerialImp.c:1427 seems to unblock more events than it should. On a linux box there are 2 other events that are blocked, and this code un-sets them, and the thread hangs. It also appears that this code is incomplete. Also, if you only add in the block for SIGCHLD ( which I think is what someone wanted ) , the code will (soon) core-dump ( or silently exit ). So has anyone run with this code ? From tjarvi at qbang.org Mon Nov 26 19:32:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 26 Nov 2007 19:32:54 -0700 (MST) Subject: [Rxtx] #undef TIOCSERGETLSR on LINUX In-Reply-To: <474ACFBE.5050406@gatworks.com> References: <474ACFBE.5050406@gatworks.com> Message-ID: On Mon, 26 Nov 2007, U. George wrote: > So I undef'ed the define TIOCSERGETLSR on a linux box, I find that RXTX > no longer works . this is a :{ > > It appears that the sigprocmask( SIG_SETMASK, &newmask, &oldmask ) at > src/SerialImp.c:1427 seems to unblock more events than it should. On a > linux box there are 2 other events that are blocked, and this code > un-sets them, and the thread hangs. > > It also appears that this code is incomplete. > Also, if you only add in the block for SIGCHLD ( which I think is what > someone wanted ) , the code will (soon) core-dump ( or silently exit ). > > So has anyone run with this code ? Hi George, The case when TIOCSERGETLSR is not defined is currently used on Solaris. Linux has used the TIOCSERGETLSR. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Nov 26 19:56:24 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 26 Nov 2007 21:56:24 -0500 Subject: [Rxtx] #undef TIOCSERGETLSR on LINUX In-Reply-To: References: <474ACFBE.5050406@gatworks.com> Message-ID: <474B8758.6010006@gatworks.com> Technically, with, or without TIOCSERGETLSR it *SHOULD* work the same. Still does not explain the SIGSEGV on the current development code Trent Jarvi wrote: > On Mon, 26 Nov 2007, U. George wrote: > >> So I undef'ed the define TIOCSERGETLSR on a linux box, I find that RXTX >> no longer works . this is a :{ From Joshua.Gerdes at xerox.com Tue Nov 27 16:00:07 2007 From: Joshua.Gerdes at xerox.com (Gerdes, Joshua) Date: Tue, 27 Nov 2007 15:00:07 -0800 Subject: [Rxtx] Trying to use RXTX Message-ID: Hello, I've been using Java for a little while, but am no master. This is my story: I'm trying to write a simple program that will use RXTX to open a serial port on com4, read from it and write to it. I must be doing something wrong because this doesn't seem to be working - I sort of hodge-podged this together from an example that was on the rxtx website. Basically I call the connect method I wrote, that seems to work (no exceptions atleast), I call writeSerial method, and though I don't know for sure if this works it doesn't throw any exceptions, but then I try calling readSerial and never get anything. Can anyone tell me why this isn't working? I must just be doing something flat out wrong. I know that my serial device responds fine when communicated to - I've checked it on a serial terminal. Also, what is considered the end of the input stream? I nabbed this from an example and wonder when the while loop in readSerial will end. /******************************************** * name: readSerial * description: reads from serial port until \0? * arguments: none * returns: read bytes from serial port *******************************************/ private byte [] readSerial() throws IOException{ byte [] buffer = new byte [128]; //read until end of stream. whats considered the end? int len = -1; while ( ( len = serialIn.read(buffer)) > -1 ); return(buffer); } /******************************************** * name: writeSerial * description: writes to serial port until * arguments: String to write * returns: none *******************************************/ private void writeSerial(String data) throws IOException{ byte [] buffer = data.getBytes(); serialOut.write(buffer); } /******************************************** * name: connect * description: opens serial port. * arguments: Com port name * returns: none *******************************************/ void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(9600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE); serialIn = serialPort.getInputStream(); serialOut = serialPort.getOutputStream(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } /******************************************** * name: closeSerial * description: close serial port. * arguments: none * returns: none *******************************************/ private void closeSerial() throws IOException{ serialIn.close(); serialOut.close(); } //some globals private InputStream serialIn; private OutputStream serialOut; -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071127/b9b8cae8/attachment-0004.html From tjarvi at qbang.org Tue Nov 27 21:45:07 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Nov 2007 21:45:07 -0700 (MST) Subject: [Rxtx] Trying to use RXTX In-Reply-To: References: Message-ID: On Tue, 27 Nov 2007, Gerdes, Joshua wrote: > Hello, > > I've been using Java for a little while, but am no master. This is my > story: > > I'm trying to write a simple program that will use RXTX to open a serial > port on com4, read from it and write to it. I must be doing something > wrong because this doesn't seem to be working - I sort of hodge-podged > this together from an example that was on the rxtx website. Basically I > call the connect method I wrote, that seems to work (no exceptions > atleast), I call writeSerial method, and though I don't know for sure if > this works it doesn't throw any exceptions, but then I try calling > readSerial and never get anything. Can anyone tell me why this isn't > working? I must just be doing something flat out wrong. I know that my > serial device responds fine when communicated to - I've checked it on a > serial terminal. Also, what is considered the end of the input stream? I > nabbed this from an example and wonder when the while loop in readSerial > will end. > It is hard to tell for sure without seeing main(). Here are a few hints. Sometimes when you try to communicate with a device, the white space is important. Perhaps the device knows that you are done transmitting a message when it reads a new line. Maybe it is a null character. Maybe you typed the same string into the terminal and then hit not thinking that was a character too. Serial communication can now go 3 Mb/sec with the right hardware but most of use don't have that :). Don't read right after you right. You can look at the bytes available with tha API. You can wait for bytes available events. Give the electrons a running head start if in doubt; they have been doing this since the 1960's and need a break now and then. The exact behavior of read depends upon the timeout and threshold. A 0 timeout and 0 threshold should block. There is no end of to a stream. Some terminals consider control-d the EOF and close. That is always the interesting part of serial communication. Often you end up creating some sort of packet based communication to know when you are done reading. Other times, you eat a byte at a time and make some decision. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 27 22:40:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Nov 2007 22:40:41 -0700 (MST) Subject: [Rxtx] #undef TIOCSERGETLSR on LINUX In-Reply-To: <474B8758.6010006@gatworks.com> References: <474ACFBE.5050406@gatworks.com> <474B8758.6010006@gatworks.com> Message-ID: Hi George, The last time I saw a segv it was related to 64 bit processors and how we stored pointers. Could you describe your system a bit and the serial device being used? I might just make sure I have access to one before the next release. I agree that doing an undef on TIOCSERGETLSR is a good thing to try. But given the afterthought/reaction nature of the ifdefs in rxtx, I would not put it past silly preprocessing mistakes that may be as simple as you don't have a Solaris machine or have a Linux machine and we didn't handle that case right. The ifdefs go both ways there. It is possible to attach gdb to the jvm. HP and IBM have published some info on that that google can find. Usually when rxtx segv's it is so blatant, the eventThread does not even start. I've usually just sprinkled some debug messages then stared at the sillyness. The Linux code should not be hard to figure out with an example system. The w32 issues have been what takes me time to figure out. On Mon, 26 Nov 2007, U. George wrote: > Technically, with, or without TIOCSERGETLSR it *SHOULD* work the same. > Still does not explain the SIGSEGV on the current development code > > Trent Jarvi wrote: >> On Mon, 26 Nov 2007, U. George wrote: >> >>> So I undef'ed the define TIOCSERGETLSR on a linux box, I find that RXTX >>> no longer works . this is a :{ > From netbeans at gatworks.com Wed Nov 28 07:16:17 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 28 Nov 2007 09:16:17 -0500 Subject: [Rxtx] #undef TIOCSERGETLSR on LINUX In-Reply-To: References: <474ACFBE.5050406@gatworks.com> <474B8758.6010006@gatworks.com> Message-ID: <474D7831.5010300@gatworks.com> Box is a PIII laptop, with a USB 1 port. Device is a serialUSB device ( as per linux/redhat ) Debugging is not terribly easy on LINUX when there are pthreads involved. Its not getting easier when SUN/java has placed extensive hooks in catching and logging ( catchable ) events. for example this logfile excerp: > # > # An unexpected error has been detected by Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0xb50ad67b, pid=4291, tid=16386 > # > # Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, sharing) > # Problematic frame: > # C [librxtxSerial.so+0x567b] Java_gnu_io_RXTXPort_interruptEventLoop+0xd3 > # > # If you would like to submit a bug report, please visit: > # http://java.sun.com/webapps/bugreport/crash.jsp > # > > --------------- T H R E A D --------------- > > Current thread (0x08291800): JavaThread "main" [_thread_in_native, id=4293] > > siginfo:si_signo=11, si_errno=0, si_code=1, si_addr=0xb50a77a0 > There are more java magical switches to aid in debugging, but they appear to be undocumented. So I have to go back to some old e-mails Right now I think its the SIGABRT that is sent a second time ( the first is caught ) to interrupt the drain_loop thread. > > The Linux code should not be hard to figure out with an example system. > The w32 issues have been what takes me time to figure out. From dwippermann at gmx.net Wed Nov 28 08:47:04 2007 From: dwippermann at gmx.net (Daniel Wippermann) Date: Wed, 28 Nov 2007 16:47:04 +0100 Subject: [Rxtx] Dual Core Problem In-Reply-To: References: Message-ID: Hi all, > I am struggling with an application that uses RXTX 2.1.7 and has been > working reliably in the past. When this program runs on a dual-core DELL > (Intel T2500), strange things happen with the RS232 communication. The > application is missing incoming characters and also often freezes when > trying to close the serial port. I highly suspect a threading problem > and was wondering if a) anybody had run into a similar problem with dual > core processors and b) if there is a list of does and dont's when it > comes to RXTX and threads. I just stumbled over the same "freeze" of the application while trying to "close()" the RXTXPort. In this rare circumstances the "IOLocked" variable of the RXTXPort class still has a value greater than 0 although no action is pending. That makes the close() method sleep forever in expectation of some other thread to end its work... I believe this is caused by the "IOLocked++" and "IOLocked--" instructions not being synchronized. I suspect that in a multi-core- CPU environment there is a chance that this instructions may interfere if two threads are operating on the same port, but in different CPU cores. In my example the monitor thread is reading the port, while the main thread, that opened the port, is writing to it. I just changed my application so that every port handling method call is done from within a synchronized method or block. I have not observed another freeze since then, although I did an extensive stress test. But I think it would be nice if you could do the synchronisation from within the library in a future release. Best regards, Daniel From netbeans at gatworks.com Fri Nov 30 17:22:28 2007 From: netbeans at gatworks.com (U. George) Date: Fri, 30 Nov 2007 19:22:28 -0500 Subject: [Rxtx] #undef TIOCSERGETLSR on LINUX In-Reply-To: <474D7831.5010300@gatworks.com> References: <474ACFBE.5050406@gatworks.com> <474B8758.6010006@gatworks.com> <474D7831.5010300@gatworks.com> Message-ID: <4750A944.7010504@gatworks.com> U. George wrote: > Box is a PIII laptop, with a USB 1 port. Device is a serialUSB device ( > as per linux/redhat ) > Debugging is not terribly easy on LINUX when there are pthreads The issue seems to be a mis-coordination of the "drain_loop" thread use of the eis struct which is created from the "RXTXPort(eventLoop)" stack. Once the flag eis.closing is set, the call to event loop is completed, and the stack space is released ( re-used ). unfortunately drain_loop still appears to be using the data, as the pthread_kill() signal has yet to be processed by the drain_loop thread. The pthread_join() could be used here to wait for the drain_loop thread to terminate. It might work if the pthread_detach() is *not* used, which unfortunately is called by the thread creator as well as the thread itself :{ From keithvz at verizon.net Thu Nov 1 08:08:58 2007 From: keithvz at verizon.net (Keith) Date: Thu, 01 Nov 2007 10:08:58 -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: <4729DDFA.7080206@verizon.net> Trent Jarvi wrote: > 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? Well, I honestly don't know how all this fits together. I think it's just a matter of enabling the right flow control option within the standard serial framework to tell the device driver, "HEY START USING DTR/DSR FOR FLOW CONTROL." If what UGeorge said,(about that type of nitty-gritty lead control being done within the device driver), is true, then this confirms my suspicion. I tried narrowing down within the Linux drivers what you are looking for, but I can't entirely tell wth I'm looking at. (virtual com port drivers -- they are included compiled by default with Ubuntu, source included) http://www.ftdichip.com/Drivers/VCP/Linux/ftdi_sio.tar.gz Hahahaa, they make a reference to DTR flow control being supported but say (UGH) in parenthesis. You can also use their direct device driver library on Ubuntu -- libftd2xx.so.0.4.13. No source code. http://www.ftdichip.com/Drivers/D2XX/Linux/libftd2xx0.4.13.tar.gz In that case, you make a call to their FT_SetFlowControl() function. FT_STATUS FT_SetFlowControl (FT_HANDLE ftHandle, USHORT usFlowControl, UCHAR uXon,UCHAR uXoff) Parameters ftHandle Handle of the device. usFlowControl Must be one of FT_FLOW_NONE, FT_FLOW_RTS_CTS, ****FT_FLOW_DTR_DSR**** or FT_FLOW_XON_XOFF. uXon Character used to signal Xon. Only used if flow control is FT_FLOW_XON_XOFF. uXoff Character used to signal Xoff. Only used if flow control is FT_FLOW_XON_XOFF. This is from their programming guide http://www.ftdichip.com/Documents/ProgramGuides/D2XXPG34.pdf I actually want to take this a step further and say that I think the flow control is actually handled right on the device itself in hardware/firmware. It's enabled through the device driver, but I think the maintaining of buffers, asserting/deasserting of leads, etc is handled by the device. For the time being, I've switched to jd2xx, https://jd2xx.dev.java.net/ and http://bleyer.org/jd2xx/ These are Java wrappers for the device driver libraries. It allows almost direct access to the well-documented device drivers from Java. I hope this helps Keith From tjarvi at qbang.org Thu Nov 1 11:09:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:09:51 -0600 (MDT) 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: Hi Martin, What I usually have done is allow changes that do not impact working software including changes to methods not documented in CommAPI (which remain undocumented in rxtx) and fixes to known problems in the documented portions. That way if you use the documented API, the releases should only become better with time. If you use the undocumented portions, the behavior is not as predictable but open for improvement. On Wed, 31 Oct 2007, 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 >> > From tjarvi at qbang.org Thu Nov 1 11:15:52 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:15:52 -0600 (MDT) 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: I too use rxtx in commercial products. The problem I've been trying to address while bringing the server back was how to make it possible for hobby folks to build the same software as companies so we can move rxtx along a little faster. Exposing internal tools is not an option at this time, the public rxtx builds have been done on my home machine which has drives hanging out of it all over the place dying one at a time. This isn't maintainable. I'm currently looking at the possibility of making an S3 image available on Amazon's EC. These are machines you can rent for ~10 cents an hour which is more than enough to build rxtx. The S3 image is not changed when people use it so everyone has the same starting point. With this, we could all build rxtx for ~20 platforms for a small price and eliminate tool issues. On Wed, 31 Oct 2007, Greg Johnson wrote: > 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 tjarvi at qbang.org Thu Nov 1 11:19:55 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:19:55 -0600 (MDT) 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: On Wed, 31 Oct 2007, 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. I was helping Dmitry do the Mac OS X port without access to a machine when we put that in. In the archives there is information (easily found with google on Apple's site) that describes how their API (and others) can determine if a port is used and ignore it. I think these changes are in CVS but need to confirm. The bottom line is that rxtx should not have used lock files on Mac. It was just ignorance of the system on my part. -- Trent Jarvi tjarvi at qbang.org From fabioanjos at gmail.com Thu Nov 1 12:35:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Thu, 1 Nov 2007 15:35:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Hi, I was using SerialEventListener in my project. But, as was said here, id doesnt work very well with virtual serial ports. So, I changed the strategy using the code posted here in this thread: try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > 0) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } The thing is that in my tests I could notice that in.read(buffer) never blocks. Even when there's nothing to read. Instead of blocking when there's nothing to read it returns 0. So, my questions are: 1. Am I doing something wrong? 2. If not, wouldnt this decrease performance? (the thread would be locked in a loop that does nothing.) 3. Is there a better way to do the job? Thanks in advance!! F?bio -------- On 10/31/07, Andre-John Mas wrote: > > > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/0aee59d0/attachment-0032.html From ajmas at sympatico.ca Thu Nov 1 16:07:55 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Nov 2007 18:07:55 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Message-ID: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From sarah_662005 at yahoo.com Thu Nov 1 17:10:05 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Thu, 1 Nov 2007 16:10:05 -0700 (PDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Message-ID: <351433.37166.qm@web55814.mail.re3.yahoo.com> Thank you very much for your help. Now the application works fine. the serialEvent gets triggered. Rxtx is cool! ----- Original Message ---- From: Andre-John Mas To: Sara Hugh ; RXTX Developers and Users Sent: Wednesday, October 31, 2007 9:55:45 AM Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered 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 __________________________________________________ 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/20071101/4a86bea6/attachment-0032.html From tjarvi at qbang.org Thu Nov 1 17:58:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 17:58:02 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx Message-ID: The rxtx.org site is primarily interested in the hobby aspects of rxtx. Obviously, there are some companies following the work too. These interests bring larger workflows and concerns about details hobby folks may not care about. They also bring many more users. I know the company I work for has a quality engineering effort going on which includes rxtx. While the server was down, I was contacted by another company that was missing the binaries for their testing. Several people have mentioned concerns about a stable release for like reasons. Would there be interest on the quality side of the coin to get together? It could be just sharing email's with each other or a seperate list for QE/QA. I can not say for sure, but we may be able to share some of our efforts/results that could help keep rxtx releases stable. -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Fri Nov 2 01:42:55 2007 From: scldad at sdc.com.au (Stephen Davies) Date: Fri, 2 Nov 2007 18:12:55 +1030 Subject: [Rxtx] Multiple modems Message-ID: <200711021812.56047.scldad@sdc.com.au> This may or may not be related to the Multiple Ports thread. I have an application which uses rxtx on Linux (via cron jobs) to connect multiple modems to remote sensing devices. The application works fine most of the time but occasionally fails to connect if two (or more) connection attempts happen at about the same time. When it fails, it looks as if it may get confused as to which port it is talking to. The app has a "base" component that looks for an available port, opens it and then creates an input thread and an output thread for the connection and data transfer. The "base" component uses this code: // loop round all known ports until one is available. Give up after three minutes Counter ptimeout = new Counter(); while(!portFound && ptimeout.elapsed() < 180000) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // special case. ttyS0 is not available to us on this server. if (!portId.isCurrentlyOwned() && !portId.getName().equals("/dev/ttyS0")) { gLog.debug(lognm + ": Found port " + portId.getName()); try { serialPort = (RXTXPort) portId.open("AguaModem", 10000); } catch (Exception e) { gLog.error(lognm + ": Port " + portId.getName() + " will not open."); gLog.error(e.getMessage()); continue; } AguaModem aguamodem = new AguaModem(); portFound = true; break; } gLog.debug(lognm + ": Port " + portId.getName() + " is busy"); } } } I am wondering about the isCurrentlyOwned method. Does this actually tell me whether a port is currently being used by another process? TIA, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From fabioanjos at gmail.com Fri Nov 2 04:59:58 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 07:59:58 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Message-ID: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/9009eb1d/attachment-0032.html From netbeans at gatworks.com Fri Nov 2 06:28:13 2007 From: netbeans at gatworks.com (U. George) Date: Fri, 02 Nov 2007 08:28:13 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <472B17DD.1050508@gatworks.com> It should normally block ( unless eof / event ) . so its a :{ whats the device ( to recreate if possible ) and how do u open. > My question is, is there a way to make in.read block the thead until > there's something to read? > From fabioanjos at gmail.com Fri Nov 2 06:34:46 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 09:34:46 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > On 11/1/07, Andre-John Mas wrote: > > > > Fabio, > > > > Turns out there was a small error in my example. The test should be: > > > > (numBytes = in.read(buffer)) > -1 > > > > This is because -1 indicates an end of file (end of data stream) > > > > Andre > > > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > > > Hi, > > > > > > I was using SerialEventListener in my project. But, as was said > > > here, id doesnt work very well with virtual serial ports. > > > So, I changed the strategy using the code posted here in this thread: > > > > > > try{ > > > in = port.getInputStream(); > > > out = port.getOutputStream(); > > > int numBytes = 0; > > > while(active){ > > > > > > byte[] buffer = new byte[10]; > > > > > > while ( (numBytes = in.read(buffer)) > 0) > > > { > > > String dataValue = new String(buffer,0,numBytes); > > > processInput(dataValue); > > > } > > > > > > if(numBytes==-1){ > > > break; > > > } > > > > > > Thread.sleep(50); > > > } > > > > > > }catch(IOException e){ > > > logger.info("falha de comunicacao "+ > > > getReceptor().getPort() ); > > > > > > }catch(InterruptedException e){ > > > logger.info ("Interrompendo leitura da porta "+ > > > getReceptor().getPort() ); > > > } > > > > > > The thing is that in my tests I could notice that in.read(buffer) > > > never blocks. Even when there's nothing to read. Instead of blocking > > > when there's nothing to read it returns 0. > > > > > > So, my questions are: > > > > > > 1. Am I doing something wrong? > > > 2. If not, wouldnt this decrease performance? (the thread would be > > > locked in a loop that does nothing.) > > > 3. Is there a better way to do the job? > > > > > > Thanks in advance!! > > > > > > F?bio > > > -------- > > > > > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > > 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 > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > > > > > -- > > > Atenciosamente, > > > F?bio Cristiano dos Anjos > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/5306c4b1/attachment-0032.html From nick.circelli at infrasafe.com Fri Nov 2 07:01:17 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Fri, 2 Nov 2007 08:01:17 -0500 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com><29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com><90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca><29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Message-ID: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> I'm pretty sure that not blocking has to do with you virtual ports. Cause it should block. Maybe you should try: while ((numBytes = in.available()) > 0) { If (numBytes > buffer.length) { numBytes = buffer.length; // in case you have buffer overflow } numBytes = in.read(buffer, 0 , numBytes)); String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } Also, just for optimization, I'd move that byte[] buffer = new byte[10]; out of the while since you don't need to reallocate it every iteration. ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of F?bio Cristiano dos Anjos Sent: Friday, November 02, 2007 8:35 AM To: RXTX Developers and Users Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream (); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas < ajmas at sympatico.ca > wrote: Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info ("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Atenciosamente, F?bio Cristiano dos Anjos -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/4de7f6a3/attachment-0032.html From fabioanjos at gmail.com Fri Nov 2 07:36:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 10:36:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> Message-ID: <29788b250711020636q1588c88fgaa5e27f5504164fb@mail.gmail.com> Hi Nick, Actually, it doesnt block for physical ports too. And, the method avaiable does not block either, so when there's nothing avaiable the loop ends and the thread stops lintening to the port. But I did some more test with serialEventListener, and now its working. I realy dont know what I've done to get it working. I just start woking as soon as I decided to test it again. It was said here that serialEventListener is not reliable for virtual serial ports. Is there another way to read it, without compromising performance? Tanks again!! F?bio ------- On 11/2/07, Nick Circelli wrote: > > I'm pretty sure that not blocking has to do with you virtual ports. > Cause it should block. > > Maybe you should try: > > > > while ((numBytes = in.available()) > 0) > > { > > If (numBytes > buffer.length) { > > numBytes = buffer.length; // in case you have buffer overflow > > } > > numBytes = in.read(buffer, 0 , numBytes)); > > String dataValue = new String(buffer,0,numBytes,"ASCII"); > > processInput(dataValue); > > } > > > > Also, just for optimization, I'd move that byte[] buffer = new > byte[10]; > > out of the while since you don't need to reallocate it every iteration. > > > ------------------------------ > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On Behalf > Of *F?bio Cristiano dos Anjos > *Sent:* Friday, November 02, 2007 8:35 AM > *To:* RXTX Developers and Users > *Subject:* Re: [Rxtx] serialEvent(SerialPortEvent event) never be > triggered > > > > Hi, > > I think i missunderstand something here. > The code you post here was meant to be used inside serialEvent method, > right? > > The think is, that i cannot user SerialEventListener to read serial ports, > because i need to read virual serial ports and id does not behaves well, as > said here before. serialEvent is never triggered. > > So what I quit using SerialEventListener and created a thread to listen to > the port: > > public void run(){ > try{ > in = port.getInputStream(); > out = port.getOutputStream (); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new > String(buffer,0,numBytes,"ASCII"); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ getReceptor().getPort() > ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > } > > > So, the problem is that in.read(buffer) always returns 0 when there is > nothing to read, instead of blocking the flow, and the thread becames locked > in the loop. > > I hope you can help me solve this. > > Thanks in advance! > > F?bio > -------- > > On 11/2/07, *F?bio Cristiano dos Anjos* wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > > > On 11/1/07, *Andre-John Mas* < ajmas at sympatico.ca> wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info ("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/571df6ea/attachment-0031.html From tjarvi at qbang.org Fri Nov 2 08:32:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Nov 2007 08:32:15 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: References: Message-ID: On Fri, 2 Nov 2007, Greg Johnson wrote: > Hi Trent, folks, > Having a single rxtx that is suitable for commercial uses and hobbyists both > would be a great idea? Perhaps it would be worth submitting rxtx as a > proposal to Codehaus - they not only provide excellent tools (Jira (bug > tracker), Confluence (wiki)) but also support build management ( > maestro, continuum, bamboo). Relying on your personal machine (btw, frii.com > / rxtx.org is down again?) seems like a burden you shouldn't have to shoulder > alone. Hi Greg, There may be a little confusion here. There is no need to have two seperate rxtx releases. What I'm trying to encourage is a discussion between some of the people responsible for making sure rxtx does not break their products each release. Usually these people are interested in testing a set of functionality their product depends upon. They do not work with rxtx code but rather traps to catch when rxtx developers break something. This goes on all the time in isolated labs. There are many services that offer to do various pieces of a project for you if you... Anyone is free to do the 'if you' portion with rxtx and see how it goes. I'm actually interested in doing less of that than more. The rxtx.org work I do just happens to overlap with other things I do for personal/family use. The reason I suggest the amazon solution is that anyone can take full control of the environment for a day and it costs less than a package of gum without causing harm to what anyone else is doing. I assume the down question was with respect to a mod_security setting that has been resolved. If not, please post a url to the problem. -- Trent Jarvi tjarvi at qbang.org From nsayer at kfu.com Sat Nov 3 20:17:49 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 19:17:49 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? Message-ID: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Has anyone got RXTX working with an app under Leopard? My app hangs on port open (it works fine with Tiger). The relevant thread looks like this in the activity monitor: 1536 JVM_InvokeMethod 1536 0x48ccd0 1536 0x46f8a0 1536 0x4c3ff4 1536 0x4c4284 1536 0x357d160 1536 0x357faac 1536 Java_gnu_io_RXTXPort_open 1536 open $NOCANCEL$UNIX2003 1536 open $NOCANCEL$UNIX2003 From ajmas at sympatico.ca Sat Nov 3 22:02:04 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 00:02:04 -0400 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> RXTX works for me with Leopard. I am currently using it communicate with a Bluetooth GPS. What computer and device are you trying to use? Is the driver for your serial device compatible with MacOS X 10.5? Andre On 3-Nov-07, at 22:17 , Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From nsayer at kfu.com Sat Nov 3 22:17:47 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 21:17:47 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> Message-ID: <1720F723-3643-438C-B3AB-E09A67536977@kfu.com> On Nov 3, 2007, at 9:02 PM, Andre-John Mas wrote: > RXTX works for me with Leopard. I am currently using it communicate > with a Bluetooth GPS. > > What computer and device are you trying to use? Is the driver for > your serial device compatible with MacOS X 10.5? An Intel mac mini The FTDI USB serial driver an XMPCR, which is just a fancy serial controlled radio and an FTDI usb-to-serial chip I've successfully used the FTDI driver with another FTDI device in another context. > > > Andre > > On 3-Nov-07, at 22:17 , Nick Sayer wrote: > >> Has anyone got RXTX working with an app under Leopard? >> >> My app hangs on port open (it works fine with Tiger). The relevant >> thread looks like this in the activity monitor: >> >> 1536 JVM_InvokeMethod >> 1536 0x48ccd0 >> 1536 0x46f8a0 >> 1536 0x4c3ff4 >> 1536 0x4c4284 >> 1536 0x357d160 >> 1536 0x357faac >> 1536 >> Java_gnu_io_RXTXPort_open >> 1536 open >> $NOCANCEL$UNIX2003 >> 1536 open >> $NOCANCEL$UNIX2003 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From racecar at gmail.com Sat Nov 3 22:25:53 2007 From: racecar at gmail.com (Kevin Mateo Lim) Date: Sat, 3 Nov 2007 21:25:53 -0700 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: Message-ID: I am alternating between two errors. After i run the macosx_setup.command, "everyone" is set to Read only in /var/lock. I notice in the terminal that the group for these perms is _uucp, not uucp. In that state, I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 check_group_uucp(): error testing lock file creation Error details:Permission deniedcheck_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException : Error inside Serial.() at processing.serial.Serial.errorMessage(Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.( Serial.java:102) at Temporary_829_3245.setup(Temporary_829_3245.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java :690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) Then, I hand edit the "everyone" permissions for /var/lock/ to Read and Write (note /var/spool/uucp is Read/Write in all cases, and doesn't change). I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX uucp_lock() /var/lock/LK.003.009.000 is there gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException: Error inside Serial.() at processing.serial.Serial.errorMessage (Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.(Serial.java:102) at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java:690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) See here: http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071103/f1a2c467/attachment-0030.html From greg.johnson at manchester.ac.uk Sun Nov 4 02:31:13 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sun, 4 Nov 2007 10:31:13 +0100 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <28B5E0A0-0802-4C74-AC21-87ED35F3B9A2@manchester.ac.uk> Hi Nick, I also had problems initially with Leopard, but it was resolved by reinstalling the serial USB driver (FTDI in my case). The symptoms were a non-detection of any ports (but I twigged when I tried ZTerm and it had the same problem). Good luck! Cheers, greg PS I did a "Archive and install" which may be the reason my FTDI driver had disappeared - I don't think the driver has changed for 10.5 ------------------------------------------------------------------------- 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 4 Nov 2007, at 03:17, Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Sun Nov 4 13:01:12 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 15:01:12 -0500 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: Message-ID: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Hi, You will need to get the 2.1-8 code from CVS. See the FAQ for more information: http://rxtx.qbang.org/wiki/index.php/FAQ Andre On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > I am alternating between two errors. > > After i run the macosx_setup.command, "everyone" is set to Read only > in /var/lock. I notice in the terminal that the group for these > perms is _uucp, not uucp. > > In that state, I get this error: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > check_group_uucp(): error testing lock file creation Error > details:Permission deniedcheck_lock_status: No permission to create > lock file. > please see: How can I use Lock Files with rxtx? in INSTALL > gnu.io.PortInUseException: Unknown Application > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > java.lang.RuntimeException : Error inside Serial.() > > at processing.serial.Serial.errorMessage(Serial.java:583) > > at processing.serial.Serial.(Serial.java:148) > > at processing.serial.Serial.( Serial.java:102) > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > at processing.core.PApplet.run(PApplet.java:1556) > > at java.lang.Thread.run(Thread.java:613) > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > and Write (note /var/spool/uucp is Read/Write in all cases, and > doesn't change). I get this error: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > gnu.io.PortInUseException: Unknown Application > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > java.lang.RuntimeException: Error inside Serial.() > > at processing.serial.Serial.errorMessage (Serial.java:583) > > at processing.serial.Serial.(Serial.java:148) > > at processing.serial.Serial.(Serial.java:102) > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > at processing.core.PApplet.run(PApplet.java:1556) > > at java.lang.Thread.run(Thread.java:613) > > See here: > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From netbeans at gatworks.com Sun Nov 4 14:33:35 2007 From: netbeans at gatworks.com (U. George) Date: Sun, 04 Nov 2007 16:33:35 -0500 Subject: [Rxtx] #ifndef TIOCSERGETLSR Message-ID: <472E3AAF.7050709@gatworks.com> For Linux, it seems that you need the code for both *having* a TIOCSERGETLSR, and *not having* a TIOCSERGETLSR. Maybe the ioctl exists system wide, but not necessarily for the device driver itself ( always returns -1 ) . Are there systems that have a *functioning* TIOCSERGETLSR for all their devices? Then this would be the case where the "#ifndef TIOCSERGETLSR" directive could be useful is eliminating the unnecessary code and tests. And for those systems that dont have a TIOCSERGETLSR, then the code for TIOCSERGETLSR can be eliminated. It would be a simple case to have, as a foundation, all the code to simulate the missing TIOCSERGETLSR ioctl. If the system does have the ioctl, then that code can be ifdef'd in, and co-exist with the functionality of the code that simulates the missing TIOCSERGETLSR ioctl. From racecar at gmail.com Sun Nov 4 17:30:19 2007 From: racecar at gmail.com (Kevin Mateo Lim) Date: Sun, 4 Nov 2007 17:30:19 -0700 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: the README.OSX reads: Put libSerial.jnilib in the directory of the application (the JavaVM will find it there). Add RXTXComm.jar to the application classpath or include the classes in the application jar. (Some applications already include the RXTX classes in their application jar, in which case only the file libSerial.jnilib is required). I can't find libSerial.jnilib I put librxtxSerial.jnilib into my Processing /libraries/serial/library/ directory. Yet it still sees the old version: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 On 11/4/07, Andre-John Mas wrote: > > Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > 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/20071104/c0a83f91/attachment-0029.html From ajmas at sympatico.ca Sun Nov 4 17:41:47 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 19:41:47 -0500 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> If you are wanting it to be available for all applications, - for all users: /Library/Java/Extensions - for your user: ~/Library/Java/Extensions Or just for your application, then it should be in the same directory from which yo are launching your application. If you are getting the 2.1-8 source, then the library built is called: librxtxSerial.jnilib despite what the docs say. Andre On 4-Nov-07, at 19:30 , Kevin Mateo Lim wrote: > > the README.OSX reads: > Put > libSerial.jnilib > in the directory of the application (the JavaVM will find it there). > Add > RXTXComm.jar > to the application classpath or include the classes in the > application jar. > (Some applications already include the RXTX classes in their > application jar, > in which case only the file libSerial.jnilib is required). > > > I can't find libSerial.jnilib > I put librxtxSerial.jnilib into my Processing /libraries/serial/ > library/ directory. > > Yet it still sees the old version: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > On 11/4/07, Andre-John Mas wrote: Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial .(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay (PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > From bschlining at gmail.com Sun Nov 4 19:46:23 2007 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 4 Nov 2007 18:46:23 -0800 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> Message-ID: > > Or just for your application, then it should be in the same directory > from which yo are launching your application. Just wanted to add one more way of specifying the native lib location... If you don't want to define it globally by putting it in /Library/Java/Extensions (and you don't, it's a very very bad practice) you can also specify the location of the native library when starting the JVM by specifying the 'java.library.path' property. For example: java -Djava.library.path=/Path/To/Directory/With/RXTX/Library YourMainClass -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071104/c5af6980/attachment-0029.html From greg.johnson at manchester.ac.uk Mon Nov 5 01:39:02 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Mon, 5 Nov 2007 09:39:02 +0100 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: The 2.1-8 code reports 2.1-7, hence your (and my) confusion. But as long as you've removed all traces of the old library, it really _is_ 2.1-8. And if you specify the library path to the VM, don't make my mistake (on OSX at least) - you need to respecify the entire library path it had by default, as the command line argument replaces the path, rather than appending to it. 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 5 Nov 2007, at 01:30, Kevin Mateo Lim wrote: > > the README.OSX reads: > Put > libSerial.jnilib > in the directory of the application (the JavaVM will find it there). > Add > RXTXComm.jar > to the application classpath or include the classes in the > application jar. > (Some applications already include the RXTX classes in their > application jar, > in which case only the file libSerial.jnilib is required). > > > I can't find libSerial.jnilib > I put librxtxSerial.jnilib into my Processing /libraries/serial/ > library/ directory. > > Yet it still sees the old version: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > On 11/4/07, Andre-John Mas wrote: > Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial .(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay (PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > 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 HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071105/7f50506d/attachment-0029.html From cyrille.dumont at tatexpress.fr Mon Nov 5 05:46:03 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 05 Nov 2007 13:46:03 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: References: <472727F1.1000704@tatexpress.fr> Message-ID: <472F108B.2090101@tatexpress.fr> Thanks a lot for your solution ... but I'm not a expert in JAVA ... (sorry) For the moment I've this function : """ public void serialEvent(SerialPortEvent e) { StringBuffer inputBuffer = new StringBuffer(); int newData = 0; switch (e.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } //-- Manag. Data from Scanner this.MngDataScanner(inputBuffer.toString()); break; case SerialPortEvent.BI:; //-- Break Received } } """ How can I do what you write ? ( maybe a simple ex ? ) PS : I don't know the PDF417 size (could be, for example, 338 char, or 500 ... ; what I know is that it can't be more than 800 char) Thanks in advance. Best regards. Trent Jarvi a ?crit : > 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 Martin.Oberhuber at windriver.com Mon Nov 5 08:47:50 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 5 Nov 2007 16:47:50 +0100 Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> Hi Trent, are the interestes of hobbyists really so different from commercial ones? Both should be interested in high quality and innovation the like. I haven't seen too many Open Source projects from the "inside" but those that I have seen did not have separate mailing lists for quality/testing/qa versus innovation/development. What I have seen with the Open Source projects that one would call "successful" is a good deal of process around automated builds, automated unit tests, predictable release dates and milestones, and policies around commiting/contributing/reviewing changes. I think that all of these benefit commercial users and hobbyists the like. If you were just asking about who's interested in discussing changes to foster more quality, count me in. I'm just not sure whether discussing these on a separate mailing list or other channel is the right thing to do. Cheers, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From toupsz at cs.tamu.edu Tue Nov 6 14:27:04 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 15:27:04 -0600 Subject: [Rxtx] reading TTL level signals from serial? Message-ID: Dear RXTX community- I've been using RXTX to handle communicating with several hardware devices in Java (a GPS and some custom audio circuitry for my dissertation work). I have a new, high-accuracy GPS which only communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there any way to communicate with this device using RXTX, perhaps by modding the native code for Windows? If so, does anyone have any tips on how to do it? Has it perhaps already been done? Another option is for me to invert / amplify the signal in hardware, but this is difficult for me to pull off due to the sensitivity of the electronics involved...I'll likely end up using a much less accurate piece of equipment rather than go that far! If anyone could help out, I'd really appreciate it! Thanks! -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/b6c59c2b/attachment-0027.html From netbeans at gatworks.com Tue Nov 6 14:55:22 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 06 Nov 2007 16:55:22 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: Message-ID: <4730E2CA.3090009@gatworks.com> This is really a hardware issue. Is there any device ( ie the serial port ) on your computer that will accept the voltage signals ( and load ) that your device produces? Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it happen safely ( ie u dont cook the GPS device ) I have a new, high-accuracy GPS which only > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there > any way to communicate with this device using RXTX, From toupsz at cs.tamu.edu Tue Nov 6 15:14:01 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 16:14:01 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4730E2CA.3090009@gatworks.com> References: <4730E2CA.3090009@gatworks.com> Message-ID: Actually, the device runs over USB, but shows up as a virtual serial port and is outputting these signals. The software that comes with the device (a u-blox ANTARIS 4 eval kit) is able to communicate. RXTX is able to detect and properly configure the port, but does not get any of the data from it. :-/ It seems like there must be some way to do it (obviously, ublox knows how)... -Zach On Nov 6, 2007 3:55 PM, U. George wrote: > This is really a hardware issue. > Is there any device ( ie the serial port ) on your computer that will > accept the voltage signals ( and load ) that your device produces? > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it > happen safely ( ie u dont cook the GPS device ) > > > I have a new, high-accuracy GPS which only > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there > > any way to communicate with this device using RXTX, > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/15ae7a0b/attachment-0027.html From keithvz at verizon.net Tue Nov 6 16:16:55 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 06 Nov 2007 18:16:55 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> Message-ID: <4730F5E7.1030704@verizon.net> Zach Toups wrote: > On Nov 6, 2007 3:55 PM, U. George > wrote: > > This is really a hardware issue. > Is there any device ( ie the serial port ) on your computer that will > accept the voltage signals ( and load ) that your device produces? > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it > happen safely ( ie u dont cook the GPS device ) > > > I have a new, high-accuracy GPS which only > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is > there > > any way to communicate with this device using RXTX, > _______________________________________________ As UGeorge intimated, it's a hardware issue. If your device outputs TTL level voltages, and your USB to serial converter is RS-232, then you've got a physical hardware differences. Inverted leads and voltage issues are mainly the problem. MAXIM makes a neat little chip called the MAX233 (better than the 232, no extern caps required) You can't solve this in software. Now, there are TTL level compatible USB to serial converters available, I happen to be using one right now. This unit below is from a UK company (there might be sources in the US) http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm Parallax makes one that does 3.3 and 5v http://www.parallax.com/detail.asp?product_id=32201 (but only supports RX, TX, GND, AND DTR towards device) (i've tested a variant of the unit above, and it works with RXTX) In both cases, you'll need some creative wiring depending on the interface on your GPS. Hope this helps Keith From toupsz at cs.tamu.edu Tue Nov 6 16:53:01 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 17:53:01 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4730F5E7.1030704@verizon.net> References: <4730E2CA.3090009@gatworks.com> <4730F5E7.1030704@verizon.net> Message-ID: Yeah...I used an FTDI chip to handle USB/serial conversion on the audio equipment I built. I'm leery of trying to build a board for this ublox GPS due to all the grounding/shielding issues around it. Anyway, I apreciate the help...just sad that I can't handle the problem in software! Ublox did send me the source code for their USB drivers...but as a Java programmer, it's a bit tough for me to sort out. ;) Thanks again! -Zach On Nov 6, 2007 5:16 PM, Keith Monahan wrote: > Zach Toups wrote: > > > On Nov 6, 2007 3:55 PM, U. George > > wrote: > > > > This is really a hardware issue. > > Is there any device ( ie the serial port ) on your computer that > will > > accept the voltage signals ( and load ) that your device produces? > > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make > it > > happen safely ( ie u dont cook the GPS device ) > > > > > > I have a new, high-accuracy GPS which only > > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is > > there > > > any way to communicate with this device using RXTX, > > _______________________________________________ > > As UGeorge intimated, it's a hardware issue. > > If your device outputs TTL level voltages, and your USB to serial > converter is RS-232, then you've got a physical hardware differences. > Inverted leads and voltage issues are mainly the problem. MAXIM makes a > neat little chip called the MAX233 (better than the 232, no extern caps > required) > > You can't solve this in software. > > Now, there are TTL level compatible USB to serial converters available, > I happen to be using one right now. > > This unit below is from a UK company (there might be sources in the US) > > http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm > > Parallax makes one that does 3.3 and 5v > > http://www.parallax.com/detail.asp?product_id=32201 > (but only supports RX, TX, GND, AND DTR towards device) > > (i've tested a variant of the unit above, and it works with RXTX) > > In both cases, you'll need some creative wiring depending on the > interface on your GPS. > > Hope this helps > > Keith > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/06e88ad4/attachment-0027.html From netbeans at gatworks.com Tue Nov 6 17:14:01 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 06 Nov 2007 19:14:01 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> <4730F5E7.1030704@verizon.net> Message-ID: <47310349.5000406@gatworks.com> what gps chipset do u have? > Ublox did send me the source code for their USB drivers...but as a Java > programmer, it's a bit tough for me to sort out. ;) From Steffen.DETTMER at ingenico.com Wed Nov 7 03:10:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 7 Nov 2007 11:10:01 +0100 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> Message-ID: <20071107101000.GN10978@elberon.bln.de.ingenico.com> * Zach Toups wrote on Tue, Nov 06, 2007 at 16:14 -0600: > Actually, the device runs over USB, but shows up as a virtual > serial port and is outputting these signals. Ahh, so what you want is to use rxtx on the serial port that is created by the driver and mapped maybe as some COM8 or whatever? I this case then IMHO it would be no hardware question but maybe a problem in your application, or some driver or indeed a rxtx issue. > The software that > comes with the device (a u-blox ANTARIS 4 eval kit) is able to > communicate. Is it sure that this software is really using the virtual serial port and only this port? oki, Steffen -- About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Wed Nov 7 04:59:10 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 06:59:10 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <20071107101000.GN10978@elberon.bln.de.ingenico.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> Message-ID: <4731A88E.6080705@gatworks.com> >> The software that >> comes with the device (a u-blox ANTARIS 4 eval kit) is able to >> communicate. > > Is it sure that this software is really using the virtual serial > port and only this port? > I have tried to read the docs. I have yet to find any explanation on a (windoz) device driver for this device ( the usb device ). That magic is not explained. For a developer thats important magic. Maybe a call to their support team is in order? From netbeans at gatworks.com Wed Nov 7 05:01:38 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 07:01:38 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <20071107101000.GN10978@elberon.bln.de.ingenico.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> Message-ID: <4731A922.7@gatworks.com> Steffen DETTMER wrote: > * Zach Toups wrote on Tue, Nov 06, 2007 at 16:14 -0600: >> Actually, the device runs over USB, but shows up as a virtual BTW: it seems that I am not getting all the Rxtx mail. Is there still a problem? From toupsz at cs.tamu.edu Wed Nov 7 07:36:20 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Wed, 7 Nov 2007 08:36:20 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4731A88E.6080705@gatworks.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> <4731A88E.6080705@gatworks.com> Message-ID: When I emailed them about this issue, they sent me their WinCE drivers, which are apparently based on this open source driver: http://www.yetanotherhomepage.com/j7xx/j7xx.html?/j7xx/software/util/usbdriver.html These include srcdll, and x86 subfolders, though it's not 100% clear to me that these are useful. The ublox communication suite appears to only communicate with serial ports...I've communicated with the ublox on two different comm ports (one with the serial adapter plugged into the serial port, one with the main USB connection), as well as a Garmin bluetooth GPS (which comes up as a bluetooth serial device). I'm not well versed in code this close to the hardware, but it seems to me that if you're running a virtual serial port, then you're virtually controlling the "voltages" that come in on this "port"...so why would they be "ttl level"? :-/ Shouldn't the USB driver be able to interpret the signals in whatever way it wants and just supply software with the binary interpretation? Thanks for all the help, guys, it's really appreciated! -Zach On Nov 7, 2007 5:59 AM, U. George wrote: > > >> The software that > >> comes with the device (a u-blox ANTARIS 4 eval kit) is able to > >> communicate. > > > > Is it sure that this software is really using the virtual serial > > port and only this port? > > > > I have tried to read the docs. I have yet to find any explanation on a > (windoz) device driver for this device ( the usb device ). That magic > is not explained. For a developer thats important magic. Maybe a call > to their support team is in order? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071107/18a13314/attachment-0026.html From netbeans at gatworks.com Wed Nov 7 08:55:55 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 10:55:55 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> <4731A88E.6080705@gatworks.com> Message-ID: <4731E00B.9030902@gatworks.com> There are 2 components to talking to hardware. There is the electrical specification, and then there is the software specification. there is the rs232 specification, parallel port specification, and the USB electrical specification. Generally these are used to plug in the various devices, and hook up electrically. Then there is the software side. There is the device driver, a software component that sits somewhere in the kernel that handles the USB ( in your case ) controller. The device driver generally does not care about the electrical component. There are various chips that handle USB signals, and these chips have I/O addresses so that signals and data can be properly routed. There is also the side that communicates to the user via the COM port device-name. The device driver that you mentioned is for the "Support PL2303 serial chip". This device driver, which hopefully works, handles the USB chip, and eventually recognzes the gps device, and hopefully creates an COM port so the user can open up and communicate. These are a lot of "HOPES". Since u have the web address of the device driver, and developer, I would think that the developer, and any docs, might be better able to help u to first determine if the GPS device is recognized, and the COM port ( maybe its called by another name ) is created, as per documentation. > > These include srcdll, and x86 subfolders, though it's not 100% clear to > me that these are useful. From tjarvi at qbang.org Sat Nov 10 17:46:13 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Nov 2007 17:46:13 -0700 (MST) Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 5 Nov 2007, Oberhuber, Martin wrote: > Hi Trent, > > are the interestes of hobbyists really so different > from commercial ones? Both should be interested in > high quality and innovation the like. > > I haven't seen too many Open Source projects from the > "inside" but those that I have seen did not have > separate mailing lists for quality/testing/qa > versus innovation/development. > > What I have seen with the Open Source projects that > one would call "successful" is a good deal of > process around automated builds, automated unit > tests, predictable release dates and milestones, > and policies around commiting/contributing/reviewing > changes. > > I think that all of these benefit commercial users > and hobbyists the like. > > If you were just asking about who's interested in > discussing changes to foster more quality, count > me in. I'm just not sure whether discussing these > on a separate mailing list or other channel is the > right thing to do. > Hi Martin, There are two issues I'm thinking about. The first is the generic unit testing and quality initiatives required to move rxtx forward. The second is the inevitable fact that rxtx connects to external hardware. The discussion deals with a different set of problems. Here is a simple example of what I'm getting at. We have the capability of setting custom baud rates in rxtx. We may be interested in seeing regressions in rxtx, the C library or the kernel. Some people may be doing some tests with loopback connections. These will always work even if the baud rate is not set to the expected value. Some people may use null modems between two ports. This may be able to catch the problem but not always. Will the build machines be able to test this? (no - for a few reasons) Will people be trying to catch these type of regressions? (yes) What type of coverage does the community have in the end? (?) We could include the discussions in the same list or another equally open list that may be of interest to some folks that deal with these types of problems on a regular basis. -- Trent Jarvi tjarvi at qbang.org From timlow84 at gmail.com Mon Nov 12 00:31:17 2007 From: timlow84 at gmail.com (Timothy Low) Date: Mon, 12 Nov 2007 15:31:17 +0800 Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> Message-ID: <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> ---------- Forwarded message ---------- From: Timothy Low Date: Nov 12, 2007 3:02 PM Subject: Building RXTX From Source To: taj at www.linux.org.uk Cc: ferdinand.tang at tangs.net, Timothy Low , chweehuat.ng at tangs.net Hi Trent, I tried building RXTX from source, and I got this error. I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm trying to get the necessary ".so" files to use for my serial port communication through java. My linux kernal information is: *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 x86_64 x86_64 x86_64 GNU/Linux* I'll most glad if you can provide me some direction on this. Thanks ! ---------------- [root at smsgateway rxtx-2.0-7pre1]# ./configure checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu configure: WARNING: Trying libtool. If the following fails install libtool checking for gcc... gcc checking for C compiler default output... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking for ld used by GCC... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking for a sed that does not truncate output... /bin/sed checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking command to parse /usr/bin/nm -B output... ok checking how to run the C preprocessor... gcc -E checking for egrep... grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for ranlib... ranlib checking for strip... strip checking for objdir... .libs checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.lo... yes checking if gcc supports -fno-rtti -fno-exceptions... yes checking whether the linker (/usr/bin/ld) supports shared libraries... yes checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking dynamic linker characteristics... GNU/Linux ld.so checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no checking whether -lc should be explicitly linked in... no creating libtool checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking for style of include used by make... GNU checking dependency style of gcc... none checking fcntl.h usability... yes checking fcntl.h presence... yes checking for fcntl.h... yes checking sys/fcntl.h usability... yes checking sys/fcntl.h presence... yes checking for sys/fcntl.h... yes checking sys/file.h usability... yes checking sys/file.h presence... yes checking for sys/file.h... yes checking sys/time.h usability... yes checking sys/time.h presence... yes checking for sys/time.h... yes checking sys/signal.h usability... yes checking sys/signal.h presence... yes checking for sys/signal.h... yes checking signal.h usability... yes checking signal.h presence... yes checking for signal.h.. . yes checking termios.h usability... yes checking termios.h presence... yes checking for termios.h... yes checking asm/termbits.h usability... yes checking asm/termbits.h presence... yes checking for asm/termbits.h... yes checking grp.h usability... yes checking grp.h presence... yes checking for grp.h... yes checking pwd.h usability... yes checking pwd.h presence... yes checking for pwd.h... yes checking whether gcc needs -traditional... no checking whether to enable maintainer-specific portions of Makefiles... no /usr/java/jdk1.5.0_13 configure: WARNING: using JAVA_HOME environmental variable adjusted java.home is /usr/java/jdk1.5.0_13 checking os.name Linux checking os.arch i386 checking java.vendor Sun Microsystems Inc. checking java.version 1.5.0_13 checking os.version 2.6.18-8.el5xen comm.jar appears to be installed already. conftest.c: In function 'main': conftest.c:6: warning: incompatible implicit declaration of built-in function 'printf' conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:6: error: (Each undeclared identifier is reported only once conftest.c:6: error: for each function it appears in.) conftest.c:6: error: expected ')' before string constant conftest.c:7: warning: incompatible implicit declaration of built-in function 'exit' ./configure: line 9649: ./conftest: No such file or directory ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected conftest.c: In function 'main': conftest.c:5: warning: incompatible implicit declaration of built-in function 'printf' conftest.c:10: warning: incompatible implicit declaration of built-in function 'exit' configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status : config.h is unchanged config.status: executing depfiles commands [root at smsgateway rxtx-2.0-7pre1]# make install /usr/java/jdk1.5.0_13/bin/javac -classpath .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d /home/jboss/sources/rxtx- 2.0-7pre1/ -O /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java /home/jboss/sources/rxtx-2.0-7pre1/./src/UnSupportedLoggerException.java /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o /home/jboss/sources/rxtx-2.0-7pre1/x86_64-unknown-linux-gnu/SerialImp.lo /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'init_threads': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: cast from pointer to integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_nativeDrain': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: cast to pointer from integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'read_byte_array': /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: cast to pointer from integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_readArray': /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: comparison is always false due to limited range of data type /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_readTerminatedArray': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: comparison is always false due to limited range of data type mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial- 2.0.7pre1.* gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so -o .libs/librxtxSerial-2.0.7pre1.so (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.0.7pre1.so librxtxSerial.so) creating librxtxSerial.la (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la librxtxSerial.la) gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/ParallelImp.lo /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function 'Java_javax_comm_LPRPort_readArray': /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: comparison is always false due to limited range of data type rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* .libs/librxtxParallel-2.0.7pre1.* gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so -o .libs/librxtxParallel- 2.0.7pre1.so (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.0.7pre1.so librxtxParallel.so) creating librxtxParallel.la (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la librxtxParallel.la) make all-am make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' libtool: install: `x86_64-unknown-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 ------------- Regards, Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071112/27758c3c/attachment-0022.html From tjarvi at qbang.org Mon Nov 12 01:02:09 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Nov 2007 01:02:09 -0700 (MST) Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> Message-ID: On Mon, 12 Nov 2007, Timothy Low wrote: > > Hi Trent, Hi Tim, Comments are inline. As I mentioned off the list, rxtx 2.0 is on the edge of deprecation. We can get it working but this is not the path of least resistance for future work. You will probably need to bounce another round of questions off the list. The following is intended to isolate the problem. > > I tried building RXTX from source, and I got this error. > > > I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm trying > to get the necessary ".so" files to use for my serial port communication > through java. > My linux kernal information is: > > *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 x86_64 > x86_64 x86_64 GNU/Linux* > > I'll most glad if you can provide me some direction on this. Thanks ! > > ---------------- > [root at smsgateway rxtx-2.0-7pre1]# ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > checking for C compiler default output... a.out > checking whether the C compiler works... yes > checking whether we are cross compiling... no > checking for suffix of executables... > checking for suffix of object files... o > checking whether we are using the GNU C compiler... yes > checking whether gcc accepts -g... yes > checking for gcc option to accept ANSI C... none needed > checking for ld used by GCC... /usr/bin/ld > checking if the linker (/usr/bin/ld) is GNU ld... yes > checking for /usr/bin/ld option to reload object files... -r > checking for BSD-compatible nm... /usr/bin/nm -B > checking for a sed that does not truncate output... /bin/sed > checking whether ln -s works... yes > checking how to recognise dependent libraries... pass_all > checking command to parse /usr/bin/nm -B output... ok > checking how to run the C preprocessor... gcc -E > checking for egrep... grep -E > checking for ANSI C header files... yes > checking for sys/types.h... yes > checking for sys/stat.h... yes > checking for stdlib.h... yes > checking for string.h... yes > checking for memory.h... yes > checking for strings.h... yes > checking for inttypes.h... yes > checking for stdint.h... yes > checking for unistd.h... yes > checking dlfcn.h usability... yes > checking dlfcn.h presence... yes > checking for dlfcn.h... yes > checking for ranlib... ranlib > checking for strip... strip > checking for objdir... .libs > checking for gcc option to produce PIC... -fPIC > checking if gcc PIC flag -fPIC works... yes > checking if gcc static flag -static works... yes > checking if gcc supports -c -o file.o... yes > checking if gcc supports -c -o file.lo... yes > checking if gcc supports -fno-rtti -fno-exceptions... yes > checking whether the linker (/usr/bin/ld) supports shared libraries... yes > checking how to hardcode library paths into programs... immediate > checking whether stripping libraries is possible... yes > checking dynamic linker characteristics... GNU/Linux ld.so > checking if libtool supports shared libraries... yes > checking whether to build shared libraries... yes > checking whether to build static libraries... no > checking whether -lc should be explicitly linked in... no > creating libtool > checking for a BSD-compatible install... /usr/bin/install -c > checking whether build environment is sane... yes > checking for gawk... gawk > checking whether make sets $(MAKE)... yes > checking for style of include used by make... GNU > checking dependency style of gcc... none > checking fcntl.h usability... yes > checking fcntl.h presence... yes > checking for fcntl.h... yes > checking sys/fcntl.h usability... yes > checking sys/fcntl.h presence... yes > checking for sys/fcntl.h... yes > checking sys/file.h usability... yes > checking sys/file.h presence... yes > checking for sys/file.h... yes > checking sys/time.h usability... yes > checking sys/time.h presence... yes > checking for sys/time.h... yes > checking sys/signal.h usability... yes > checking sys/signal.h presence... yes > checking for sys/signal.h... yes > checking signal.h usability... yes > checking signal.h presence... yes > checking for signal.h.. . yes > checking termios.h usability... yes > checking termios.h presence... yes > checking for termios.h... yes > checking asm/termbits.h usability... yes > checking asm/termbits.h presence... yes > checking for asm/termbits.h... yes > checking grp.h usability... yes > checking grp.h presence... yes > checking for grp.h... yes > checking pwd.h usability... yes > checking pwd.h presence... yes > checking for pwd.h... yes > checking whether gcc needs -traditional... no > checking whether to enable maintainer-specific portions of Makefiles... no > /usr/java/jdk1.5.0_13 > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /usr/java/jdk1.5.0_13 > checking os.name Linux > checking os.arch i386 > checking java.vendor Sun Microsystems Inc. > checking java.version 1.5.0_13 > checking os.version 2.6.18-8.el5xen > comm.jar appears to be installed already. > conftest.c: In function 'main': > conftest.c:6: warning: incompatible implicit declaration of built-in > function 'printf' > conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:6: error: (Each undeclared identifier is reported only once > conftest.c:6: error: for each function it appears in.) > conftest.c:6: error: expected ')' before string constant This is an outdated kernel version check for when headers and kernels could cause problems for rxtx. If we made it past this, then you are OK. > conftest.c:7: warning: incompatible implicit declaration of built-in > function 'exit' > ./configure: line 9649: ./conftest: No such file or directory > ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected It blew up but continues.. > conftest.c: In function 'main': > conftest.c:5: warning: incompatible implicit declaration of built-in > function 'printf' > conftest.c:10: warning: incompatible implicit declaration of built-in > function 'exit' > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status : config.h is unchanged > config.status: executing depfiles commands > [root at smsgateway rxtx-2.0-7pre1]# make install > /usr/java/jdk1.5.0_13/bin/javac -classpath > .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d > /home/jboss/sources/rxtx- 2.0-7pre1/ -O > /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java > /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/UnSupportedLoggerException.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java > Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or > overrides a deprecated API. > Note: Recompile with -Xlint:deprecation for details. > /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* The java jar should be fine now. You may need to change the source files as mentioned below. > gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. > -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g > -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o > /home/jboss/sources/rxtx-2.0-7pre1/x86_64-unknown-linux-gnu/SerialImp.lo > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'init_threads': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: cast > from pointer to integer of different size > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_nativeDrain': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: cast to > pointer from integer of different size > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'read_byte_array': > /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: cast to > pointer from integer of different size As I recall, this was caused by pointers (now 64 bit rather than 32 bit) being stored in java ints (jints). I would look at the diff between the CVS 2.1 SerialImp.c and RXTXPort.java files against 2.0. We did fix those issues. You have a .so file but the different pointer sizes will cause runtime errors. > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_readArray': > /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: > comparison is always false due to limited range of data type > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_readTerminatedArray': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: > comparison is always false due to limited range of data type > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial- > 2.0.7pre1.* > gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so -o > .libs/librxtxSerial-2.0.7pre1.so > (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.0.7pre1.so > librxtxSerial.so) > creating librxtxSerial.la > (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la > librxtxSerial.la) > gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. > -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g > -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o > /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/ParallelImp.lo > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function > 'Java_javax_comm_LPRPort_readArray': > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: > comparison is always false due to limited range of data type > rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* > .libs/librxtxParallel-2.0.7pre1.* > gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so -o > .libs/librxtxParallel- 2.0.7pre1.so > (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.0.7pre1.so > librxtxParallel.so) > creating librxtxParallel.la > (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la > librxtxParallel.la) > make all-am > make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' > make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' > libtool: install: `x86_64-unknown-linux-gnu' must be an absolute directory > name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 A libtool change? Assuming you ran configure && make install in /home/jboss/sources/rxtx- 2.0-7pre1, libtool is looking for /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/.libs/librxtxSerial-2.0.7pre1.so. I think you have this? The file is just being copied to ~JAVA/jre/lib/$(JAVA_ARCH). -- Trent Jarvi tjarvi at qbang.org From sarah_662005 at yahoo.com Mon Nov 12 16:10:28 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Mon, 12 Nov 2007 15:10:28 -0800 (PST) Subject: [Rxtx] [urgent] device's power off detection Message-ID: <766782.10076.qm@web55803.mail.re3.yahoo.com> Hello all, I have a small application built on top of rxtx api. This application can retrieve the incoming data from a device through a port. The device can be powered off after the port get closed from the application. I have been trying a couple of hours to find a way to detect the power switching from device. If anyone knows how to handle it through rxtx, could you please give me a help? Thank you very much. r, Sara ____________________________________________________________________________________ Get easy, one-click access to your favorites. Make Yahoo! your homepage. http://www.yahoo.com/r/hs -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071112/4599f3ec/attachment-0021.html From netbeans at gatworks.com Mon Nov 12 17:52:22 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 12 Nov 2007 19:52:22 -0500 Subject: [Rxtx] [urgent] device's power off detection In-Reply-To: <766782.10076.qm@web55803.mail.re3.yahoo.com> References: <766782.10076.qm@web55803.mail.re3.yahoo.com> Message-ID: <4738F546.5010101@gatworks.com> Not sure what u are asking for. Are u asking for a way to detect if the device is OFF? Are u asking how to power off the device - via software ? Is it a Serial device? is it a parallel device? is it a usb device? Sara Hugh wrote: > Hello all, > I have a small application built on top of rxtx api. This application > can retrieve the incoming data from a device through a port. The device > can be powered off after the port get closed from the application. I > have been trying a couple of hours to find a way to detect the power > switching from device. If anyone knows how to handle it through rxtx, > could you please give me a help? Thank you very much. From tjarvi at qbang.org Mon Nov 12 22:48:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Nov 2007 22:48:11 -0700 (MST) Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711120225x562db8cbxb750767ade3b0d73@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> <900c6ba90711120031p66edc001ted76f7ba24e34b98@mail.gmail.com> <900c6ba90711120225x562db8cbxb750767ade3b0d73@mail.gmail.com> Message-ID: Hi Tim, The gnu.io namespace looks just like the javax.comm 2.0 namespace. There are additional (discouraged) undocumented methods in gnu.io that you need not use. We just used the different namespace to avoid poluting Sun's by mistake and to make sure we stayed off any potential licensing related radar. Usuaully, you just change your imports and make sure you do not use the javax.comm namespace for anything like exception handling. As I mentioned off the list, there are no issues with rxtx going through the JSR process to be more Sun friendly other than time. rxtx has no hidden intentions there; anything that does not work like CommAPI 2.0 documented is a bug. The reason we do not support CommAPI 2.1 is technical in nature and is in the list archives as well as the front page of www.rxtx.org. On Mon, 12 Nov 2007, Timothy Low wrote: > Hi Trent, > > I'll move to use a JDK1.5 64-bit version... but do I need to make any source > code changes to use the package (gnu.io) in the RTXTcomm.jar instead of the > ones from the javacomm api ? > > > Regards, > Tim > > On Nov 12, 2007 5:22 PM, Trent Jarvi wrote: > >> >> Hi Tim, >> >> I see a couple things here. >> >> First your jdk is for i686 yet the library is compiled on a x86_64 >> machine. You may try passing configure the --target=i686-unknown-linux to >> try using the i686 backend to gcc if it is available. Or move to the 64 >> bit jdk. >> >> The other error I see is again the moved UTF_RELEASE define that we need >> to fix. You can probably get around that with: >> >> make -DUTF_RELEASE=`uname -r` >> >> even more simple would be to just specify the serial library which should >> be in configure --help. >> >> You can remove the UTF_RELEASE check from configure by editing >> configure.in, searching for the simple C program check and deleting it. >> Running autoconf after that will regenerate a new configure without the >> check. >> >> Note that you should remove the previous native libraries >> (librxtxSerial.so) when moving from rxtx 2.0 to 2.1. These are compiled >> for different namespaces (javax.comm/gnu.io). >> >> On Mon, 12 Nov 2007, Timothy Low wrote: >> >>> *Hi Trent, >>> >>> I moved on to rxtx 2.1.7r2, and updated my jre to 1.6.0 (64-bit)... I >> tried >>> the following 2 methods: >>> >>> (1) using the rxtx 2.1.7 binaries from the RXTX website* >>> *Are these binaries suitable for a 64-bit OS ? There mentioning of the >>> gnu.io that you've talked about previously...* >>> ------ >>> [root at smsgateway sources]# java -Djava.library.path=/usr/lib PortLister >>> Experimental: JNI_OnLoad called. >>> >>> java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion >>> ()Ljava/lang/String; >>> at gnu.io.RXTXCommDriver.nativeGetVersion(Native Method) >>> at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:85) >>> at java.lang.Class.forName0(Native Method) >>> at java.lang.Class.forName(Unknown Source) >>> at javax.comm.CommPortIdentifier.loadDriver( >> CommPortIdentifier.java >>> :237) >>> at javax.comm.CommPortIdentifier.(CommPortIdentifier.java >>> :109) >>> at PortLister.(PortLister.java:6) >>> at PortLister.main(PortLister.java:25) >>> Exception in thread "main" java.lang.UnsatisfiedLinkError: >>> com.sun.comm.SunrayInfo.isSessionActive()Z >>> at com.sun.comm.SunrayInfo.isSessionActive(Native Method) >>> at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java >> :155) >>> at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java >>> :100) >>> at javax.comm.CommPortIdentifier.(CommPortIdentifier.java >>> :138) >>> at PortLister.(PortLister.java:6) >>> at PortLister.main(PortLister.java:25) >>> >>> ------ >>> >>> (2) compiling the rxtx 2.1.7 from source >>> *but i got the following error while running ./configure and make all* >>> >>> ------ >>> [root at smsgateway rxtx-2.1-7r2]# ./configure >>> checking build system type... x86_64-unknown-linux-gnu >>> checking host system type... x86_64-unknown-linux-gnu >>> checking target system type... x86_64-unknown-linux-gnu >>> configure: WARNING: Trying libtool. If the following fails install >> libtool >>> checking for gcc... gcc >>> checking for C compiler default output file name... a.out >>> checking whether the C compiler works... yes >>> checking whether we are cross compiling... no >>> checking for suffix of executables... >>> checking for suffix of object files... o >>> checking whether we are using the GNU C compiler... yes >>> checking whether gcc accepts -g... yes >>> checking for gcc option to accept ANSI C... none needed >>> checking for a sed that does not truncate output... /bin/sed >>> checking for egrep... grep -E >>> checking for ld used by gcc... /usr/bin/ld >>> checking if the linker (/usr/bin/ld) is GNU ld... yes >>> checking for /usr/bin/ld option to reload object files... -r >>> checking for BSD-compatible nm... /usr/bin/nm -B >>> checking whether ln -s works... yes >>> checking how to recognise dependent libraries... pass_all >>> checking how to run the C preprocessor... gcc -E >>> checking for ANSI C header files... yes >>> checking for sys/types.h... yes >>> checking for sys/stat.h... yes >>> checking for stdlib.h... yes >>> checking for string.h... yes >>> checking for memory.h... yes >>> checking for strings.h... yes >>> checking for inttypes.h... yes >>> checking for stdint.h... yes >>> checking for unistd.h... yes >>> checking dlfcn.h usability... yes >>> checking dlfcn.h presence... yes >>> checking for dlfcn.h... yes >>> checking for g++... g++ >>> checking whether we are using the GNU C++ compiler... yes >>> checking whether g++ accepts -g... yes >>> checking how to run the C++ preprocessor... g++ -E >>> checking for g77... no >>> checking for f77... no >>> checking for xlf... no >>> checking for frt... no >>> checking for pgf77... no >>> checking for fort77... no >>> checking for fl32... no >>> checking for af77... no >>> checking for f90... no >>> checking for xlf90... no >>> checking for pgf90... no >>> checking for epcf90... no >>> checking for f95... f95 >>> checking whether we are using the GNU Fortran 77 compiler... yes >>> checking whether f95 accepts -g... yes >>> checking the maximum length of command line arguments... 32768 >>> checking command to parse /usr/bin/nm -B output from gcc object... ok >>> checking for objdir... .libs >>> checking for ar... ar >>> checking for ranlib... ranlib >>> checking for strip... strip >>> checking if gcc static flag works... yes >>> checking if gcc supports -fno-rtti -fno-exceptions... no >>> checking for gcc option to produce PIC... -fPIC >>> checking if gcc PIC flag -fPIC works... yes >>> checking if gcc supports -c -o file.o... yes >>> checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking whether -lc should be explicitly linked in... no >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> checking if libtool supports shared libraries... yes >>> checking whether to build shared libraries... yes >>> checking whether to build static libraries... no >>> configure: creating libtool >>> appending configuration tag "CXX" to libtool >>> checking for ld used by g++... /usr/bin/ld -m elf_x86_64 >>> checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes >>> checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking for g++ option to produce PIC... -fPIC >>> checking if g++ PIC flag -fPIC works... yes >>> checking if g++ supports -c -o file.o... yes >>> checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> appending configuration tag "F77" to libtool >>> checking if libtool supports shared libraries... yes >>> checking whether to build shared libraries... yes >>> checking whether to build static libraries... no >>> checking for f95 option to produce PIC... -fPIC >>> checking if f95 PIC flag -fPIC works... yes >>> checking if f95 supports -c -o file.o... yes >>> checking whether the f95 linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> checking for a BSD-compatible install... /usr/bin/install -c >>> checking whether build environment is sane... yes >>> checking for gawk... gawk >>> checking whether make sets $(MAKE)... yes >>> checking for style of include used by make... GNU >>> checking dependency style of gcc... none >>> checking dependency style of g++... none >>> checking fcntl.h usability... yes >>> checking fcntl.h presence... yes >>> checking for fcntl.h... yes >>> checking sys/fcntl.h usability... yes >>> checking sys/fcntl.h presence... yes >>> checking for sys/fcntl.h... yes >>> checking sys/file.h usability... yes >>> checking sys/file.h presence... yes >>> checking for sys/file.h... yes >>> checking sys/time.h usability... yes >>> checking sys/time.h presence... yes >>> checking for sys/time.h... yes >>> checking sys/signal.h usability... yes >>> checking sys/signal.h presence... yes >>> checking for sys/signal.h... yes >>> checking signal.h usability... yes >>> checking signal.h presence... yes >>> checking for signal.h... yes >>> checking termios.h usability... yes >>> checking termios.h presence... yes >>> checking for termios.h... yes >>> checking grp.h usability... yes >>> checking grp.h presence... yes >>> checking for grp.h... yes >>> checking pwd.h usability... yes >>> checking pwd.h presence... yes >>> checking for pwd.h... yes >>> checking whether gcc needs -traditional... no >>> checking whether to enable maintainer-specific portions of Makefiles... >> no >>> /usr/java/jdk1.5.0_13 >>> configure: WARNING: using JAVA_HOME environmental variable >>> adjusted java.home is /usr/java/jdk1.5.0_13 >>> checking os.name Linux >>> checking os.arch i386 >>> checking java.vendor Sun Microsystems Inc. >>> checking java.version 1.5.0_13 >>> checking os.version 2.6.18-8.el5xen >>> conftest.c: In function 'main': >>> conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this >> function) >>> conftest.c:8: error: (Each undeclared identifier is reported only once >>> conftest.c:8: error: for each function it appears in.) >>> conftest.c:8: error: expected ')' before string constant >>> ./configure: line 21462: ./conftest: No such file or directory >>> ./configure: line 21462: test: 2.6.18-8.el5xen: unary operator expected >>> configure: creating ./config.status >>> config.status: creating Makefile >>> config.status: creating config.h >>> config.status: executing depfiles commands >>> [root at smsgateway rxtx-2.1-7r2]# make install >>> /usr/java/jdk1.5.0_13/bin/javac -classpath .:/home/jboss/sources/rxtx- >>> >> 2.1-7r2:/home/jboss/sources/rxtx-2.1-7r2/src:/usr/java/jdk1.5.0_13/jre/lib/ext/RXTXcomm.jar-d >>> /home/jboss/sources/rxtx- >>> 2.1-7r2/ -O -source 1.3 -target 1.3 >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommDriver.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortEnumerator.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortIdentifier.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortOwnershipListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Configure.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2C.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/I2CPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/LPRPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/NoSuchPortException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/PortInUseException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Raw.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/RawPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RawPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RawPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/RS485PortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485PortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485Port.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXCommDriver.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXVersion.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPort.java >>> /home/jboss/sources/rxtx-2.1-7r2 >> /./src/UnsupportedCommOperationException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/UnSupportedLoggerException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Zystem.java >>> /usr/java/jdk1.5.0_13/bin/javah -classpath .:/home/jboss/sources/rxtx- >>> >> 2.1-7r2:/home/jboss/sources/rxtx-2.1-7r2/src:/usr/java/jdk1.5.0_13/jre/lib/ext/RXTXcomm.jar-d >>> x86_64-unknown-linux-gnu -jni `(for i in CommDriver CommPortEnumerator >>> CommPortIdentifier CommPort CommPortOwnershipListener Configure I2C >>> I2CPortEvent I2CPortEventListener I2CPort LPRPort NoSuchPortException >>> ParallelPortEvent ParallelPortEventListener ParallelPort >> PortInUseException >>> Raw RawPortEvent RawPortEventListener RawPort RS485 RS485PortEvent >>> RS485PortEventListener RS485Port RXTXCommDriver RXTXPort RXTXVersion >>> SerialPortEvent SerialPortEventListener SerialPort >>> UnsupportedCommOperationException UnSupportedLoggerException Zystem;do \ >>> if grep > /dev/null native.*\( /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/$i.java; then \ >>> echo gnu.io.$i; \ >>> fi; \ >>> done)` >>> /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialImp.c -o >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo; >>> \ >>> if [ "Serial" = "Serial" ]; >>> then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxSerial.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxSerial.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo; >> \ >>> fi; \ >>> ) >>> mkdir /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/.libs >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/SerialImp.o >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/fuserImp.o >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c: In function >> 'show_user': >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c:238: warning: cast >> from >>> pointer to integer of different size >>> gcc -shared /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/SerialImp.o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/fuserImp.o >>> -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7.so -o >> .libs/librxtxSerial- >>> 2.1-7.so >>> (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.1-7.so >>> librxtxSerial.so) >>> creating librxtxSerial.la >>> (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la >>> librxtxSerial.la) >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelImp.c -o >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/ParallelImp.lo; >>> \ >>> if [ "Parallel" = "Serial" ]; >>> then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxParallel.la -rpath >>> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/ParallelImp.lo >>> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxParallel.la -rpath >>> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/ParallelImp.lo; >>> \ >>> fi; \ >>> ) >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >>> /x86_64-unknown-linux-gnu/.libs/ParallelImp.o >>> gcc -shared /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/ParallelImp.o >>> -lpthread -Wl,-soname -Wl,librxtxParallel-2.1-7.so -o >>> .libs/librxtxParallel-2.1-7.so >>> (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.1-7.so >>> librxtxParallel.so) >>> creating librxtxParallel.la >>> (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la >>> librxtxParallel.la) >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo; >>> \ >>> if [ "I2C" = "Serial" ]; then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxI2C.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo >>> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxI2C.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo; >>> \ >>> fi; \ >>> ) >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/.libs/I2CImp.o >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c: In function >>> 'Java_gnu_io_I2CPort_Initialize': >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: 'UTS_RELEASE' >>> undeclared (first use in this function) >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: (Each >> undeclared >>> identifier is reported only once >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: for each >> function >>> it appears in.) >>> libtool: link: `/home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/I2CImp.lo' >>> is not a valid libtool object >>> make: *** [x86_64-unknown-linux-gnu/librxtxI2C.la] Error 1 >>> >>> ------ >>> >>> >>> >>> On Nov 12, 2007 4:02 PM, Trent Jarvi wrote: >>> >>>> On Mon, 12 Nov 2007, Timothy Low wrote: >>>>> >>>>> Hi Trent, >>>> >>>> Hi Tim, >>>> >>>> Comments are inline. As I mentioned off the list, rxtx 2.0 is on the >> edge >>>> of deprecation. We can get it working but this is not the path of >> least >>>> resistance for future work. >>>> >>>> You will probably need to bounce another round of questions off the >> list. >>>> The following is intended to isolate the problem. >>>> >>>>> >>>>> I tried building RXTX from source, and I got this error. >>>>> >>>>> >>>>> I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm >>>> trying >>>>> to get the necessary ".so" files to use for my serial port >> communication >>>>> through java. >>>>> My linux kernal information is: >>>>> >>>>> *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 >>>> x86_64 >>>>> x86_64 x86_64 GNU/Linux* >>>>> >>>>> I'll most glad if you can provide me some direction on this. Thanks ! >>>>> >>>>> ---------------- >>>>> [root at smsgateway rxtx-2.0-7pre1]# ./configure >>>>> checking build system type... x86_64-unknown-linux-gnu >>>>> checking host system type... x86_64-unknown-linux-gnu >>>>> checking target system type... x86_64-unknown-linux-gnu >>>>> configure: WARNING: Trying libtool. If the following fails install >>>> libtool >>>>> checking for gcc... gcc >>>>> checking for C compiler default output... a.out >>>>> checking whether the C compiler works... yes >>>>> checking whether we are cross compiling... no >>>>> checking for suffix of executables... >>>>> checking for suffix of object files... o >>>>> checking whether we are using the GNU C compiler... yes >>>>> checking whether gcc accepts -g... yes >>>>> checking for gcc option to accept ANSI C... none needed >>>>> checking for ld used by GCC... /usr/bin/ld >>>>> checking if the linker (/usr/bin/ld) is GNU ld... yes >>>>> checking for /usr/bin/ld option to reload object files... -r >>>>> checking for BSD-compatible nm... /usr/bin/nm -B >>>>> checking for a sed that does not truncate output... /bin/sed >>>>> checking whether ln -s works... yes >>>>> checking how to recognise dependent libraries... pass_all >>>>> checking command to parse /usr/bin/nm -B output... ok >>>>> checking how to run the C preprocessor... gcc -E >>>>> checking for egrep... grep -E >>>>> checking for ANSI C header files... yes >>>>> checking for sys/types.h... yes >>>>> checking for sys/stat.h... yes >>>>> checking for stdlib.h... yes >>>>> checking for string.h... yes >>>>> checking for memory.h... yes >>>>> checking for strings.h... yes >>>>> checking for inttypes.h... yes >>>>> checking for stdint.h... yes >>>>> checking for unistd.h... yes >>>>> checking dlfcn.h usability... yes >>>>> checking dlfcn.h presence... yes >>>>> checking for dlfcn.h... yes >>>>> checking for ranlib... ranlib >>>>> checking for strip... strip >>>>> checking for objdir... .libs >>>>> checking for gcc option to produce PIC... -fPIC >>>>> checking if gcc PIC flag -fPIC works... yes >>>>> checking if gcc static flag -static works... yes >>>>> checking if gcc supports -c -o file.o... yes >>>>> checking if gcc supports -c -o file.lo... yes >>>>> checking if gcc supports -fno-rtti -fno-exceptions... yes >>>>> checking whether the linker (/usr/bin/ld) supports shared libraries... >>>> yes >>>>> checking how to hardcode library paths into programs... immediate >>>>> checking whether stripping libraries is possible... yes >>>>> checking dynamic linker characteristics... GNU/Linux ld.so >>>>> checking if libtool supports shared libraries... yes >>>>> checking whether to build shared libraries... yes >>>>> checking whether to build static libraries... no >>>>> checking whether -lc should be explicitly linked in... no >>>>> creating libtool >>>>> checking for a BSD-compatible install... /usr/bin/install -c >>>>> checking whether build environment is sane... yes >>>>> checking for gawk... gawk >>>>> checking whether make sets $(MAKE)... yes >>>>> checking for style of include used by make... GNU >>>>> checking dependency style of gcc... none >>>>> checking fcntl.h usability... yes >>>>> checking fcntl.h presence... yes >>>>> checking for fcntl.h... yes >>>>> checking sys/fcntl.h usability... yes >>>>> checking sys/fcntl.h presence... yes >>>>> checking for sys/fcntl.h... yes >>>>> checking sys/file.h usability... yes >>>>> checking sys/file.h presence... yes >>>>> checking for sys/file.h... yes >>>>> checking sys/time.h usability... yes >>>>> checking sys/time.h presence... yes >>>>> checking for sys/time.h... yes >>>>> checking sys/signal.h usability... yes >>>>> checking sys/signal.h presence... yes >>>>> checking for sys/signal.h... yes >>>>> checking signal.h usability... yes >>>>> checking signal.h presence... yes >>>>> checking for signal.h.. . yes >>>>> checking termios.h usability... yes >>>>> checking termios.h presence... yes >>>>> checking for termios.h... yes >>>>> checking asm/termbits.h usability... yes >>>>> checking asm/termbits.h presence... yes >>>>> checking for asm/termbits.h... yes >>>>> checking grp.h usability... yes >>>>> checking grp.h presence... yes >>>>> checking for grp.h... yes >>>>> checking pwd.h usability... yes >>>>> checking pwd.h presence... yes >>>>> checking for pwd.h... yes >>>>> checking whether gcc needs -traditional... no >>>>> checking whether to enable maintainer-specific portions of >> Makefiles... >>>> no >>>>> /usr/java/jdk1.5.0_13 >>>>> configure: WARNING: using JAVA_HOME environmental variable >>>>> adjusted java.home is /usr/java/jdk1.5.0_13 >>>>> checking os.name Linux >>>>> checking os.arch i386 >>>>> checking java.vendor Sun Microsystems Inc. >>>>> checking java.version 1.5.0_13 >>>>> checking os.version 2.6.18-8.el5xen >>>>> comm.jar appears to be installed already. >>>>> conftest.c: In function 'main': >>>>> conftest.c:6: warning: incompatible implicit declaration of built-in >>>>> function 'printf' >>>>> conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this >>>> function) >>>>> conftest.c:6: error: (Each undeclared identifier is reported only once >>>>> conftest.c:6: error: for each function it appears in.) >>>>> conftest.c:6: error: expected ')' before string constant >>>> >>>> >>>> This is an outdated kernel version check for when headers and kernels >>>> could cause problems for rxtx. If we made it past this, then you are >> OK. >>>> >>>> >>>>> conftest.c:7: warning: incompatible implicit declaration of built-in >>>>> function 'exit' >>>>> ./configure: line 9649: ./conftest: No such file or directory >>>>> ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected >>>> >>>> It blew up but continues.. >>>> >>>>> conftest.c: In function 'main': >>>>> conftest.c:5: warning: incompatible implicit declaration of built-in >>>>> function 'printf' >>>>> conftest.c:10: warning: incompatible implicit declaration of built-in >>>>> function 'exit' >>>>> configure: creating ./config.status >>>>> config.status: creating Makefile >>>>> config.status: creating config.h >>>>> config.status : config.h is unchanged >>>>> config.status: executing depfiles commands >>>>> [root at smsgateway rxtx-2.0-7pre1]# make install >>>>> /usr/java/jdk1.5.0_13/bin/javac -classpath >>>>> .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/ -O >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1 >> /./src/UnSupportedLoggerException.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java >>>>> Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or >>>>> overrides a deprecated API. >>>>> Note: Recompile with -Xlint:deprecation for details. >>>>> /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* >>>> >>>> >>>> The java jar should be fine now. You may need to change the source >> files >>>> as mentioned below. >>>> >>>>> gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu >> -I. >>>>> -I/usr/java/jdk1.5.0_13/include >> -I/usr/java/jdk1.5.0_13/include/./linux/ >>>> -g >>>>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o >>>>> /home/jboss/sources/rxtx-2.0-7pre1 >> /x86_64-unknown-linux-gnu/SerialImp.lo >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'init_threads': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: >>>> cast >>>>> from pointer to integer of different size >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_nativeDrain': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: >>>> cast to >>>>> pointer from integer of different size >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'read_byte_array': >>>>> /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: >>>> cast to >>>>> pointer from integer of different size >>>> >>>> >>>> As I recall, this was caused by pointers (now 64 bit rather than 32 >> bit) >>>> being stored in java ints (jints). I would look at the diff between >> the >>>> CVS 2.1 SerialImp.c and RXTXPort.java files against 2.0. We >>>> did fix those issues. >>>> >>>> You have a .so file but the different pointer sizes will cause runtime >>>> errors. >>>> >>>> >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_readArray': >>>>> /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: >>>>> comparison is always false due to limited range of data type >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_readTerminatedArray': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: >>>>> comparison is always false due to limited range of data type >>>>> mkdir .libs >>>>> rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* >> .libs/librxtxSerial- >>>>> 2.0.7pre1.* >>>>> gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so-o >>>>> .libs/librxtxSerial-2.0.7pre1.so >>>>> (cd .libs && rm -f librxtxSerial.so && ln -s >> librxtxSerial-2.0.7pre1.so >>>>> librxtxSerial.so) >>>>> creating librxtxSerial.la >>>>> (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la >>>>> librxtxSerial.la) >>>>> gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu >> -I. >>>>> -I/usr/java/jdk1.5.0_13/include >> -I/usr/java/jdk1.5.0_13/include/./linux/ >>>> -g >>>>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o >>>>> /home/jboss/sources/rxtx- 2.0-7pre1 >>>> /x86_64-unknown-linux-gnu/ParallelImp.lo >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function >>>>> 'Java_javax_comm_LPRPort_readArray': >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: >>>>> comparison is always false due to limited range of data type >>>>> rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* >>>>> .libs/librxtxParallel-2.0.7pre1.* >>>>> gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so-o >>>>> .libs/librxtxParallel- 2.0.7pre1.so >>>>> (cd .libs && rm -f librxtxParallel.so && ln -s >>>> librxtxParallel-2.0.7pre1.so >>>>> librxtxParallel.so) >>>>> creating librxtxParallel.la >>>>> (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la >>>>> librxtxParallel.la) >>>>> make all-am >>>>> make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' >>>>> make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' >>>>> libtool: install: `x86_64-unknown-linux-gnu' must be an absolute >>>> directory >>>>> name >>>>> Try `libtool --help --mode=install' for more information. >>>>> make: *** [install] Error 1 >>>> >>>> A libtool change? Assuming you ran configure && make install in >>>> /home/jboss/sources/rxtx- 2.0-7pre1, libtool is looking for >>>> /home/jboss/sources/rxtx- >>>> 2.0-7pre1/x86_64-unknown-linux-gnu/.libs/librxtxSerial-2.0.7pre1.so. >>>> >>>> I think you have this? The file is just being copied to >>>> ~JAVA/jre/lib/$(JAVA_ARCH). >>>> >>>> -- >>>> Trent Jarvi >>>> tjarvi at qbang.org >>>> >>> >> > From guido.vogt at celsi.ch Tue Nov 13 00:28:01 2007 From: guido.vogt at celsi.ch (Guido Vogt) Date: Tue, 13 Nov 2007 08:28:01 +0100 Subject: [Rxtx] RTS Line can't be set Message-ID: <47395201.1050400@celsi.ch> I'm working on an Windows XP /SP2 System. Version of RXTX: 2.1.7. The serial line is connected to a modem. As I can see, the RTS-Line of the serial Port is inactive, when the port is opened (flowcontrol=none). Obviously, no data is coming from the modem. If I use the setRTS(true) command after open, the comport does not send out my data any more. This behaviour is regardless of flowcontrol. Anybody has an idea what do do? Thanks for help. From Martin.Oberhuber at windriver.com Tue Nov 13 08:58:23 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 13 Nov 2007 16:58:23 +0100 Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803880918@ism-mail03.corp.ad.wrs.com> Hi Trent, as said before, I like the idea of discussing such quality engineering issues, but why hide these away from the rest of the public? Anyways, if you do want to create a new mailing list for these kinds of things I'll happily subscribe. 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: Sunday, November 11, 2007 1:46 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: RE: [Rxtx] Quality Engineering with rxtx > > On Mon, 5 Nov 2007, Oberhuber, Martin wrote: > > > Hi Trent, > > > > are the interestes of hobbyists really so different > > from commercial ones? Both should be interested in > > high quality and innovation the like. > > > > I haven't seen too many Open Source projects from the > > "inside" but those that I have seen did not have > > separate mailing lists for quality/testing/qa > > versus innovation/development. > > > > What I have seen with the Open Source projects that > > one would call "successful" is a good deal of > > process around automated builds, automated unit > > tests, predictable release dates and milestones, > > and policies around commiting/contributing/reviewing > > changes. > > > > I think that all of these benefit commercial users > > and hobbyists the like. > > > > If you were just asking about who's interested in > > discussing changes to foster more quality, count > > me in. I'm just not sure whether discussing these > > on a separate mailing list or other channel is the > > right thing to do. > > > > Hi Martin, > > There are two issues I'm thinking about. The first is the > generic unit > testing and quality initiatives required to move rxtx > forward. The second > is the inevitable fact that rxtx connects to external hardware. The > discussion deals with a different set of problems. > > Here is a simple example of what I'm getting at. > > We have the capability of setting custom baud rates in rxtx. > We may be > interested in seeing regressions in rxtx, the C library or > the kernel. > Some people may be doing some tests with loopback > connections. These will > always work even if the baud rate is not set to the expected > value. Some > people may use null modems between two ports. This may be > able to catch > the problem but not always. > > Will the build machines be able to test this? (no - for a few reasons) > Will people be trying to catch these type of regressions? (yes) > What type of coverage does the community have in the end? (?) > > We could include the discussions in the same list or another > equally open > list that may be of interest to some folks that deal with > these types of > problems on a regular basis. > > -- > Trent Jarvi > tjarvi at qbang.org > From toupsz at cs.tamu.edu Tue Nov 13 10:33:03 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 13 Nov 2007 11:33:03 -0600 Subject: [Rxtx] [urgent] device's power off detection In-Reply-To: <4738F546.5010101@gatworks.com> References: <766782.10076.qm@web55803.mail.re3.yahoo.com> <4738F546.5010101@gatworks.com> Message-ID: Lacking any other specification on it...but can you set up the device to notify your software when it turns off? Send a message or somesuch? Maybe it can signal using RTS or DTR? -Zach On Nov 12, 2007 6:52 PM, U. George wrote: > Not sure what u are asking for. Are u asking for a way to detect if the > device is OFF? Are u asking how to power off the device - via software ? > Is it a Serial device? > is it a parallel device? > is it a usb device? > > Sara Hugh wrote: > > Hello all, > > I have a small application built on top of rxtx api. This application > > can retrieve the incoming data from a device through a port. The device > > can be powered off after the port get closed from the application. I > > have been trying a couple of hours to find a way to detect the power > > switching from device. If anyone knows how to handle it through rxtx, > > could you please give me a help? Thank you very much. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071113/e5859e4d/attachment-0020.html From tjarvi at qbang.org Tue Nov 13 20:02:03 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 13 Nov 2007 20:02:03 -0700 (MST) Subject: [Rxtx] #ifndef TIOCSERGETLSR In-Reply-To: <472E3AAF.7050709@gatworks.com> References: <472E3AAF.7050709@gatworks.com> Message-ID: On Sun, 4 Nov 2007, U. George wrote: > For Linux, it seems that you need the code for both *having* a > TIOCSERGETLSR, and *not having* a TIOCSERGETLSR. Maybe the ioctl exists > system wide, but not necessarily for the device driver itself ( always > returns -1 ) . > > Are there systems that have a *functioning* TIOCSERGETLSR for all their > devices? Then this would be the case where the "#ifndef TIOCSERGETLSR" > directive could be useful is eliminating the unnecessary code and tests. > > And for those systems that dont have a TIOCSERGETLSR, then the code for > TIOCSERGETLSR can be eliminated. > > It would be a simple case to have, as a foundation, all the code to > simulate the missing TIOCSERGETLSR ioctl. If the system does have the > ioctl, then that code can be ifdef'd in, and co-exist with the > functionality of the code that simulates the missing TIOCSERGETLSR ioctl. > Ah, there is the post. Sorry I was on vacation. Hi George, Yes there are systems that have functioning TIOCSERGETLSR for all of their devices. These are machines that just use traditional UARTs. If you mean operating systems, then probably not. Let me explain a bit about the history of those #ifdefs to help clear up a mess. RXTX aims to follow POSIX. TIOCSERGETLSR turns out to not be POSIX at all as I understand. It isn't in BSD, Solaris, AIX or HP-UX. It certainly provides access to important information. I assumed it was standard when I coded rxtx on a Linux system. Ya, laugh. Then I looked at Win32.. Oh you are still laughing? ..I could not navigate msft's web site at the time [still can't really find anything today]. So google pointed me to someones 'reverse documentation' of the w32 API and an example msft put together back in the win3.0 days. It was enough but maybe not 100% correct. They covered overlapped IO which was important for events in rxtx. Looking at Win32 and Linux, it made sense to implement TIOCSERGETLSR for win32 with the way rxtx works. That was how things matched up. But when I got feedback about other systems, it didn't match up. When people used multiport cards with money saving designs in Linux, it didn't match up. And today, there are drivers for unusual serial ports that don't match up. Now we have some ugly logic that mostly works for most serial ports. It isn't right though. The important aspect of TIOSERGETLSR is knowing when the output is really gone. But POSIX tcdrain tells us the same thing. So there is logic in the ifdefs to match that up as you suggest. Perhaps a more formal solution along those lines would be worth looking into. I would suggest the roles should be switched though. We should use POSIX calls on all systems and hide things that don't work on everything like we have with other undocumented calls. TIOSERGETLSR is nice and would be great if it was standard. It isn't as far as I can tell. In the end, many people write Java code because they want portability. The TIOSERGETLSR does not really fit. In someways, this is limiting to the least common denominator which is Solaris if you have seen it's serial kernel driver code. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 15 09:10:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 15 Nov 2007 17:10:59 +0100 Subject: [Rxtx] RXTX blocking on unconnected virtual port Message-ID: <460801A4097E3D4CA04CC64EE648584803919080@ism-mail03.corp.ad.wrs.com> Hello, we came across the following issue: * Set up a virtual serial port, e.g. with com0com: http://com0com.sourceforge.net/ * Connect RXTX to one end, e.g. cnc1a * Do not connect the other end, e.g. cnc1b * Have RXTX write data to the port --> Since the data is not being read, RXTX blocks - RXTXPort.SerialOutputStream.write increases the RXTXPort.IOLocked variable - it then calls the native writeByte or writeArray method (which blocks) closing the RXTXPort hangs for ever too: - RXTXPort.close() has a while( IOLocked > 0 ) {..Thread.sleep(500);...} which spins for ever ==> once the communication hangs, it cannot recover. Has anybody else seen such a problem before, or even got an idea how to solve it? When I connect Hyperterminal to the same half-open port, and type a character, it hangs for about 3 seconds but then times out and is available again. I guess that's what I'd like to see in RXTX as well, with a (configurable) timeout. Our big problem with the current situation is that once RXTX gets stuck, there is nothing at all we can do to make it go live again - that's why our original workaround of writing to the port in a background thread is not good enough. For more background information, the issue is being tracked in https://bugs.eclipse.org/bugs/show_bug.cgi?id=208185 Thanks for any hints or ideas, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Sun Nov 18 09:43:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 09:43:26 -0700 (MST) Subject: [Rxtx] PortInUseException - Cannot close and reopen serial port In-Reply-To: <460801A4097E3D4CA04CC64EE64858480351C711@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858480351C711@ism-mail03.corp.ad.wrs.com> Message-ID: These have been submitted to CVS and the bugzilla entries have been changed to reflect the changes. ChangeLog: find ports which were added after program startup on Mac OS X. Martin Oberhuber http://bugzilla.qbang.org/show_bug.cgi?id=48 Clean up CommPort Ownership code, avoid possible deadlocks, fix lost commport ownership events. http://bugzilla.qbang.org/show_bug.cgi?id=83 Martin Oberhuber On Wed, 24 Oct 2007, Oberhuber, Martin wrote: > 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) > > > > > > > > > > > > > > > From tjarvi at qbang.org Sun Nov 18 09:45:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 09:45:39 -0700 (MST) Subject: [Rxtx] PortInUseException - Cannot close and reopen serial port In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848020CAF26@ism-mail03.corp.ad.wrs.com> Message-ID: The current CVS code should have all the entries. With version information, I usually do not change the version until we tag and release a zip file. Any feedback would be appreciated. On Wed, 27 Jun 2007, Greg Johnson wrote: > 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) >> >> >> >> >> > From tjarvi at qbang.org Sun Nov 18 13:51:27 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 13:51:27 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs Message-ID: The following bugs have been closed and CVS updated as needed: CommPortIdentifier.getPortIdentifier throws NoSuchPortException http://bugzilla.qbang.org/show_bug.cgi?id=48 CommPortOwnership events not sent http://bugzilla.qbang.org/show_bug.cgi?id=83 JVM 1.6 builds http://bugzilla.qbang.org/show_bug.cgi?id=84 I'd like to give Martin Oberhuber CVS write access. He has been doing a great job of pushing safe patches into rxtx. I'll be preparing seperate patches for the changes I have and submitting them to the list. I'll need to work with George to do a couple things: 1) break the patch into smaller pieces to isolate issues for discussion. 2) work through the Line Status Register changes so it does not cause problems on other systems. George: If you could do the first one, it would be greatly appreciated. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Nov 18 15:33:36 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 15:33:36 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: Message-ID: I'm not running any tests at this point, I'm trying to apply the small safe patches and make sure everything is compiling. As mentioned at the bottom, there are 3 patches + the USB fix posted here that need more review before accepting. The following bugs have been closed and CVS updated as needed. Most of these are already in CVS. The diff will be small. configure script failed at line UTS_RELEASE megov http://bugzilla.qbang.org/show_bug.cgi?id=80 code cleanup patch (extra ';' creates bug for if statements + new String() calls removed) Xavier Le Vourch http://bugzilla.qbang.org/show_bug.cgi?id=77 Wont compile on linux ppc with glibc 2.5 - no sys/io.h Brian Johnson http://bugzilla.qbang.org/show_bug.cgi?id=72 rxtx overwrites System properties Andrew Gillett Nektarios K. Papadopoulos Neboj??a http://bugzilla.qbang.org/show_bug.cgi?id=64 Solaris ACM port support Dave Cleal http://bugzilla.qbang.org/show_bug.cgi?id=59 Setting of non-standard baud rate fails. Andrew Prunicki http://bugzilla.qbang.org/show_bug.cgi?id=58 RXTX uses lockfiles on MacOS X (instead of ioctl TIOCEXCL) Joachim Buechse http://bugzilla.qbang.org/show_bug.cgi?id=50 JavaDoc fixes Joachim Buechse http://bugzilla.qbang.org/show_bug.cgi?id=49 I need to further review the following: http://bugzilla.qbang.org/show_bug.cgi?id=53 http://bugzilla.qbang.org/show_bug.cgi?id=46 http://bugzilla.qbang.org/show_bug.cgi?id=41 On Sun, 18 Nov 2007, Trent Jarvi wrote: > > The following bugs have been closed and CVS updated as needed: > > CommPortIdentifier.getPortIdentifier throws NoSuchPortException > http://bugzilla.qbang.org/show_bug.cgi?id=48 > CommPortOwnership events not sent > http://bugzilla.qbang.org/show_bug.cgi?id=83 > JVM 1.6 builds > http://bugzilla.qbang.org/show_bug.cgi?id=84 > > I'd like to give Martin Oberhuber CVS write access. He has been doing a > great job of pushing safe patches into rxtx. > > I'll be preparing seperate patches for the changes I have and submitting > them to the list. > > I'll need to work with George to do a couple things: > > 1) break the patch into smaller pieces to isolate issues for discussion. > 2) work through the Line Status Register changes so it does not cause > problems on other systems. > > George: If you could do the first one, it would be greatly appreciated. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From netbeans at gatworks.com Sun Nov 18 16:20:02 2007 From: netbeans at gatworks.com (U. George) Date: Sun, 18 Nov 2007 18:20:02 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: Message-ID: <4740C8A2.6030908@gatworks.com> > I'll need to work with George to do a couple things: > > 1) break the patch into smaller pieces to isolate issues for discussion. > 2) work through the Line Status Register changes so it does not cause > problems on other systems. > > George: If you could do the first one, it would be greatly appreciated. there are ( probably ) 3 pieces: 1) the select() failure when the USB-serial device is unceremoniously unplugged ( causes rxtx to spin ) 2) TIOCSERGETLSR, need to have the simulation of it available for all os's . If the system has the capability, don't simulate for devices that have the capability. For devices that dont have the capability, but the OS still defines TIOCSERGETLSR, fall back to simulation. 3) I rearranged DEBUG ifdef's. This is probably the bulk of the patches. From tjarvi at qbang.org Sun Nov 18 18:26:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 18:26:26 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <4740C8A2.6030908@gatworks.com> References: <4740C8A2.6030908@gatworks.com> Message-ID: On Sun, 18 Nov 2007, U. George wrote: > >> I'll need to work with George to do a couple things: >> >> 1) break the patch into smaller pieces to isolate issues for discussion. >> 2) work through the Line Status Register changes so it does not cause >> problems on other systems. >> >> George: If you could do the first one, it would be greatly appreciated. > > there are ( probably ) 3 pieces: > 1) the select() failure when the USB-serial device is unceremoniously > unplugged ( causes rxtx to spin ) > 2) TIOCSERGETLSR, need to have the simulation of it available for all os's . > If the system has the capability, don't simulate for devices that have the > capability. For devices that dont have the capability, but the OS still > defines TIOCSERGETLSR, fall back to simulation. > 3) I rearranged DEBUG ifdef's. This is probably the bulk of the patches. > Hi George, I suspect if you do cvs update, there will be very few conflicts if any. While the list of fixes is fairly long, the changes are small. -- Trent Jarvi tjarvi at qbang.org From EdwardRF at xtremax.com Mon Nov 19 03:32:29 2007 From: EdwardRF at xtremax.com (Edward) Date: Mon, 19 Nov 2007 18:32:29 +0800 Subject: [Rxtx] Cannot Read under Windows XP Message-ID: <4741663D.4070200@xtremax.com> Hi Guys, I have a iTegno 3000 usb GSM modem, it is an usb-serial device. I am trying to use RXTX with it under Windows XP. The problem is it seems RXTX cannot read any data from it, but writing to it seems successful. I blindly issue a series of command to send off a SMS, it is successfully delivered, but neither the echo from the modem nor the "OK" response was received. I tried to connect to the modem directly using hyper terminal, there was no problem reading or writing. So can i assume it is not the driver problem? Then i turned to Serial Port Monitor for help, when I use hyper terminal, monitor shows both way traffic, and nothing abnormal, but when I connect using RXTX, only the data I sent to the modem is being detected, no input was detected. Does anyone else experience similar problem? Best Regards Edward From tjarvi at qbang.org Mon Nov 19 03:38:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Nov 2007 03:38:02 -0700 (MST) Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: <4741663D.4070200@xtremax.com> References: <4741663D.4070200@xtremax.com> Message-ID: On Mon, 19 Nov 2007, Edward wrote: > Hi Guys, > > I have a iTegno 3000 usb GSM modem, it is an usb-serial device. I am > trying to use RXTX with it under Windows XP. > The problem is it seems RXTX cannot read any data from it, but writing > to it seems successful. I blindly issue a series of command to send off > a SMS, it is successfully delivered, but neither the echo from the modem > nor the "OK" response was received. > > I tried to connect to the modem directly using hyper terminal, there was > no problem reading or writing. So can i assume it is not the driver problem? > > Then i turned to Serial Port Monitor for help, when I use hyper > terminal, monitor shows both way traffic, and nothing abnormal, but when > I connect using RXTX, only the data I sent to the modem is being > detected, no input was detected. > > Does anyone else experience similar problem? > Hi Edward, A common mistake is to send Strings to the modem which are i18n. You want to send the bytes. Examples of doing this are in the contrib directory with the sourcecode. ie SimpleSnuV1.java -- Trent Jarvi tjarvi at qbang.org From EdwardRF at xtremax.com Mon Nov 19 04:42:16 2007 From: EdwardRF at xtremax.com (Edward) Date: Mon, 19 Nov 2007 19:42:16 +0800 Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: References: <4741663D.4070200@xtremax.com> Message-ID: <47417698.3060705@xtremax.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071119/b0f08ba9/attachment-0015.html From netbeans at gatworks.com Mon Nov 19 06:31:30 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 19 Nov 2007 08:31:30 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: <4740C8A2.6030908@gatworks.com> Message-ID: <47419032.8080406@gatworks.com> Did the "make install". The install does not want to go to or use Makefiles's prefix = /usr/local/rxtx-devel Not terribly happy that it installed in /home/gat/JAVA/JDK14/j2sdk1.4.2_08/jre/lib/i386 Trent Jarvi wrote: > > I suspect if you do cvs update, there will be very few conflicts if any. > While the list of fixes is fairly long, the changes are small. > > -- > Trent Jarvi > tjarvi at qbang.org > > From Martin.Oberhuber at windriver.com Mon Nov 19 07:00:48 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 19 Nov 2007 15:00:48 +0100 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE6485848039986E6@ism-mail03.corp.ad.wrs.com> It's great to see things progressing - thanks Trent! I checked CVS, and it seems that most of the patch authors are yet missing from the AUTHORS file, is this intentional? The issues areound RXTXPort.close() are interesting for us in the context of Eclipse as well: https://bugs.eclipse.org/bugs/show_bug.cgi?id=208185#c3 I did a quick review and found some issues / comments: http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 http://bugzilla.qbang.org/show_bug.cgi?id=53#c9 Thanks for proposing CVS write access for me. I promise to use these thoughtfully, and discuss potential fixes openly (on bugzilla) before applying them [unless it's really trivial issues only like obvious Javadoc syntax or spelling errors]. Cheers, -- 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 Mon Nov 19 07:24:16 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 19 Nov 2007 15:24:16 +0100 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803998711@ism-mail03.corp.ad.wrs.com> Hi all, I think I've got a better version for RXTXCommDriver.checkSolaris(): http://bugzilla.qbang.org/show_bug.cgi?id=77#c3 Cheers, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From netbeans at gatworks.com Mon Nov 19 09:01:22 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 19 Nov 2007 11:01:22 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <47419032.8080406@gatworks.com> References: <4740C8A2.6030908@gatworks.com> <47419032.8080406@gatworks.com> Message-ID: <4741B352.8070205@gatworks.com> U. George wrote: > Did the "make install". The install does not want to go to or use > Makefiles's prefix = /usr/local/rxtx-devel > > Not terribly happy that it installed in > /home/gat/JAVA/JDK14/j2sdk1.4.2_08/jre/lib/i386 > Put libs and jar in MY preferential places. Ran application. And it loves to spin. Deja gnu all over again. :-/ It did find the avail /dev/ttyUSB0 port connected to LINUX usbserial/pl2303 device driver. Now to find the spin. and apply simpler set of patches From tjarvi at qbang.org Mon Nov 19 10:14:38 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Nov 2007 10:14:38 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <4741B352.8070205@gatworks.com> References: <4740C8A2.6030908@gatworks.com> <47419032.8080406@gatworks.com> <4741B352.8070205@gatworks.com> Message-ID: On Mon, 19 Nov 2007, U. George wrote: > U. George wrote: >> Did the "make install". The install does not want to go to or use >> Makefiles's prefix = /usr/local/rxtx-devel >> >> Not terribly happy that it installed in >> /home/gat/JAVA/JDK14/j2sdk1.4.2_08/jre/lib/i386 >> > Put libs and jar in MY preferential places. Ran application. And it loves to > spin. Deja gnu all over again. :-/ > > It did find the avail /dev/ttyUSB0 port connected to LINUX usbserial/pl2303 > device driver. > > Now to find the spin. and apply simpler set of patches > Hi George, When the prefix code was stomped on and the library was installed in the jre, It wasnt clear how the layout would end up looking. I'm still not sure. My usual attack was to dump a jdk onto the filesystem, set JAVA_HOME and install. When I was done, I would nuke the jdk. Obviously that may not be what people want but I'm not sure a prefix is enough to let us know what they do want. For a shared library prefix /usr/local means the library goes in /usr/local/lib. What would it mean for the jar and shared library in Java? -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Nov 19 10:24:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Nov 2007 10:24:08 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <460801A4097E3D4CA04CC64EE6485848039986E6@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848039986E6@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 19 Nov 2007, Oberhuber, Martin wrote: > > I checked CVS, and it seems that most of the patch > authors are yet missing from the AUTHORS file, > is this intentional? > There isn't a hard rule covering who goes into AUTHORS. If I recognize a person from previous patches, I try to make sure they are in. Everyone contributing (authors) is in the ChangeLog with what they did going all the way back to the first release. AUTHORS is more of a summary of what they did after a few submissions. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Nov 19 11:39:51 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 19 Nov 2007 13:39:51 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: <4740C8A2.6030908@gatworks.com> <47419032.8080406@gatworks.com> <4741B352.8070205@gatworks.com> Message-ID: <4741D877.80203@gatworks.com> For me, the makefile/prefix = /usr/local sorta suggest thats where the libs/bins/jars/... should eventually wind up. If a user does not like /usr/local, then a quick change would put it somewhere else. At this moment I dont care where the jar winds up ( in lib, or a jar directory ). So I like to keep the jre/sdk directory protected from meddling, and changes. But if a user has a penchant to use 'java -jar', then the RXTXcomm.jar file should be stuffed with the other jre/sdk jar files. From ajmas at sympatico.ca Mon Nov 19 11:54:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 19 Nov 2007 13:54:29 -0500 Subject: [Rxtx] CVS updates and closed bugs Message-ID: <20071119185429.SPYK18413.tomts22-srv.bellnexxia.net@smtp1.sympatico.ca> On this day in November "U. George" wrote: > > For me, the makefile/prefix = /usr/local sorta suggest thats where the > libs/bins/jars/... should eventually wind up. > If a user does not like /usr/local, then a quick change would put it > somewhere else. At this moment I dont care where the jar winds up ( in > lib, or a jar directory ). > So I like to keep the jre/sdk directory protected from meddling, and > changes. > But if a user has a penchant to use 'java -jar', then the RXTXcomm.jar > file should be stuffed with the other jre/sdk jar files. It should be noted that some platforms, such as MacOS X might have different conventions. In the case of MacOS X there are two 'correct' places for Java libraries that aren't part of an application: - /Library/Java/Extensions/ - ~/Library/Java/Extensions/ Andre From ajmas at sympatico.ca Mon Nov 19 18:15:37 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 19 Nov 2007 20:15:37 -0500 Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: <47417698.3060705@xtremax.com> References: <4741663D.4070200@xtremax.com> <47417698.3060705@xtremax.com> Message-ID: <3D24B671-06CA-4709-AE3C-BCDB542F427F@sympatico.ca> On 19-Nov-07, at 06:42 , Edward wrote: > Hi Trent, > > First of all, I did sent them as bytes, eg, > > output.write("at\r\n".getBytes()); > > And if writing is every the problem, it wouldn't be able to explain > why i could send out a sms successfully using RXTX. > If you have the section of code that does the communicating, could you share it with us? This should help us tell whether it is a coding issue or something more fundamental with RXTX. Andre From EdwardRF at xtremax.com Mon Nov 19 19:39:36 2007 From: EdwardRF at xtremax.com (EdwardRF) Date: Tue, 20 Nov 2007 10:39:36 +0800 Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: <3D24B671-06CA-4709-AE3C-BCDB542F427F@sympatico.ca> References: <4741663D.4070200@xtremax.com> <47417698.3060705@xtremax.com> <3D24B671-06CA-4709-AE3C-BCDB542F427F@sympatico.ca> Message-ID: <474248E8.7070002@xtremax.com> Hi Guys, Thanks for the help, i've finally found out the problem. It was a flow control issue, i did not set the flow control properly. Btw, what is the default flow control behavior for rxtx2.1.7? was it the same as 2.0? Because i remember i did not need to set the flow control when I use rxtx 2.0 2 years back. Best Regards Edward Andre-John Mas wrote: > > On 19-Nov-07, at 06:42 , Edward wrote: > >> Hi Trent, >> >> First of all, I did sent them as bytes, eg, >> >> output.write("at\r\n".getBytes()); >> >> And if writing is every the problem, it wouldn't be able to explain >> why i could send out a sms successfully using RXTX. >> > > If you have the section of code that does the communicating, could you > share it with us? This should help us tell whether it is a coding > issue or something more fundamental with RXTX. > > Andre > From netbeans at gatworks.com Tue Nov 20 06:23:26 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 20 Nov 2007 08:23:26 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: <4740C8A2.6030908@gatworks.com> Message-ID: <4742DFCE.5070504@gatworks.com> Here is the small subset of diffs just for TIOCSERGETLSR :) Next I'll pull out the usb device, and see if that also causes rxtx to spin. >> 2) TIOCSERGETLSR, need to have the simulation of it available for all >> os's . If the system has the capability, don't simulate for devices >> that have the capability. For devices that dont have the capability, >> but the OS still defines TIOCSERGETLSR, fall back to simulation. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: a Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20071120/2c5c8ee7/attachment-0012.pl From tjarvi at qbang.org Tue Nov 20 08:20:21 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Nov 2007 08:20:21 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <4742DFCE.5070504@gatworks.com> References: <4740C8A2.6030908@gatworks.com> <4742DFCE.5070504@gatworks.com> Message-ID: On Tue, 20 Nov 2007, U. George wrote: > Here is the small subset of diffs just for TIOCSERGETLSR :) > > Next I'll pull out the usb device, and see if that also causes rxtx to spin. > >>> 2) TIOCSERGETLSR, need to have the simulation of it available for all os's >>> . If the system has the capability, don't simulate for devices that have >>> the capability. For devices that dont have the capability, but the OS >>> still defines TIOCSERGETLSR, fall back to simulation. > Hi George, I'll be looking through this patch in detail tonight. I just wanted to make sure you are aware of this line in win32termios.h. The ifdef logic is messy as you noticed. That is combined with the later addition of support for it to windows. #define TIOCSERGETLSR 0x5459 (this is by far the strangest code in rxtx in retrospect) I'll be able to do extensive automated testing once we get to that point. I'm confident we can get something in that has a low probability of causing regressions. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Tue Nov 20 08:42:08 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 20 Nov 2007 10:42:08 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: <4740C8A2.6030908@gatworks.com> <4742DFCE.5070504@gatworks.com> Message-ID: <47430050.1010203@gatworks.com> It is of no difference. 1) If the define does not exist, then it should be as before. 2) If it does exist, then it should also be as before. 3) If it does exist, but the ioctl fails, then it will fallback as if it did not exist in the first place. Trent Jarvi wrote: > On Tue, 20 Nov 2007, U. George wrote: > >> Here is the small subset of diffs just for TIOCSERGETLSR :) >> >> Next I'll pull out the usb device, and see if that also causes rxtx to >> spin. >> >>>> 2) TIOCSERGETLSR, need to have the simulation of it available for >>>> all os's . If the system has the capability, don't simulate for >>>> devices that have the capability. For devices that dont have the >>>> capability, but the OS still defines TIOCSERGETLSR, fall back to >>>> simulation. >> > > Hi George, > > I'll be looking through this patch in detail tonight. I just wanted to > make sure you are aware of this line in win32termios.h. The ifdef logic > is messy as you noticed. That is combined with the later addition of > support for it to windows. > > #define TIOCSERGETLSR 0x5459 > > (this is by far the strangest code in rxtx in retrospect) > > I'll be able to do extensive automated testing once we get to that > point. I'm confident we can get something in that has a low probability > of causing regressions. > > -- > Trent Jarvi > tjarvi at qbang.org > > From netbeans at gatworks.com Tue Nov 20 08:36:56 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 20 Nov 2007 10:36:56 -0500 Subject: [Rxtx] Unplugged Opened USB devices In-Reply-To: <4742DFCE.5070504@gatworks.com> References: <4740C8A2.6030908@gatworks.com> <4742DFCE.5070504@gatworks.com> Message-ID: <4742FF18.3050005@gatworks.com> > Next I'll pull out the usb device, and see if that also causes rxtx to > spin. This is the error on a read. The select() should have failed, as well as the read(). java.io.IOException: Input/output error in nativeavailable at gnu.io.RXTXPort.nativeavailable(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1420) at jGPS.GpsData.DeviceDrivers.SerialPort.SerialPort_NMEA_GNU.serialEvent (SerialPort_NMEA_GNU.java:449) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:771) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1622) But for java program, it sees( when USB device is unplugged ) : 1) event: SerialPortEvent.DATA_AVAILABLE 2) read (non-existant) data. I think that its bad form to say DATA_AVAILABLE, when there is no data to be obtained. There does not seem to be an I/O error event. So basically, I think, and IMHO, that no events should be sent. Rather a thread timeout ( ie no data in X seconds ) AND recovery from user code should be instantiated. From manujnaman at yahoo.com Wed Nov 21 12:35:46 2007 From: manujnaman at yahoo.com (manuj naman) Date: Wed, 21 Nov 2007 11:35:46 -0800 (PST) Subject: [Rxtx] Problem reading 1-wire device using RXTX on Linux Message-ID: <371969.66249.qm@web37911.mail.mud.yahoo.com> Hello, I am trying to use the RXTX library on Ubuntu (Debian) linux to read iButtons. It works perfectly on Windows. However on my linux machines it gives the following errors. I am using DS9490 (USB port adapter) to read the iButtons. I have followed your instructions on the Wiki. I recompiled the rxtx library to produce the .so and .jar files. But still it gives me this: manujnaman at sensor:~/iButton/onewireviewer$ java -cp $CLASSPATH:./OneWireAPI.jar:./OneWireViewer.jar OneWireViewer Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Warning: serial communications API not setup properly, no ports in enumeration Pure-Java DS9097U adapter will not work, not added to adapter enum Standard drivers for 1-Wire are not found. Please download the latest drivers from http://www.ibutton.com Or install RXTX Serial Communications API from http://www.rxtx.org Do you know how to solve the "Serial communications API not setup properly, no ports in enumeration" problem? Also, how to detect which what /dev/* is the port to be used? On Windows this is simply USB1, on linux this is a bit unclear. Many thanks for your advice, Manuj Naman Dallas, TX, US manujnaman at yahoo.com --------------------------------- Be a better pen pal. Text or chat with friends inside Yahoo! Mail. See how. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071121/2760f691/attachment-0011.html From Martin.Oberhuber at windriver.com Wed Nov 21 13:55:25 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 21 Nov 2007 21:55:25 +0100 Subject: [Rxtx] Should RXTX Lixense link to LGPL-2.1 be changed? In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803A21160@ism-mail03.corp.ad.wrs.com> Hi Trent and all, In all the RXTX source files as well as http://users.frii.com/jarvi/rxtx/license.html there is the following lines: | A copy of the LGPL v 2.1 may be found at | http://www.gnu.org/licenses/lgpl.txt on March 4th 2007. A copy is | here for your convenience. But, as of today, at the link provided there is only a copy of the LGPL v3.0. I think there should be a link to the LGPL v2.1, e.g. http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html What do you think? Cheers, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Nov 21 20:46:18 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Nov 2007 20:46:18 -0700 (MST) Subject: [Rxtx] Problem reading 1-wire device using RXTX on Linux In-Reply-To: <371969.66249.qm@web37911.mail.mud.yahoo.com> References: <371969.66249.qm@web37911.mail.mud.yahoo.com> Message-ID: On Wed, 21 Nov 2007, manuj naman wrote: > Hello, > > I am trying to use the RXTX library on Ubuntu (Debian) linux to read iButtons. It works perfectly on Windows. However on my linux machines it gives the following errors. I am using DS9490 (USB port adapter) to read the iButtons. > > I have followed your instructions on the Wiki. I recompiled the rxtx library to produce the .so and .jar files. But still it gives me this: > > manujnaman at sensor:~/iButton/onewireviewer$ java -cp $CLASSPATH:./OneWireAPI.jar:./OneWireViewer.jar OneWireViewer > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > Warning: serial communications API not setup properly, no ports in enumeration > Pure-Java DS9097U adapter will not work, not added to adapter enum > > Standard drivers for 1-Wire are not found. > Please download the latest drivers from http://www.ibutton.com > Or install RXTX Serial Communications API from http://www.rxtx.org > > Do you know how to solve the "Serial communications API not setup properly, no ports in enumeration" problem? > > Also, how to detect which what /dev/* is the port to be used? On Windows this is simply USB1, on linux this is a bit unclear. Hi Manuj What is the output of the following? dmesg |grep tty touch /var/lock/test.lock && rm -f /var/lock/test.lock If you see something like /dev/ttyUSB0 in the dmesg output, what happens if you do something like tail -f /dev/ttyUSB0? These test each of the usual suspects. We are looking for missing USB drivers, no permission to create a lockfile and no read permission for the device. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Nov 21 21:05:23 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Nov 2007 21:05:23 -0700 (MST) Subject: [Rxtx] Should RXTX Lixense link to LGPL-2.1 be changed? In-Reply-To: <460801A4097E3D4CA04CC64EE648584803A21160@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803A21160@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 21 Nov 2007, Oberhuber, Martin wrote: > Hi Trent and all, > > In all the RXTX source files as well as > http://users.frii.com/jarvi/rxtx/license.html > there is the following lines: > > | A copy of the LGPL v 2.1 may be found at > | http://www.gnu.org/licenses/lgpl.txt on March 4th 2007. A copy is > | here for your convenience. > > But, as of today, at the link provided there is only > a copy of the LGPL v3.0. I think there should be a link > to the LGPL v2.1, e.g. > http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html > > What do you think? > Hi Martin, Thanks. I updated the link. Changing licences is a heavy process for me as a free software developer and an employee so I'd rather stay with 2.1 unless the current license becomes a show stopper. I figured that would happen someday so I put the date in to be clear. -- Trent Jarvi tjarvi at qbang.org From beat.arnet at gmail.com Thu Nov 22 08:45:45 2007 From: beat.arnet at gmail.com (Beat Arnet) Date: Thu, 22 Nov 2007 10:45:45 -0500 Subject: [Rxtx] Dual Core Problem Message-ID: <4745A429.9060604@gmail.com> Dear All, I am struggling with an application that uses RXTX 2.1.7 and has been working reliably in the past. When this program runs on a dual-core DELL (Intel T2500), strange things happen with the RS232 communication. The application is missing incoming characters and also often freezes when trying to close the serial port. I highly suspect a threading problem and was wondering if a) anybody had run into a similar problem with dual core processors and b) if there is a list of does and dont's when it comes to RXTX and threads. Regards, Beat From tjarvi at qbang.org Thu Nov 22 13:22:43 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 22 Nov 2007 13:22:43 -0700 (MST) Subject: [Rxtx] Dual Core Problem In-Reply-To: <4745A429.9060604@gmail.com> References: <4745A429.9060604@gmail.com> Message-ID: On Thu, 22 Nov 2007, Beat Arnet wrote: > Dear All, > I am struggling with an application that uses RXTX 2.1.7 and has been > working reliably in the past. When this program runs on a dual-core DELL > (Intel T2500), strange things happen with the RS232 communication. The > application is missing incoming characters and also often freezes when > trying to close the serial port. I highly suspect a threading problem > and was wondering if a) anybody had run into a similar problem with dual > core processors and b) if there is a list of does and dont's when it > comes to RXTX and threads. > I've used rxtx with SMP systems but have not experimented very much with threading and rxtx. One red flag rxtx raises is it stores pointers to java objects in SerialImp.c. If the JVM decides to move things around, rxtx becomes confused. Missing incomming characters is usually caused by someone running two applications. They then fight over the incomming data. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Fri Nov 23 03:12:28 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 23 Nov 2007 11:12:28 +0100 Subject: [Rxtx] Dual Core Problem In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803A84C59@ism-mail03.corp.ad.wrs.com> > Missing incomming characters is usually caused by someone running two > applications. They then fight over the incomming data. I've seen exactly this scenario on Linux with Lockfiles disabled. Usually, port locking (through Lockfiles or Ioctl method) should avoid exactly this problem. I know that on Mac, port locking through Kernel/Ioctl method has been added for the upcoming RXTX 2.1-8. What's the status of this feature for Linux and other Unixes? Cheers, Martin From chris.paton at red61.com Fri Nov 23 05:26:10 2007 From: chris.paton at red61.com (Chris Paton) Date: Fri, 23 Nov 2007 12:26:10 +0000 Subject: [Rxtx] RXTX parallel port issues Message-ID: <4746C6E2.3000304@red61.com> Hi there, I've been happily using RXTX to communicate with a serial based point-of-sale printer for a several months. I've recently received a parallel based printer and have been trying to get RXTX to talk to this too. I've encountered a few problems along the way and just wanted to check if I'm doing anything wrong, or if I've found any bugs. Writing ------- Writing to the parallel port using ParallelPort.getOutputStream works well, except when I use OutputStream.write(byte[]) to write a multiple of 8 bytes (!). Doing this causes the JVM to crash with an EXCEPTION_PRIV_INSTRUCTION on Windows. I worked around this in my application by adding an additional byte if bytesToWrite % 8 == 0. I guess I could also have called write(byte) repeatedly. This also generated a SIGSEGV on Linux but I was unable to reproduce it today using the CVS version of RXTX and a recent kernel. Reading status pins ------------------- On Linux, I've found that ParallelPort.isPaperOut and ParallelPort.isPrinterSelected appear to be inverted; i.e. when the paper is out ParallelPort.isPaperOut returns false, and when there is paper ParallelPort.isPaperOut returns true! I've tested this in both Sun JDK5 and JDK6 on machines running Linux 2.6.21 and 2.6.23. Fortunately it's easy to use a conditional based on System.getProperty("os.name") to hack around this. Reading from InputStream ------------------------ I've had more serious issues trying to read from ParallelPort.getInputStream. On Windows, readByte seems to return -1 (end of stream) any time data isn't available. On Linux, I got a kernel oops, even with a recent 2.6.23.1 kernel. I was able to stop this using a kernel patch that I found via Google. Although this stopped the oops, I still get frequent IOExceptions when calling InputStream.readByte. It appears that instead of blocking, readByte throws an IOException with message "Resource temporarily unavailable in readByte" any time it is called when no data is available. Occasionally, I get an exception instead of the data I was expecting to read, e.g when asking my printer for a version string I get "VER: S3306 * 06.03* 10/*6/06" where the *s indicate that an exception occurred and data was missed. Any advice that anyone can offer would be much appreciated. If you need any more details or debugging information about any of these problems then let me know. Cheers -- Chris Paton Technical Developer Red61 -- Transaction Marketing Software http://www.red61.com -------------- next part -------------- A non-text attachment was scrubbed... Name: chris.paton.vcf Type: text/x-vcard Size: 230 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20071123/00a747b6/attachment-0020.vcf From chris.paton at red61.com Fri Nov 23 05:26:10 2007 From: chris.paton at red61.com (Chris Paton) Date: Fri, 23 Nov 2007 12:26:10 +0000 Subject: [Rxtx] RXTX parallel port issues Message-ID: <4746C6E2.3000304@red61.com> Hi there, I've been happily using RXTX to communicate with a serial based point-of-sale printer for a several months. I've recently received a parallel based printer and have been trying to get RXTX to talk to this too. I've encountered a few problems along the way and just wanted to check if I'm doing anything wrong, or if I've found any bugs. Writing ------- Writing to the parallel port using ParallelPort.getOutputStream works well, except when I use OutputStream.write(byte[]) to write a multiple of 8 bytes (!). Doing this causes the JVM to crash with an EXCEPTION_PRIV_INSTRUCTION on Windows. I worked around this in my application by adding an additional byte if bytesToWrite % 8 == 0. I guess I could also have called write(byte) repeatedly. This also generated a SIGSEGV on Linux but I was unable to reproduce it today using the CVS version of RXTX and a recent kernel. Reading status pins ------------------- On Linux, I've found that ParallelPort.isPaperOut and ParallelPort.isPrinterSelected appear to be inverted; i.e. when the paper is out ParallelPort.isPaperOut returns false, and when there is paper ParallelPort.isPaperOut returns true! I've tested this in both Sun JDK5 and JDK6 on machines running Linux 2.6.21 and 2.6.23. Fortunately it's easy to use a conditional based on System.getProperty("os.name") to hack around this. Reading from InputStream ------------------------ I've had more serious issues trying to read from ParallelPort.getInputStream. On Windows, readByte seems to return -1 (end of stream) any time data isn't available. On Linux, I got a kernel oops, even with a recent 2.6.23.1 kernel. I was able to stop this using a kernel patch that I found via Google. Although this stopped the oops, I still get frequent IOExceptions when calling InputStream.readByte. It appears that instead of blocking, readByte throws an IOException with message "Resource temporarily unavailable in readByte" any time it is called when no data is available. Occasionally, I get an exception instead of the data I was expecting to read, e.g when asking my printer for a version string I get "VER: S3306 * 06.03* 10/*6/06" where the *s indicate that an exception occurred and data was missed. Any advice that anyone can offer would be much appreciated. If you need any more details or debugging information about any of these problems then let me know. Cheers -- Chris Paton Technical Developer Red61 -- Transaction Marketing Software http://www.red61.com -------------- next part -------------- A non-text attachment was scrubbed... Name: chris.paton.vcf Type: text/x-vcard Size: 230 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20071123/00a747b6/attachment-0021.vcf From hho at bibliotheca.dk Fri Nov 23 06:45:36 2007 From: hho at bibliotheca.dk (Hans Hvelplund Odborg) Date: Fri, 23 Nov 2007 14:45:36 +0100 Subject: [Rxtx] RXTX parallel port issues In-Reply-To: <4746C6E2.3000304@red61.com> References: <4746C6E2.3000304@red61.com> Message-ID: <001201c82dd7$21c6e2c0$6a37a8c0@HANSLAPTOP> I've experienced similar crashes in JVM when writing to the parallel port in windows (with rxtx). Unfortunately I did not save the data sent to the parallel port so cannot say anything about the length. Furthermore, I recall having problems with .write(byte) (would never exit if I recall correctly), but I do not recall if this was with serial or parallel or both. In the end, we ended printing through Java's support of the windows driver. Unfortunately I currently don?t have the time to investigate these issues further. I just wanted to let you know that currently there are bugs in rxtx. Med venlig hilsen / Best regards / Med v?nliga h?lsningar Hans Hvelplund Odborg BIBLIOTHECA A/S Vallensb?kvej 20B ? 2605 Br?ndby ? Denmark Tel.: +45 70271008 Fax: +45 70271009 hho at bibliotheca.dk www.bibliotheca.dk -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Chris Paton Sent: 23. november 2007 13:26 To: rxtx at qbang.org Subject: [Rxtx] RXTX parallel port issues Hi there, I've been happily using RXTX to communicate with a serial based point-of-sale printer for a several months. I've recently received a parallel based printer and have been trying to get RXTX to talk to this too. I've encountered a few problems along the way and just wanted to check if I'm doing anything wrong, or if I've found any bugs. Writing ------- Writing to the parallel port using ParallelPort.getOutputStream works well, except when I use OutputStream.write(byte[]) to write a multiple of 8 bytes (!). Doing this causes the JVM to crash with an EXCEPTION_PRIV_INSTRUCTION on Windows. I worked around this in my application by adding an additional byte if bytesToWrite % 8 == 0. I guess I could also have called write(byte) repeatedly. This also generated a SIGSEGV on Linux but I was unable to reproduce it today using the CVS version of RXTX and a recent kernel. Reading status pins ------------------- On Linux, I've found that ParallelPort.isPaperOut and ParallelPort.isPrinterSelected appear to be inverted; i.e. when the paper is out ParallelPort.isPaperOut returns false, and when there is paper ParallelPort.isPaperOut returns true! I've tested this in both Sun JDK5 and JDK6 on machines running Linux 2.6.21 and 2.6.23. Fortunately it's easy to use a conditional based on System.getProperty("os.name") to hack around this. Reading from InputStream ------------------------ I've had more serious issues trying to read from ParallelPort.getInputStream. On Windows, readByte seems to return -1 (end of stream) any time data isn't available. On Linux, I got a kernel oops, even with a recent 2.6.23.1 kernel. I was able to stop this using a kernel patch that I found via Google. Although this stopped the oops, I still get frequent IOExceptions when calling InputStream.readByte. It appears that instead of blocking, readByte throws an IOException with message "Resource temporarily unavailable in readByte" any time it is called when no data is available. Occasionally, I get an exception instead of the data I was expecting to read, e.g when asking my printer for a version string I get "VER: S3306 * 06.03* 10/*6/06" where the *s indicate that an exception occurred and data was missed. Any advice that anyone can offer would be much appreciated. If you need any more details or debugging information about any of these problems then let me know. Cheers -- Chris Paton Technical Developer Red61 -- Transaction Marketing Software http://www.red61.com From tjarvi at qbang.org Fri Nov 23 16:28:23 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 23 Nov 2007 16:28:23 -0700 (MST) Subject: [Rxtx] RXTX parallel port issues In-Reply-To: <001201c82dd7$21c6e2c0$6a37a8c0@HANSLAPTOP> References: <4746C6E2.3000304@red61.com> <001201c82dd7$21c6e2c0$6a37a8c0@HANSLAPTOP> Message-ID: It would be good to create a bug report for this so others can either look into it or find the report to confirm their suspicions. Currently, there is only one parallel port bug report. http://bugzilla.qbang.org/show_bug.cgi?id=40 As we do update the reports when bugs are fixed, it gives people a chance to put themselves on the CC list and get notification of fixes they are interested in. On Fri, 23 Nov 2007, Hans Hvelplund Odborg wrote: > > I've experienced similar crashes in JVM when writing to the parallel port in > windows (with rxtx). > > Unfortunately I did not save the data sent to the parallel port so cannot > say anything about the length. > > Furthermore, I recall having problems with .write(byte) (would never exit if > I recall correctly), but I do not recall if this was with serial or parallel > or both. > > In the end, we ended printing through Java's support of the windows driver. > > Unfortunately I currently don?t have the time to investigate these issues > further. I just wanted to let you know that currently there are bugs in > rxtx. > > > Med venlig hilsen / Best regards / Med v?nliga h?lsningar > Hans Hvelplund Odborg > > BIBLIOTHECA A/S > Vallensb?kvej 20B ? 2605 Br?ndby ? Denmark > Tel.: +45 70271008 > Fax: +45 70271009 > hho at bibliotheca.dk > www.bibliotheca.dk > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Chris Paton > Sent: 23. november 2007 13:26 > To: rxtx at qbang.org > Subject: [Rxtx] RXTX parallel port issues > > Hi there, > > I've been happily using RXTX to communicate with a serial based > point-of-sale printer for a several months. I've recently received a > parallel based printer and have been trying to get RXTX to talk to this > too. I've encountered a few problems along the way and just wanted to > check if I'm doing anything wrong, or if I've found any bugs. > > Writing > ------- > Writing to the parallel port using ParallelPort.getOutputStream works > well, except when I use OutputStream.write(byte[]) to write a multiple > of 8 bytes (!). Doing this causes the JVM to crash with an > EXCEPTION_PRIV_INSTRUCTION on Windows. I worked around this in my > application by adding an additional byte if bytesToWrite % 8 == 0. I > guess I could also have called write(byte) repeatedly. > > This also generated a SIGSEGV on Linux but I was unable to reproduce it > today using the CVS version of RXTX and a recent kernel. > > Reading status pins > ------------------- > On Linux, I've found that ParallelPort.isPaperOut and > ParallelPort.isPrinterSelected appear to be inverted; i.e. when the > paper is out ParallelPort.isPaperOut returns false, and when there is > paper ParallelPort.isPaperOut returns true! I've tested this in both Sun > JDK5 and JDK6 on machines running Linux 2.6.21 and 2.6.23. Fortunately > it's easy to use a conditional based on System.getProperty("os.name") to > hack around this. > > Reading from InputStream > ------------------------ > > I've had more serious issues trying to read from > ParallelPort.getInputStream. On Windows, readByte seems to return -1 > (end of stream) any time data isn't available. > > On Linux, I got a kernel oops, even with a recent 2.6.23.1 > kernel. I was able to stop this using a kernel patch > > that I found via Google. Although this stopped the oops, I still get > frequent IOExceptions when calling InputStream.readByte. It appears that > instead of blocking, readByte throws an IOException with message > "Resource temporarily unavailable in readByte" any time it is called > when no data is available. Occasionally, I get an exception instead of > the data I was expecting to read, e.g when asking my printer for a > version string I get "VER: S3306 * 06.03* 10/*6/06" where the *s > indicate that an exception occurred and data was missed. > > > Any advice that anyone can offer would be much appreciated. If you need > any more details or debugging information about any of these problems > then let me know. > > Cheers > From manujnaman at yahoo.com Sun Nov 25 14:59:21 2007 From: manujnaman at yahoo.com (manuj naman) Date: Sun, 25 Nov 2007 13:59:21 -0800 (PST) Subject: [Rxtx] Problem reading 1-wire device using RXTX on Linux In-Reply-To: Message-ID: <104159.48942.qm@web37909.mail.mud.yahoo.com> Trent, dmesg | grep tty gives nothing. however, greping for usb does. The output for that is below. touch /var/lock/test.lock file does not exist, the directory does exits though. tail -f /dev/ttyUSB0 gives nothing simply because ttyUSB0 does not exist. Seems as if USB ports are not there... however, numerous /dev/tty* exist starting from /dev/tty, /dev/tty0, /dev/tty1... to ... /dev/ttyzf. The result of dmesg | grep usb is as follows: [17179576.220000] usbcore: registered new driver usbfs [17179576.220000] usbcore: registered new driver hub [17179576.572000] usb 1-1: new low speed USB device using uhci_hcd and address 2 [17179576.992000] usb 2-1: new full speed USB device using uhci_hcd and address 2 [17179577.132000] usbcore: registered new driver hiddev [17179577.188000] input: USB HID v1.11 Mouse [Microsoft Microsoft Wireless Optical Mouse� 1.00] on usb-0000:00:1f.2-1 [17179577.188000] usbcore: registered new driver usbhid [17179577.188000] drivers/usb/input/hid-core.c: v2.6:USB HID core driver [17179577.192000] usb-storage: device found at 2 [17179577.192000] usb-storage: waiting for device to settle before scanning [17179577.192000] usbcore: registered new driver usb-storage [17179582.192000] usb-storage: device scan complete [17209993.728000] usb 1-2: new full speed USB device using uhci_hcd and address 3 [17209994.816000] usbcore: registered new driver DS9490R [17248016.760000] usb 1-1: USB disconnect, address 2 [17302939.908000] usb 1-2: USB disconnect, address 3 [17302944.856000] usb 1-2: new full speed USB device using uhci_hcd and address 4 [17794170.232000] usb 1-2: USB disconnect, address 4 Does it help in diagnosis? The name of the 1-wire viewer device is DS9490 Best regards, Manuj Trent Jarvi wrote: On Wed, 21 Nov 2007, manuj naman wrote: > Hello, > > I am trying to use the RXTX library on Ubuntu (Debian) linux to read iButtons. It works perfectly on Windows. However on my linux machines it gives the following errors. I am using DS9490 (USB port adapter) to read the iButtons. > > I have followed your instructions on the Wiki. I recompiled the rxtx library to produce the .so and .jar files. But still it gives me this: > > manujnaman at sensor:~/iButton/onewireviewer$ java -cp $CLASSPATH:./OneWireAPI.jar:./OneWireViewer.jar OneWireViewer > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > Warning: serial communications API not setup properly, no ports in enumeration > Pure-Java DS9097U adapter will not work, not added to adapter enum > > Standard drivers for 1-Wire are not found. > Please download the latest drivers from http://www.ibutton.com > Or install RXTX Serial Communications API from http://www.rxtx.org > > Do you know how to solve the "Serial communications API not setup properly, no ports in enumeration" problem? > > Also, how to detect which what /dev/* is the port to be used? On Windows this is simply USB1, on linux this is a bit unclear. Hi Manuj What is the output of the following? dmesg |grep tty touch /var/lock/test.lock && rm -f /var/lock/test.lock If you see something like /dev/ttyUSB0 in the dmesg output, what happens if you do something like tail -f /dev/ttyUSB0? These test each of the usual suspects. We are looking for missing USB drivers, no permission to create a lockfile and no read permission for the device. -- Trent Jarvi tjarvi at qbang.org --------------------------------- Be a better sports nut! Let your teams follow you with Yahoo Mobile. Try it now. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071125/ef4f80c4/attachment-0007.html From tjarvi at qbang.org Sun Nov 25 16:43:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 25 Nov 2007 16:43:04 -0700 (MST) Subject: [Rxtx] Problem reading 1-wire device using RXTX on Linux In-Reply-To: <104159.48942.qm@web37909.mail.mud.yahoo.com> References: <104159.48942.qm@web37909.mail.mud.yahoo.com> Message-ID: Hi Manuj, This does help diagnose the problem. Sadly the answer is in the system configuration of your debian system. I can only point you towards some areas that are suspect. /dev/tty01->/dev/ttyzz are terminals which are not of interest. It appears that the usb serial kernel module is not loading. That is usually in a directory like the following: /lib/modules/2.6.*/kernel/drivers/usb/serial modprobe is used to manually load the drivers. Your /dev/* may be created based upon the kernel modules loaded or MAKEDEV may be used to create the devices. /etc/modules.conf may be what is misconfigured though I'm not sure. One of the modules in usb/serial is probably responsible for representing your USB dongle as a tty. UDEV is probably responsible for creating ttyUSB01 once the kernel module is loaded. Perhaps someone has been through this before but basically this is a system configuration problem or a missing kernel driver. Once /dev/USB?? are present, rxtx should find the port. On Sun, 25 Nov 2007, manuj naman wrote: > Trent, > > dmesg | grep tty > gives nothing. however, greping for usb does. The output for that is below. > > touch /var/lock/test.lock file does not exist, the directory does exits though. > > tail -f /dev/ttyUSB0 gives nothing simply because ttyUSB0 does not exist. > > Seems as if USB ports are not there... however, numerous /dev/tty* exist starting from /dev/tty, /dev/tty0, /dev/tty1... to ... /dev/ttyzf. > > The result of dmesg | grep usb is as follows: > > [17179576.220000] usbcore: registered new driver usbfs > [17179576.220000] usbcore: registered new driver hub > [17179576.572000] usb 1-1: new low speed USB device using uhci_hcd and address 2 > [17179576.992000] usb 2-1: new full speed USB device using uhci_hcd and address 2 > [17179577.132000] usbcore: registered new driver hiddev > [17179577.188000] input: USB HID v1.11 Mouse [Microsoft Microsoft Wireless Optical Mouse� 1.00] on usb-0000:00:1f.2-1 > [17179577.188000] usbcore: registered new driver usbhid > [17179577.188000] drivers/usb/input/hid-core.c: v2.6:USB HID core driver > [17179577.192000] usb-storage: device found at 2 > [17179577.192000] usb-storage: waiting for device to settle before scanning > [17179577.192000] usbcore: registered new driver usb-storage > [17179582.192000] usb-storage: device scan complete > [17209993.728000] usb 1-2: new full speed USB device using uhci_hcd and address 3 > [17209994.816000] usbcore: registered new driver DS9490R > [17248016.760000] usb 1-1: USB disconnect, address 2 > [17302939.908000] usb 1-2: USB disconnect, address 3 > [17302944.856000] usb 1-2: new full speed USB device using uhci_hcd and address 4 > [17794170.232000] usb 1-2: USB disconnect, address 4 > > Does it help in diagnosis? The name of the 1-wire viewer device is DS9490 > > Best regards, > Manuj > > > Trent Jarvi wrote: On Wed, 21 Nov 2007, manuj naman wrote: > >> Hello, >> >> I am trying to use the RXTX library on Ubuntu (Debian) linux to read iButtons. It works perfectly on Windows. However on my linux machines it gives the following errors. I am using DS9490 (USB port adapter) to read the iButtons. >> >> I have followed your instructions on the Wiki. I recompiled the rxtx library to produce the .so and .jar files. But still it gives me this: >> >> manujnaman at sensor:~/iButton/onewireviewer$ java -cp $CLASSPATH:./OneWireAPI.jar:./OneWireViewer.jar OneWireViewer >> Experimental: JNI_OnLoad called. >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> Warning: serial communications API not setup properly, no ports in enumeration >> Pure-Java DS9097U adapter will not work, not added to adapter enum >> >> Standard drivers for 1-Wire are not found. >> Please download the latest drivers from http://www.ibutton.com >> Or install RXTX Serial Communications API from http://www.rxtx.org >> >> Do you know how to solve the "Serial communications API not setup properly, no ports in enumeration" problem? >> >> Also, how to detect which what /dev/* is the port to be used? On Windows this is simply USB1, on linux this is a bit unclear. > > > Hi Manuj > > What is the output of the following? > > dmesg |grep tty > > touch /var/lock/test.lock && rm -f /var/lock/test.lock > > If you see something like /dev/ttyUSB0 in the dmesg output, what happens > if you do something like > > tail -f /dev/ttyUSB0? > > These test each of the usual suspects. We are looking for missing USB > drivers, no permission to create a lockfile and no read permission for the > device. > > -- > Trent Jarvi > tjarvi at qbang.org > > > > --------------------------------- > Be a better sports nut! Let your teams follow you with Yahoo Mobile. Try it now. From netbeans at gatworks.com Mon Nov 26 06:53:02 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 26 Nov 2007 08:53:02 -0500 Subject: [Rxtx] #undef TIOCSERGETLSR on LINUX Message-ID: <474ACFBE.5050406@gatworks.com> So I undef'ed the define TIOCSERGETLSR on a linux box, I find that RXTX no longer works . this is a :{ It appears that the sigprocmask( SIG_SETMASK, &newmask, &oldmask ) at src/SerialImp.c:1427 seems to unblock more events than it should. On a linux box there are 2 other events that are blocked, and this code un-sets them, and the thread hangs. It also appears that this code is incomplete. Also, if you only add in the block for SIGCHLD ( which I think is what someone wanted ) , the code will (soon) core-dump ( or silently exit ). So has anyone run with this code ? From tjarvi at qbang.org Mon Nov 26 19:32:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 26 Nov 2007 19:32:54 -0700 (MST) Subject: [Rxtx] #undef TIOCSERGETLSR on LINUX In-Reply-To: <474ACFBE.5050406@gatworks.com> References: <474ACFBE.5050406@gatworks.com> Message-ID: On Mon, 26 Nov 2007, U. George wrote: > So I undef'ed the define TIOCSERGETLSR on a linux box, I find that RXTX > no longer works . this is a :{ > > It appears that the sigprocmask( SIG_SETMASK, &newmask, &oldmask ) at > src/SerialImp.c:1427 seems to unblock more events than it should. On a > linux box there are 2 other events that are blocked, and this code > un-sets them, and the thread hangs. > > It also appears that this code is incomplete. > Also, if you only add in the block for SIGCHLD ( which I think is what > someone wanted ) , the code will (soon) core-dump ( or silently exit ). > > So has anyone run with this code ? Hi George, The case when TIOCSERGETLSR is not defined is currently used on Solaris. Linux has used the TIOCSERGETLSR. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Nov 26 19:56:24 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 26 Nov 2007 21:56:24 -0500 Subject: [Rxtx] #undef TIOCSERGETLSR on LINUX In-Reply-To: References: <474ACFBE.5050406@gatworks.com> Message-ID: <474B8758.6010006@gatworks.com> Technically, with, or without TIOCSERGETLSR it *SHOULD* work the same. Still does not explain the SIGSEGV on the current development code Trent Jarvi wrote: > On Mon, 26 Nov 2007, U. George wrote: > >> So I undef'ed the define TIOCSERGETLSR on a linux box, I find that RXTX >> no longer works . this is a :{ From Joshua.Gerdes at xerox.com Tue Nov 27 16:00:07 2007 From: Joshua.Gerdes at xerox.com (Gerdes, Joshua) Date: Tue, 27 Nov 2007 15:00:07 -0800 Subject: [Rxtx] Trying to use RXTX Message-ID: Hello, I've been using Java for a little while, but am no master. This is my story: I'm trying to write a simple program that will use RXTX to open a serial port on com4, read from it and write to it. I must be doing something wrong because this doesn't seem to be working - I sort of hodge-podged this together from an example that was on the rxtx website. Basically I call the connect method I wrote, that seems to work (no exceptions atleast), I call writeSerial method, and though I don't know for sure if this works it doesn't throw any exceptions, but then I try calling readSerial and never get anything. Can anyone tell me why this isn't working? I must just be doing something flat out wrong. I know that my serial device responds fine when communicated to - I've checked it on a serial terminal. Also, what is considered the end of the input stream? I nabbed this from an example and wonder when the while loop in readSerial will end. /******************************************** * name: readSerial * description: reads from serial port until \0? * arguments: none * returns: read bytes from serial port *******************************************/ private byte [] readSerial() throws IOException{ byte [] buffer = new byte [128]; //read until end of stream. whats considered the end? int len = -1; while ( ( len = serialIn.read(buffer)) > -1 ); return(buffer); } /******************************************** * name: writeSerial * description: writes to serial port until * arguments: String to write * returns: none *******************************************/ private void writeSerial(String data) throws IOException{ byte [] buffer = data.getBytes(); serialOut.write(buffer); } /******************************************** * name: connect * description: opens serial port. * arguments: Com port name * returns: none *******************************************/ void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(9600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE); serialIn = serialPort.getInputStream(); serialOut = serialPort.getOutputStream(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } /******************************************** * name: closeSerial * description: close serial port. * arguments: none * returns: none *******************************************/ private void closeSerial() throws IOException{ serialIn.close(); serialOut.close(); } //some globals private InputStream serialIn; private OutputStream serialOut; -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071127/b9b8cae8/attachment-0005.html From tjarvi at qbang.org Tue Nov 27 21:45:07 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Nov 2007 21:45:07 -0700 (MST) Subject: [Rxtx] Trying to use RXTX In-Reply-To: References: Message-ID: On Tue, 27 Nov 2007, Gerdes, Joshua wrote: > Hello, > > I've been using Java for a little while, but am no master. This is my > story: > > I'm trying to write a simple program that will use RXTX to open a serial > port on com4, read from it and write to it. I must be doing something > wrong because this doesn't seem to be working - I sort of hodge-podged > this together from an example that was on the rxtx website. Basically I > call the connect method I wrote, that seems to work (no exceptions > atleast), I call writeSerial method, and though I don't know for sure if > this works it doesn't throw any exceptions, but then I try calling > readSerial and never get anything. Can anyone tell me why this isn't > working? I must just be doing something flat out wrong. I know that my > serial device responds fine when communicated to - I've checked it on a > serial terminal. Also, what is considered the end of the input stream? I > nabbed this from an example and wonder when the while loop in readSerial > will end. > It is hard to tell for sure without seeing main(). Here are a few hints. Sometimes when you try to communicate with a device, the white space is important. Perhaps the device knows that you are done transmitting a message when it reads a new line. Maybe it is a null character. Maybe you typed the same string into the terminal and then hit not thinking that was a character too. Serial communication can now go 3 Mb/sec with the right hardware but most of use don't have that :). Don't read right after you right. You can look at the bytes available with tha API. You can wait for bytes available events. Give the electrons a running head start if in doubt; they have been doing this since the 1960's and need a break now and then. The exact behavior of read depends upon the timeout and threshold. A 0 timeout and 0 threshold should block. There is no end of to a stream. Some terminals consider control-d the EOF and close. That is always the interesting part of serial communication. Often you end up creating some sort of packet based communication to know when you are done reading. Other times, you eat a byte at a time and make some decision. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 27 22:40:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Nov 2007 22:40:41 -0700 (MST) Subject: [Rxtx] #undef TIOCSERGETLSR on LINUX In-Reply-To: <474B8758.6010006@gatworks.com> References: <474ACFBE.5050406@gatworks.com> <474B8758.6010006@gatworks.com> Message-ID: Hi George, The last time I saw a segv it was related to 64 bit processors and how we stored pointers. Could you describe your system a bit and the serial device being used? I might just make sure I have access to one before the next release. I agree that doing an undef on TIOCSERGETLSR is a good thing to try. But given the afterthought/reaction nature of the ifdefs in rxtx, I would not put it past silly preprocessing mistakes that may be as simple as you don't have a Solaris machine or have a Linux machine and we didn't handle that case right. The ifdefs go both ways there. It is possible to attach gdb to the jvm. HP and IBM have published some info on that that google can find. Usually when rxtx segv's it is so blatant, the eventThread does not even start. I've usually just sprinkled some debug messages then stared at the sillyness. The Linux code should not be hard to figure out with an example system. The w32 issues have been what takes me time to figure out. On Mon, 26 Nov 2007, U. George wrote: > Technically, with, or without TIOCSERGETLSR it *SHOULD* work the same. > Still does not explain the SIGSEGV on the current development code > > Trent Jarvi wrote: >> On Mon, 26 Nov 2007, U. George wrote: >> >>> So I undef'ed the define TIOCSERGETLSR on a linux box, I find that RXTX >>> no longer works . this is a :{ > From netbeans at gatworks.com Wed Nov 28 07:16:17 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 28 Nov 2007 09:16:17 -0500 Subject: [Rxtx] #undef TIOCSERGETLSR on LINUX In-Reply-To: References: <474ACFBE.5050406@gatworks.com> <474B8758.6010006@gatworks.com> Message-ID: <474D7831.5010300@gatworks.com> Box is a PIII laptop, with a USB 1 port. Device is a serialUSB device ( as per linux/redhat ) Debugging is not terribly easy on LINUX when there are pthreads involved. Its not getting easier when SUN/java has placed extensive hooks in catching and logging ( catchable ) events. for example this logfile excerp: > # > # An unexpected error has been detected by Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0xb50ad67b, pid=4291, tid=16386 > # > # Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, sharing) > # Problematic frame: > # C [librxtxSerial.so+0x567b] Java_gnu_io_RXTXPort_interruptEventLoop+0xd3 > # > # If you would like to submit a bug report, please visit: > # http://java.sun.com/webapps/bugreport/crash.jsp > # > > --------------- T H R E A D --------------- > > Current thread (0x08291800): JavaThread "main" [_thread_in_native, id=4293] > > siginfo:si_signo=11, si_errno=0, si_code=1, si_addr=0xb50a77a0 > There are more java magical switches to aid in debugging, but they appear to be undocumented. So I have to go back to some old e-mails Right now I think its the SIGABRT that is sent a second time ( the first is caught ) to interrupt the drain_loop thread. > > The Linux code should not be hard to figure out with an example system. > The w32 issues have been what takes me time to figure out. From dwippermann at gmx.net Wed Nov 28 08:47:04 2007 From: dwippermann at gmx.net (Daniel Wippermann) Date: Wed, 28 Nov 2007 16:47:04 +0100 Subject: [Rxtx] Dual Core Problem In-Reply-To: References: Message-ID: Hi all, > I am struggling with an application that uses RXTX 2.1.7 and has been > working reliably in the past. When this program runs on a dual-core DELL > (Intel T2500), strange things happen with the RS232 communication. The > application is missing incoming characters and also often freezes when > trying to close the serial port. I highly suspect a threading problem > and was wondering if a) anybody had run into a similar problem with dual > core processors and b) if there is a list of does and dont's when it > comes to RXTX and threads. I just stumbled over the same "freeze" of the application while trying to "close()" the RXTXPort. In this rare circumstances the "IOLocked" variable of the RXTXPort class still has a value greater than 0 although no action is pending. That makes the close() method sleep forever in expectation of some other thread to end its work... I believe this is caused by the "IOLocked++" and "IOLocked--" instructions not being synchronized. I suspect that in a multi-core- CPU environment there is a chance that this instructions may interfere if two threads are operating on the same port, but in different CPU cores. In my example the monitor thread is reading the port, while the main thread, that opened the port, is writing to it. I just changed my application so that every port handling method call is done from within a synchronized method or block. I have not observed another freeze since then, although I did an extensive stress test. But I think it would be nice if you could do the synchronisation from within the library in a future release. Best regards, Daniel From netbeans at gatworks.com Fri Nov 30 17:22:28 2007 From: netbeans at gatworks.com (U. George) Date: Fri, 30 Nov 2007 19:22:28 -0500 Subject: [Rxtx] #undef TIOCSERGETLSR on LINUX In-Reply-To: <474D7831.5010300@gatworks.com> References: <474ACFBE.5050406@gatworks.com> <474B8758.6010006@gatworks.com> <474D7831.5010300@gatworks.com> Message-ID: <4750A944.7010504@gatworks.com> U. George wrote: > Box is a PIII laptop, with a USB 1 port. Device is a serialUSB device ( > as per linux/redhat ) > Debugging is not terribly easy on LINUX when there are pthreads The issue seems to be a mis-coordination of the "drain_loop" thread use of the eis struct which is created from the "RXTXPort(eventLoop)" stack. Once the flag eis.closing is set, the call to event loop is completed, and the stack space is released ( re-used ). unfortunately drain_loop still appears to be using the data, as the pthread_kill() signal has yet to be processed by the drain_loop thread. The pthread_join() could be used here to wait for the drain_loop thread to terminate. It might work if the pthread_detach() is *not* used, which unfortunately is called by the thread creator as well as the thread itself :{ From keithvz at verizon.net Thu Nov 1 08:08:58 2007 From: keithvz at verizon.net (Keith) Date: Thu, 01 Nov 2007 10:08:58 -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: <4729DDFA.7080206@verizon.net> Trent Jarvi wrote: > 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? Well, I honestly don't know how all this fits together. I think it's just a matter of enabling the right flow control option within the standard serial framework to tell the device driver, "HEY START USING DTR/DSR FOR FLOW CONTROL." If what UGeorge said,(about that type of nitty-gritty lead control being done within the device driver), is true, then this confirms my suspicion. I tried narrowing down within the Linux drivers what you are looking for, but I can't entirely tell wth I'm looking at. (virtual com port drivers -- they are included compiled by default with Ubuntu, source included) http://www.ftdichip.com/Drivers/VCP/Linux/ftdi_sio.tar.gz Hahahaa, they make a reference to DTR flow control being supported but say (UGH) in parenthesis. You can also use their direct device driver library on Ubuntu -- libftd2xx.so.0.4.13. No source code. http://www.ftdichip.com/Drivers/D2XX/Linux/libftd2xx0.4.13.tar.gz In that case, you make a call to their FT_SetFlowControl() function. FT_STATUS FT_SetFlowControl (FT_HANDLE ftHandle, USHORT usFlowControl, UCHAR uXon,UCHAR uXoff) Parameters ftHandle Handle of the device. usFlowControl Must be one of FT_FLOW_NONE, FT_FLOW_RTS_CTS, ****FT_FLOW_DTR_DSR**** or FT_FLOW_XON_XOFF. uXon Character used to signal Xon. Only used if flow control is FT_FLOW_XON_XOFF. uXoff Character used to signal Xoff. Only used if flow control is FT_FLOW_XON_XOFF. This is from their programming guide http://www.ftdichip.com/Documents/ProgramGuides/D2XXPG34.pdf I actually want to take this a step further and say that I think the flow control is actually handled right on the device itself in hardware/firmware. It's enabled through the device driver, but I think the maintaining of buffers, asserting/deasserting of leads, etc is handled by the device. For the time being, I've switched to jd2xx, https://jd2xx.dev.java.net/ and http://bleyer.org/jd2xx/ These are Java wrappers for the device driver libraries. It allows almost direct access to the well-documented device drivers from Java. I hope this helps Keith From tjarvi at qbang.org Thu Nov 1 11:09:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:09:51 -0600 (MDT) 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: Hi Martin, What I usually have done is allow changes that do not impact working software including changes to methods not documented in CommAPI (which remain undocumented in rxtx) and fixes to known problems in the documented portions. That way if you use the documented API, the releases should only become better with time. If you use the undocumented portions, the behavior is not as predictable but open for improvement. On Wed, 31 Oct 2007, 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 >> > From tjarvi at qbang.org Thu Nov 1 11:15:52 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:15:52 -0600 (MDT) 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: I too use rxtx in commercial products. The problem I've been trying to address while bringing the server back was how to make it possible for hobby folks to build the same software as companies so we can move rxtx along a little faster. Exposing internal tools is not an option at this time, the public rxtx builds have been done on my home machine which has drives hanging out of it all over the place dying one at a time. This isn't maintainable. I'm currently looking at the possibility of making an S3 image available on Amazon's EC. These are machines you can rent for ~10 cents an hour which is more than enough to build rxtx. The S3 image is not changed when people use it so everyone has the same starting point. With this, we could all build rxtx for ~20 platforms for a small price and eliminate tool issues. On Wed, 31 Oct 2007, Greg Johnson wrote: > 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 tjarvi at qbang.org Thu Nov 1 11:19:55 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:19:55 -0600 (MDT) 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: On Wed, 31 Oct 2007, 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. I was helping Dmitry do the Mac OS X port without access to a machine when we put that in. In the archives there is information (easily found with google on Apple's site) that describes how their API (and others) can determine if a port is used and ignore it. I think these changes are in CVS but need to confirm. The bottom line is that rxtx should not have used lock files on Mac. It was just ignorance of the system on my part. -- Trent Jarvi tjarvi at qbang.org From fabioanjos at gmail.com Thu Nov 1 12:35:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Thu, 1 Nov 2007 15:35:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Hi, I was using SerialEventListener in my project. But, as was said here, id doesnt work very well with virtual serial ports. So, I changed the strategy using the code posted here in this thread: try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > 0) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } The thing is that in my tests I could notice that in.read(buffer) never blocks. Even when there's nothing to read. Instead of blocking when there's nothing to read it returns 0. So, my questions are: 1. Am I doing something wrong? 2. If not, wouldnt this decrease performance? (the thread would be locked in a loop that does nothing.) 3. Is there a better way to do the job? Thanks in advance!! F?bio -------- On 10/31/07, Andre-John Mas wrote: > > > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/0aee59d0/attachment-0033.html From ajmas at sympatico.ca Thu Nov 1 16:07:55 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Nov 2007 18:07:55 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Message-ID: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From sarah_662005 at yahoo.com Thu Nov 1 17:10:05 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Thu, 1 Nov 2007 16:10:05 -0700 (PDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Message-ID: <351433.37166.qm@web55814.mail.re3.yahoo.com> Thank you very much for your help. Now the application works fine. the serialEvent gets triggered. Rxtx is cool! ----- Original Message ---- From: Andre-John Mas To: Sara Hugh ; RXTX Developers and Users Sent: Wednesday, October 31, 2007 9:55:45 AM Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered 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 __________________________________________________ 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/20071101/4a86bea6/attachment-0033.html From tjarvi at qbang.org Thu Nov 1 17:58:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 17:58:02 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx Message-ID: The rxtx.org site is primarily interested in the hobby aspects of rxtx. Obviously, there are some companies following the work too. These interests bring larger workflows and concerns about details hobby folks may not care about. They also bring many more users. I know the company I work for has a quality engineering effort going on which includes rxtx. While the server was down, I was contacted by another company that was missing the binaries for their testing. Several people have mentioned concerns about a stable release for like reasons. Would there be interest on the quality side of the coin to get together? It could be just sharing email's with each other or a seperate list for QE/QA. I can not say for sure, but we may be able to share some of our efforts/results that could help keep rxtx releases stable. -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Fri Nov 2 01:42:55 2007 From: scldad at sdc.com.au (Stephen Davies) Date: Fri, 2 Nov 2007 18:12:55 +1030 Subject: [Rxtx] Multiple modems Message-ID: <200711021812.56047.scldad@sdc.com.au> This may or may not be related to the Multiple Ports thread. I have an application which uses rxtx on Linux (via cron jobs) to connect multiple modems to remote sensing devices. The application works fine most of the time but occasionally fails to connect if two (or more) connection attempts happen at about the same time. When it fails, it looks as if it may get confused as to which port it is talking to. The app has a "base" component that looks for an available port, opens it and then creates an input thread and an output thread for the connection and data transfer. The "base" component uses this code: // loop round all known ports until one is available. Give up after three minutes Counter ptimeout = new Counter(); while(!portFound && ptimeout.elapsed() < 180000) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // special case. ttyS0 is not available to us on this server. if (!portId.isCurrentlyOwned() && !portId.getName().equals("/dev/ttyS0")) { gLog.debug(lognm + ": Found port " + portId.getName()); try { serialPort = (RXTXPort) portId.open("AguaModem", 10000); } catch (Exception e) { gLog.error(lognm + ": Port " + portId.getName() + " will not open."); gLog.error(e.getMessage()); continue; } AguaModem aguamodem = new AguaModem(); portFound = true; break; } gLog.debug(lognm + ": Port " + portId.getName() + " is busy"); } } } I am wondering about the isCurrentlyOwned method. Does this actually tell me whether a port is currently being used by another process? TIA, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From fabioanjos at gmail.com Fri Nov 2 04:59:58 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 07:59:58 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Message-ID: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/9009eb1d/attachment-0033.html From netbeans at gatworks.com Fri Nov 2 06:28:13 2007 From: netbeans at gatworks.com (U. George) Date: Fri, 02 Nov 2007 08:28:13 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <472B17DD.1050508@gatworks.com> It should normally block ( unless eof / event ) . so its a :{ whats the device ( to recreate if possible ) and how do u open. > My question is, is there a way to make in.read block the thead until > there's something to read? > From fabioanjos at gmail.com Fri Nov 2 06:34:46 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 09:34:46 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > On 11/1/07, Andre-John Mas wrote: > > > > Fabio, > > > > Turns out there was a small error in my example. The test should be: > > > > (numBytes = in.read(buffer)) > -1 > > > > This is because -1 indicates an end of file (end of data stream) > > > > Andre > > > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > > > Hi, > > > > > > I was using SerialEventListener in my project. But, as was said > > > here, id doesnt work very well with virtual serial ports. > > > So, I changed the strategy using the code posted here in this thread: > > > > > > try{ > > > in = port.getInputStream(); > > > out = port.getOutputStream(); > > > int numBytes = 0; > > > while(active){ > > > > > > byte[] buffer = new byte[10]; > > > > > > while ( (numBytes = in.read(buffer)) > 0) > > > { > > > String dataValue = new String(buffer,0,numBytes); > > > processInput(dataValue); > > > } > > > > > > if(numBytes==-1){ > > > break; > > > } > > > > > > Thread.sleep(50); > > > } > > > > > > }catch(IOException e){ > > > logger.info("falha de comunicacao "+ > > > getReceptor().getPort() ); > > > > > > }catch(InterruptedException e){ > > > logger.info ("Interrompendo leitura da porta "+ > > > getReceptor().getPort() ); > > > } > > > > > > The thing is that in my tests I could notice that in.read(buffer) > > > never blocks. Even when there's nothing to read. Instead of blocking > > > when there's nothing to read it returns 0. > > > > > > So, my questions are: > > > > > > 1. Am I doing something wrong? > > > 2. If not, wouldnt this decrease performance? (the thread would be > > > locked in a loop that does nothing.) > > > 3. Is there a better way to do the job? > > > > > > Thanks in advance!! > > > > > > F?bio > > > -------- > > > > > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > > 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 > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > > > > > -- > > > Atenciosamente, > > > F?bio Cristiano dos Anjos > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/5306c4b1/attachment-0033.html From nick.circelli at infrasafe.com Fri Nov 2 07:01:17 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Fri, 2 Nov 2007 08:01:17 -0500 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com><29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com><90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca><29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Message-ID: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> I'm pretty sure that not blocking has to do with you virtual ports. Cause it should block. Maybe you should try: while ((numBytes = in.available()) > 0) { If (numBytes > buffer.length) { numBytes = buffer.length; // in case you have buffer overflow } numBytes = in.read(buffer, 0 , numBytes)); String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } Also, just for optimization, I'd move that byte[] buffer = new byte[10]; out of the while since you don't need to reallocate it every iteration. ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of F?bio Cristiano dos Anjos Sent: Friday, November 02, 2007 8:35 AM To: RXTX Developers and Users Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream (); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas < ajmas at sympatico.ca > wrote: Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info ("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Atenciosamente, F?bio Cristiano dos Anjos -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/4de7f6a3/attachment-0033.html From fabioanjos at gmail.com Fri Nov 2 07:36:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 10:36:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> Message-ID: <29788b250711020636q1588c88fgaa5e27f5504164fb@mail.gmail.com> Hi Nick, Actually, it doesnt block for physical ports too. And, the method avaiable does not block either, so when there's nothing avaiable the loop ends and the thread stops lintening to the port. But I did some more test with serialEventListener, and now its working. I realy dont know what I've done to get it working. I just start woking as soon as I decided to test it again. It was said here that serialEventListener is not reliable for virtual serial ports. Is there another way to read it, without compromising performance? Tanks again!! F?bio ------- On 11/2/07, Nick Circelli wrote: > > I'm pretty sure that not blocking has to do with you virtual ports. > Cause it should block. > > Maybe you should try: > > > > while ((numBytes = in.available()) > 0) > > { > > If (numBytes > buffer.length) { > > numBytes = buffer.length; // in case you have buffer overflow > > } > > numBytes = in.read(buffer, 0 , numBytes)); > > String dataValue = new String(buffer,0,numBytes,"ASCII"); > > processInput(dataValue); > > } > > > > Also, just for optimization, I'd move that byte[] buffer = new > byte[10]; > > out of the while since you don't need to reallocate it every iteration. > > > ------------------------------ > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On Behalf > Of *F?bio Cristiano dos Anjos > *Sent:* Friday, November 02, 2007 8:35 AM > *To:* RXTX Developers and Users > *Subject:* Re: [Rxtx] serialEvent(SerialPortEvent event) never be > triggered > > > > Hi, > > I think i missunderstand something here. > The code you post here was meant to be used inside serialEvent method, > right? > > The think is, that i cannot user SerialEventListener to read serial ports, > because i need to read virual serial ports and id does not behaves well, as > said here before. serialEvent is never triggered. > > So what I quit using SerialEventListener and created a thread to listen to > the port: > > public void run(){ > try{ > in = port.getInputStream(); > out = port.getOutputStream (); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new > String(buffer,0,numBytes,"ASCII"); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ getReceptor().getPort() > ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > } > > > So, the problem is that in.read(buffer) always returns 0 when there is > nothing to read, instead of blocking the flow, and the thread becames locked > in the loop. > > I hope you can help me solve this. > > Thanks in advance! > > F?bio > -------- > > On 11/2/07, *F?bio Cristiano dos Anjos* wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > > > On 11/1/07, *Andre-John Mas* < ajmas at sympatico.ca> wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info ("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/571df6ea/attachment-0032.html From tjarvi at qbang.org Fri Nov 2 08:32:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Nov 2007 08:32:15 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: References: Message-ID: On Fri, 2 Nov 2007, Greg Johnson wrote: > Hi Trent, folks, > Having a single rxtx that is suitable for commercial uses and hobbyists both > would be a great idea? Perhaps it would be worth submitting rxtx as a > proposal to Codehaus - they not only provide excellent tools (Jira (bug > tracker), Confluence (wiki)) but also support build management ( > maestro, continuum, bamboo). Relying on your personal machine (btw, frii.com > / rxtx.org is down again?) seems like a burden you shouldn't have to shoulder > alone. Hi Greg, There may be a little confusion here. There is no need to have two seperate rxtx releases. What I'm trying to encourage is a discussion between some of the people responsible for making sure rxtx does not break their products each release. Usually these people are interested in testing a set of functionality their product depends upon. They do not work with rxtx code but rather traps to catch when rxtx developers break something. This goes on all the time in isolated labs. There are many services that offer to do various pieces of a project for you if you... Anyone is free to do the 'if you' portion with rxtx and see how it goes. I'm actually interested in doing less of that than more. The rxtx.org work I do just happens to overlap with other things I do for personal/family use. The reason I suggest the amazon solution is that anyone can take full control of the environment for a day and it costs less than a package of gum without causing harm to what anyone else is doing. I assume the down question was with respect to a mod_security setting that has been resolved. If not, please post a url to the problem. -- Trent Jarvi tjarvi at qbang.org From nsayer at kfu.com Sat Nov 3 20:17:49 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 19:17:49 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? Message-ID: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Has anyone got RXTX working with an app under Leopard? My app hangs on port open (it works fine with Tiger). The relevant thread looks like this in the activity monitor: 1536 JVM_InvokeMethod 1536 0x48ccd0 1536 0x46f8a0 1536 0x4c3ff4 1536 0x4c4284 1536 0x357d160 1536 0x357faac 1536 Java_gnu_io_RXTXPort_open 1536 open $NOCANCEL$UNIX2003 1536 open $NOCANCEL$UNIX2003 From ajmas at sympatico.ca Sat Nov 3 22:02:04 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 00:02:04 -0400 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> RXTX works for me with Leopard. I am currently using it communicate with a Bluetooth GPS. What computer and device are you trying to use? Is the driver for your serial device compatible with MacOS X 10.5? Andre On 3-Nov-07, at 22:17 , Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From nsayer at kfu.com Sat Nov 3 22:17:47 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 21:17:47 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> Message-ID: <1720F723-3643-438C-B3AB-E09A67536977@kfu.com> On Nov 3, 2007, at 9:02 PM, Andre-John Mas wrote: > RXTX works for me with Leopard. I am currently using it communicate > with a Bluetooth GPS. > > What computer and device are you trying to use? Is the driver for > your serial device compatible with MacOS X 10.5? An Intel mac mini The FTDI USB serial driver an XMPCR, which is just a fancy serial controlled radio and an FTDI usb-to-serial chip I've successfully used the FTDI driver with another FTDI device in another context. > > > Andre > > On 3-Nov-07, at 22:17 , Nick Sayer wrote: > >> Has anyone got RXTX working with an app under Leopard? >> >> My app hangs on port open (it works fine with Tiger). The relevant >> thread looks like this in the activity monitor: >> >> 1536 JVM_InvokeMethod >> 1536 0x48ccd0 >> 1536 0x46f8a0 >> 1536 0x4c3ff4 >> 1536 0x4c4284 >> 1536 0x357d160 >> 1536 0x357faac >> 1536 >> Java_gnu_io_RXTXPort_open >> 1536 open >> $NOCANCEL$UNIX2003 >> 1536 open >> $NOCANCEL$UNIX2003 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From racecar at gmail.com Sat Nov 3 22:25:53 2007 From: racecar at gmail.com (Kevin Mateo Lim) Date: Sat, 3 Nov 2007 21:25:53 -0700 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: Message-ID: I am alternating between two errors. After i run the macosx_setup.command, "everyone" is set to Read only in /var/lock. I notice in the terminal that the group for these perms is _uucp, not uucp. In that state, I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 check_group_uucp(): error testing lock file creation Error details:Permission deniedcheck_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException : Error inside Serial.() at processing.serial.Serial.errorMessage(Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.( Serial.java:102) at Temporary_829_3245.setup(Temporary_829_3245.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java :690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) Then, I hand edit the "everyone" permissions for /var/lock/ to Read and Write (note /var/spool/uucp is Read/Write in all cases, and doesn't change). I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX uucp_lock() /var/lock/LK.003.009.000 is there gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException: Error inside Serial.() at processing.serial.Serial.errorMessage (Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.(Serial.java:102) at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java:690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) See here: http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071103/f1a2c467/attachment-0031.html From greg.johnson at manchester.ac.uk Sun Nov 4 02:31:13 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sun, 4 Nov 2007 10:31:13 +0100 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <28B5E0A0-0802-4C74-AC21-87ED35F3B9A2@manchester.ac.uk> Hi Nick, I also had problems initially with Leopard, but it was resolved by reinstalling the serial USB driver (FTDI in my case). The symptoms were a non-detection of any ports (but I twigged when I tried ZTerm and it had the same problem). Good luck! Cheers, greg PS I did a "Archive and install" which may be the reason my FTDI driver had disappeared - I don't think the driver has changed for 10.5 ------------------------------------------------------------------------- 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 4 Nov 2007, at 03:17, Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Sun Nov 4 13:01:12 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 15:01:12 -0500 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: Message-ID: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Hi, You will need to get the 2.1-8 code from CVS. See the FAQ for more information: http://rxtx.qbang.org/wiki/index.php/FAQ Andre On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > I am alternating between two errors. > > After i run the macosx_setup.command, "everyone" is set to Read only > in /var/lock. I notice in the terminal that the group for these > perms is _uucp, not uucp. > > In that state, I get this error: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > check_group_uucp(): error testing lock file creation Error > details:Permission deniedcheck_lock_status: No permission to create > lock file. > please see: How can I use Lock Files with rxtx? in INSTALL > gnu.io.PortInUseException: Unknown Application > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > java.lang.RuntimeException : Error inside Serial.() > > at processing.serial.Serial.errorMessage(Serial.java:583) > > at processing.serial.Serial.(Serial.java:148) > > at processing.serial.Serial.( Serial.java:102) > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > at processing.core.PApplet.run(PApplet.java:1556) > > at java.lang.Thread.run(Thread.java:613) > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > and Write (note /var/spool/uucp is Read/Write in all cases, and > doesn't change). I get this error: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > gnu.io.PortInUseException: Unknown Application > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > java.lang.RuntimeException: Error inside Serial.() > > at processing.serial.Serial.errorMessage (Serial.java:583) > > at processing.serial.Serial.(Serial.java:148) > > at processing.serial.Serial.(Serial.java:102) > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > at processing.core.PApplet.run(PApplet.java:1556) > > at java.lang.Thread.run(Thread.java:613) > > See here: > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From netbeans at gatworks.com Sun Nov 4 14:33:35 2007 From: netbeans at gatworks.com (U. George) Date: Sun, 04 Nov 2007 16:33:35 -0500 Subject: [Rxtx] #ifndef TIOCSERGETLSR Message-ID: <472E3AAF.7050709@gatworks.com> For Linux, it seems that you need the code for both *having* a TIOCSERGETLSR, and *not having* a TIOCSERGETLSR. Maybe the ioctl exists system wide, but not necessarily for the device driver itself ( always returns -1 ) . Are there systems that have a *functioning* TIOCSERGETLSR for all their devices? Then this would be the case where the "#ifndef TIOCSERGETLSR" directive could be useful is eliminating the unnecessary code and tests. And for those systems that dont have a TIOCSERGETLSR, then the code for TIOCSERGETLSR can be eliminated. It would be a simple case to have, as a foundation, all the code to simulate the missing TIOCSERGETLSR ioctl. If the system does have the ioctl, then that code can be ifdef'd in, and co-exist with the functionality of the code that simulates the missing TIOCSERGETLSR ioctl. From racecar at gmail.com Sun Nov 4 17:30:19 2007 From: racecar at gmail.com (Kevin Mateo Lim) Date: Sun, 4 Nov 2007 17:30:19 -0700 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: the README.OSX reads: Put libSerial.jnilib in the directory of the application (the JavaVM will find it there). Add RXTXComm.jar to the application classpath or include the classes in the application jar. (Some applications already include the RXTX classes in their application jar, in which case only the file libSerial.jnilib is required). I can't find libSerial.jnilib I put librxtxSerial.jnilib into my Processing /libraries/serial/library/ directory. Yet it still sees the old version: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 On 11/4/07, Andre-John Mas wrote: > > Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > 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/20071104/c0a83f91/attachment-0030.html From ajmas at sympatico.ca Sun Nov 4 17:41:47 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 19:41:47 -0500 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> If you are wanting it to be available for all applications, - for all users: /Library/Java/Extensions - for your user: ~/Library/Java/Extensions Or just for your application, then it should be in the same directory from which yo are launching your application. If you are getting the 2.1-8 source, then the library built is called: librxtxSerial.jnilib despite what the docs say. Andre On 4-Nov-07, at 19:30 , Kevin Mateo Lim wrote: > > the README.OSX reads: > Put > libSerial.jnilib > in the directory of the application (the JavaVM will find it there). > Add > RXTXComm.jar > to the application classpath or include the classes in the > application jar. > (Some applications already include the RXTX classes in their > application jar, > in which case only the file libSerial.jnilib is required). > > > I can't find libSerial.jnilib > I put librxtxSerial.jnilib into my Processing /libraries/serial/ > library/ directory. > > Yet it still sees the old version: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > On 11/4/07, Andre-John Mas wrote: Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial .(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay (PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > From bschlining at gmail.com Sun Nov 4 19:46:23 2007 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 4 Nov 2007 18:46:23 -0800 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> Message-ID: > > Or just for your application, then it should be in the same directory > from which yo are launching your application. Just wanted to add one more way of specifying the native lib location... If you don't want to define it globally by putting it in /Library/Java/Extensions (and you don't, it's a very very bad practice) you can also specify the location of the native library when starting the JVM by specifying the 'java.library.path' property. For example: java -Djava.library.path=/Path/To/Directory/With/RXTX/Library YourMainClass -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071104/c5af6980/attachment-0030.html From greg.johnson at manchester.ac.uk Mon Nov 5 01:39:02 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Mon, 5 Nov 2007 09:39:02 +0100 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: The 2.1-8 code reports 2.1-7, hence your (and my) confusion. But as long as you've removed all traces of the old library, it really _is_ 2.1-8. And if you specify the library path to the VM, don't make my mistake (on OSX at least) - you need to respecify the entire library path it had by default, as the command line argument replaces the path, rather than appending to it. 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 5 Nov 2007, at 01:30, Kevin Mateo Lim wrote: > > the README.OSX reads: > Put > libSerial.jnilib > in the directory of the application (the JavaVM will find it there). > Add > RXTXComm.jar > to the application classpath or include the classes in the > application jar. > (Some applications already include the RXTX classes in their > application jar, > in which case only the file libSerial.jnilib is required). > > > I can't find libSerial.jnilib > I put librxtxSerial.jnilib into my Processing /libraries/serial/ > library/ directory. > > Yet it still sees the old version: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > On 11/4/07, Andre-John Mas wrote: > Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial .(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay (PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > 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 HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071105/7f50506d/attachment-0030.html From cyrille.dumont at tatexpress.fr Mon Nov 5 05:46:03 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 05 Nov 2007 13:46:03 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: References: <472727F1.1000704@tatexpress.fr> Message-ID: <472F108B.2090101@tatexpress.fr> Thanks a lot for your solution ... but I'm not a expert in JAVA ... (sorry) For the moment I've this function : """ public void serialEvent(SerialPortEvent e) { StringBuffer inputBuffer = new StringBuffer(); int newData = 0; switch (e.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } //-- Manag. Data from Scanner this.MngDataScanner(inputBuffer.toString()); break; case SerialPortEvent.BI:; //-- Break Received } } """ How can I do what you write ? ( maybe a simple ex ? ) PS : I don't know the PDF417 size (could be, for example, 338 char, or 500 ... ; what I know is that it can't be more than 800 char) Thanks in advance. Best regards. Trent Jarvi a ?crit : > 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 Martin.Oberhuber at windriver.com Mon Nov 5 08:47:50 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 5 Nov 2007 16:47:50 +0100 Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> Hi Trent, are the interestes of hobbyists really so different from commercial ones? Both should be interested in high quality and innovation the like. I haven't seen too many Open Source projects from the "inside" but those that I have seen did not have separate mailing lists for quality/testing/qa versus innovation/development. What I have seen with the Open Source projects that one would call "successful" is a good deal of process around automated builds, automated unit tests, predictable release dates and milestones, and policies around commiting/contributing/reviewing changes. I think that all of these benefit commercial users and hobbyists the like. If you were just asking about who's interested in discussing changes to foster more quality, count me in. I'm just not sure whether discussing these on a separate mailing list or other channel is the right thing to do. Cheers, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From toupsz at cs.tamu.edu Tue Nov 6 14:27:04 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 15:27:04 -0600 Subject: [Rxtx] reading TTL level signals from serial? Message-ID: Dear RXTX community- I've been using RXTX to handle communicating with several hardware devices in Java (a GPS and some custom audio circuitry for my dissertation work). I have a new, high-accuracy GPS which only communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there any way to communicate with this device using RXTX, perhaps by modding the native code for Windows? If so, does anyone have any tips on how to do it? Has it perhaps already been done? Another option is for me to invert / amplify the signal in hardware, but this is difficult for me to pull off due to the sensitivity of the electronics involved...I'll likely end up using a much less accurate piece of equipment rather than go that far! If anyone could help out, I'd really appreciate it! Thanks! -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/b6c59c2b/attachment-0028.html From netbeans at gatworks.com Tue Nov 6 14:55:22 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 06 Nov 2007 16:55:22 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: Message-ID: <4730E2CA.3090009@gatworks.com> This is really a hardware issue. Is there any device ( ie the serial port ) on your computer that will accept the voltage signals ( and load ) that your device produces? Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it happen safely ( ie u dont cook the GPS device ) I have a new, high-accuracy GPS which only > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there > any way to communicate with this device using RXTX, From toupsz at cs.tamu.edu Tue Nov 6 15:14:01 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 16:14:01 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4730E2CA.3090009@gatworks.com> References: <4730E2CA.3090009@gatworks.com> Message-ID: Actually, the device runs over USB, but shows up as a virtual serial port and is outputting these signals. The software that comes with the device (a u-blox ANTARIS 4 eval kit) is able to communicate. RXTX is able to detect and properly configure the port, but does not get any of the data from it. :-/ It seems like there must be some way to do it (obviously, ublox knows how)... -Zach On Nov 6, 2007 3:55 PM, U. George wrote: > This is really a hardware issue. > Is there any device ( ie the serial port ) on your computer that will > accept the voltage signals ( and load ) that your device produces? > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it > happen safely ( ie u dont cook the GPS device ) > > > I have a new, high-accuracy GPS which only > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there > > any way to communicate with this device using RXTX, > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/15ae7a0b/attachment-0028.html From keithvz at verizon.net Tue Nov 6 16:16:55 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 06 Nov 2007 18:16:55 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> Message-ID: <4730F5E7.1030704@verizon.net> Zach Toups wrote: > On Nov 6, 2007 3:55 PM, U. George > wrote: > > This is really a hardware issue. > Is there any device ( ie the serial port ) on your computer that will > accept the voltage signals ( and load ) that your device produces? > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it > happen safely ( ie u dont cook the GPS device ) > > > I have a new, high-accuracy GPS which only > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is > there > > any way to communicate with this device using RXTX, > _______________________________________________ As UGeorge intimated, it's a hardware issue. If your device outputs TTL level voltages, and your USB to serial converter is RS-232, then you've got a physical hardware differences. Inverted leads and voltage issues are mainly the problem. MAXIM makes a neat little chip called the MAX233 (better than the 232, no extern caps required) You can't solve this in software. Now, there are TTL level compatible USB to serial converters available, I happen to be using one right now. This unit below is from a UK company (there might be sources in the US) http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm Parallax makes one that does 3.3 and 5v http://www.parallax.com/detail.asp?product_id=32201 (but only supports RX, TX, GND, AND DTR towards device) (i've tested a variant of the unit above, and it works with RXTX) In both cases, you'll need some creative wiring depending on the interface on your GPS. Hope this helps Keith From toupsz at cs.tamu.edu Tue Nov 6 16:53:01 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 17:53:01 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4730F5E7.1030704@verizon.net> References: <4730E2CA.3090009@gatworks.com> <4730F5E7.1030704@verizon.net> Message-ID: Yeah...I used an FTDI chip to handle USB/serial conversion on the audio equipment I built. I'm leery of trying to build a board for this ublox GPS due to all the grounding/shielding issues around it. Anyway, I apreciate the help...just sad that I can't handle the problem in software! Ublox did send me the source code for their USB drivers...but as a Java programmer, it's a bit tough for me to sort out. ;) Thanks again! -Zach On Nov 6, 2007 5:16 PM, Keith Monahan wrote: > Zach Toups wrote: > > > On Nov 6, 2007 3:55 PM, U. George > > wrote: > > > > This is really a hardware issue. > > Is there any device ( ie the serial port ) on your computer that > will > > accept the voltage signals ( and load ) that your device produces? > > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make > it > > happen safely ( ie u dont cook the GPS device ) > > > > > > I have a new, high-accuracy GPS which only > > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is > > there > > > any way to communicate with this device using RXTX, > > _______________________________________________ > > As UGeorge intimated, it's a hardware issue. > > If your device outputs TTL level voltages, and your USB to serial > converter is RS-232, then you've got a physical hardware differences. > Inverted leads and voltage issues are mainly the problem. MAXIM makes a > neat little chip called the MAX233 (better than the 232, no extern caps > required) > > You can't solve this in software. > > Now, there are TTL level compatible USB to serial converters available, > I happen to be using one right now. > > This unit below is from a UK company (there might be sources in the US) > > http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm > > Parallax makes one that does 3.3 and 5v > > http://www.parallax.com/detail.asp?product_id=32201 > (but only supports RX, TX, GND, AND DTR towards device) > > (i've tested a variant of the unit above, and it works with RXTX) > > In both cases, you'll need some creative wiring depending on the > interface on your GPS. > > Hope this helps > > Keith > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/06e88ad4/attachment-0028.html From netbeans at gatworks.com Tue Nov 6 17:14:01 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 06 Nov 2007 19:14:01 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> <4730F5E7.1030704@verizon.net> Message-ID: <47310349.5000406@gatworks.com> what gps chipset do u have? > Ublox did send me the source code for their USB drivers...but as a Java > programmer, it's a bit tough for me to sort out. ;) From Steffen.DETTMER at ingenico.com Wed Nov 7 03:10:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 7 Nov 2007 11:10:01 +0100 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> Message-ID: <20071107101000.GN10978@elberon.bln.de.ingenico.com> * Zach Toups wrote on Tue, Nov 06, 2007 at 16:14 -0600: > Actually, the device runs over USB, but shows up as a virtual > serial port and is outputting these signals. Ahh, so what you want is to use rxtx on the serial port that is created by the driver and mapped maybe as some COM8 or whatever? I this case then IMHO it would be no hardware question but maybe a problem in your application, or some driver or indeed a rxtx issue. > The software that > comes with the device (a u-blox ANTARIS 4 eval kit) is able to > communicate. Is it sure that this software is really using the virtual serial port and only this port? oki, Steffen -- About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Wed Nov 7 04:59:10 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 06:59:10 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <20071107101000.GN10978@elberon.bln.de.ingenico.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> Message-ID: <4731A88E.6080705@gatworks.com> >> The software that >> comes with the device (a u-blox ANTARIS 4 eval kit) is able to >> communicate. > > Is it sure that this software is really using the virtual serial > port and only this port? > I have tried to read the docs. I have yet to find any explanation on a (windoz) device driver for this device ( the usb device ). That magic is not explained. For a developer thats important magic. Maybe a call to their support team is in order? From netbeans at gatworks.com Wed Nov 7 05:01:38 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 07:01:38 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <20071107101000.GN10978@elberon.bln.de.ingenico.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> Message-ID: <4731A922.7@gatworks.com> Steffen DETTMER wrote: > * Zach Toups wrote on Tue, Nov 06, 2007 at 16:14 -0600: >> Actually, the device runs over USB, but shows up as a virtual BTW: it seems that I am not getting all the Rxtx mail. Is there still a problem? From toupsz at cs.tamu.edu Wed Nov 7 07:36:20 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Wed, 7 Nov 2007 08:36:20 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4731A88E.6080705@gatworks.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> <4731A88E.6080705@gatworks.com> Message-ID: When I emailed them about this issue, they sent me their WinCE drivers, which are apparently based on this open source driver: http://www.yetanotherhomepage.com/j7xx/j7xx.html?/j7xx/software/util/usbdriver.html These include srcdll, and x86 subfolders, though it's not 100% clear to me that these are useful. The ublox communication suite appears to only communicate with serial ports...I've communicated with the ublox on two different comm ports (one with the serial adapter plugged into the serial port, one with the main USB connection), as well as a Garmin bluetooth GPS (which comes up as a bluetooth serial device). I'm not well versed in code this close to the hardware, but it seems to me that if you're running a virtual serial port, then you're virtually controlling the "voltages" that come in on this "port"...so why would they be "ttl level"? :-/ Shouldn't the USB driver be able to interpret the signals in whatever way it wants and just supply software with the binary interpretation? Thanks for all the help, guys, it's really appreciated! -Zach On Nov 7, 2007 5:59 AM, U. George wrote: > > >> The software that > >> comes with the device (a u-blox ANTARIS 4 eval kit) is able to > >> communicate. > > > > Is it sure that this software is really using the virtual serial > > port and only this port? > > > > I have tried to read the docs. I have yet to find any explanation on a > (windoz) device driver for this device ( the usb device ). That magic > is not explained. For a developer thats important magic. Maybe a call > to their support team is in order? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071107/18a13314/attachment-0027.html From netbeans at gatworks.com Wed Nov 7 08:55:55 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 10:55:55 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> <4731A88E.6080705@gatworks.com> Message-ID: <4731E00B.9030902@gatworks.com> There are 2 components to talking to hardware. There is the electrical specification, and then there is the software specification. there is the rs232 specification, parallel port specification, and the USB electrical specification. Generally these are used to plug in the various devices, and hook up electrically. Then there is the software side. There is the device driver, a software component that sits somewhere in the kernel that handles the USB ( in your case ) controller. The device driver generally does not care about the electrical component. There are various chips that handle USB signals, and these chips have I/O addresses so that signals and data can be properly routed. There is also the side that communicates to the user via the COM port device-name. The device driver that you mentioned is for the "Support PL2303 serial chip". This device driver, which hopefully works, handles the USB chip, and eventually recognzes the gps device, and hopefully creates an COM port so the user can open up and communicate. These are a lot of "HOPES". Since u have the web address of the device driver, and developer, I would think that the developer, and any docs, might be better able to help u to first determine if the GPS device is recognized, and the COM port ( maybe its called by another name ) is created, as per documentation. > > These include srcdll, and x86 subfolders, though it's not 100% clear to > me that these are useful. From tjarvi at qbang.org Sat Nov 10 17:46:13 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Nov 2007 17:46:13 -0700 (MST) Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 5 Nov 2007, Oberhuber, Martin wrote: > Hi Trent, > > are the interestes of hobbyists really so different > from commercial ones? Both should be interested in > high quality and innovation the like. > > I haven't seen too many Open Source projects from the > "inside" but those that I have seen did not have > separate mailing lists for quality/testing/qa > versus innovation/development. > > What I have seen with the Open Source projects that > one would call "successful" is a good deal of > process around automated builds, automated unit > tests, predictable release dates and milestones, > and policies around commiting/contributing/reviewing > changes. > > I think that all of these benefit commercial users > and hobbyists the like. > > If you were just asking about who's interested in > discussing changes to foster more quality, count > me in. I'm just not sure whether discussing these > on a separate mailing list or other channel is the > right thing to do. > Hi Martin, There are two issues I'm thinking about. The first is the generic unit testing and quality initiatives required to move rxtx forward. The second is the inevitable fact that rxtx connects to external hardware. The discussion deals with a different set of problems. Here is a simple example of what I'm getting at. We have the capability of setting custom baud rates in rxtx. We may be interested in seeing regressions in rxtx, the C library or the kernel. Some people may be doing some tests with loopback connections. These will always work even if the baud rate is not set to the expected value. Some people may use null modems between two ports. This may be able to catch the problem but not always. Will the build machines be able to test this? (no - for a few reasons) Will people be trying to catch these type of regressions? (yes) What type of coverage does the community have in the end? (?) We could include the discussions in the same list or another equally open list that may be of interest to some folks that deal with these types of problems on a regular basis. -- Trent Jarvi tjarvi at qbang.org From timlow84 at gmail.com Mon Nov 12 00:31:17 2007 From: timlow84 at gmail.com (Timothy Low) Date: Mon, 12 Nov 2007 15:31:17 +0800 Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> Message-ID: <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> ---------- Forwarded message ---------- From: Timothy Low Date: Nov 12, 2007 3:02 PM Subject: Building RXTX From Source To: taj at www.linux.org.uk Cc: ferdinand.tang at tangs.net, Timothy Low , chweehuat.ng at tangs.net Hi Trent, I tried building RXTX from source, and I got this error. I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm trying to get the necessary ".so" files to use for my serial port communication through java. My linux kernal information is: *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 x86_64 x86_64 x86_64 GNU/Linux* I'll most glad if you can provide me some direction on this. Thanks ! ---------------- [root at smsgateway rxtx-2.0-7pre1]# ./configure checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu configure: WARNING: Trying libtool. If the following fails install libtool checking for gcc... gcc checking for C compiler default output... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking for ld used by GCC... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking for a sed that does not truncate output... /bin/sed checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking command to parse /usr/bin/nm -B output... ok checking how to run the C preprocessor... gcc -E checking for egrep... grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for ranlib... ranlib checking for strip... strip checking for objdir... .libs checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.lo... yes checking if gcc supports -fno-rtti -fno-exceptions... yes checking whether the linker (/usr/bin/ld) supports shared libraries... yes checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking dynamic linker characteristics... GNU/Linux ld.so checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no checking whether -lc should be explicitly linked in... no creating libtool checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking for style of include used by make... GNU checking dependency style of gcc... none checking fcntl.h usability... yes checking fcntl.h presence... yes checking for fcntl.h... yes checking sys/fcntl.h usability... yes checking sys/fcntl.h presence... yes checking for sys/fcntl.h... yes checking sys/file.h usability... yes checking sys/file.h presence... yes checking for sys/file.h... yes checking sys/time.h usability... yes checking sys/time.h presence... yes checking for sys/time.h... yes checking sys/signal.h usability... yes checking sys/signal.h presence... yes checking for sys/signal.h... yes checking signal.h usability... yes checking signal.h presence... yes checking for signal.h.. . yes checking termios.h usability... yes checking termios.h presence... yes checking for termios.h... yes checking asm/termbits.h usability... yes checking asm/termbits.h presence... yes checking for asm/termbits.h... yes checking grp.h usability... yes checking grp.h presence... yes checking for grp.h... yes checking pwd.h usability... yes checking pwd.h presence... yes checking for pwd.h... yes checking whether gcc needs -traditional... no checking whether to enable maintainer-specific portions of Makefiles... no /usr/java/jdk1.5.0_13 configure: WARNING: using JAVA_HOME environmental variable adjusted java.home is /usr/java/jdk1.5.0_13 checking os.name Linux checking os.arch i386 checking java.vendor Sun Microsystems Inc. checking java.version 1.5.0_13 checking os.version 2.6.18-8.el5xen comm.jar appears to be installed already. conftest.c: In function 'main': conftest.c:6: warning: incompatible implicit declaration of built-in function 'printf' conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:6: error: (Each undeclared identifier is reported only once conftest.c:6: error: for each function it appears in.) conftest.c:6: error: expected ')' before string constant conftest.c:7: warning: incompatible implicit declaration of built-in function 'exit' ./configure: line 9649: ./conftest: No such file or directory ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected conftest.c: In function 'main': conftest.c:5: warning: incompatible implicit declaration of built-in function 'printf' conftest.c:10: warning: incompatible implicit declaration of built-in function 'exit' configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status : config.h is unchanged config.status: executing depfiles commands [root at smsgateway rxtx-2.0-7pre1]# make install /usr/java/jdk1.5.0_13/bin/javac -classpath .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d /home/jboss/sources/rxtx- 2.0-7pre1/ -O /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java /home/jboss/sources/rxtx-2.0-7pre1/./src/UnSupportedLoggerException.java /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o /home/jboss/sources/rxtx-2.0-7pre1/x86_64-unknown-linux-gnu/SerialImp.lo /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'init_threads': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: cast from pointer to integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_nativeDrain': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: cast to pointer from integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'read_byte_array': /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: cast to pointer from integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_readArray': /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: comparison is always false due to limited range of data type /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_readTerminatedArray': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: comparison is always false due to limited range of data type mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial- 2.0.7pre1.* gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so -o .libs/librxtxSerial-2.0.7pre1.so (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.0.7pre1.so librxtxSerial.so) creating librxtxSerial.la (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la librxtxSerial.la) gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/ParallelImp.lo /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function 'Java_javax_comm_LPRPort_readArray': /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: comparison is always false due to limited range of data type rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* .libs/librxtxParallel-2.0.7pre1.* gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so -o .libs/librxtxParallel- 2.0.7pre1.so (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.0.7pre1.so librxtxParallel.so) creating librxtxParallel.la (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la librxtxParallel.la) make all-am make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' libtool: install: `x86_64-unknown-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 ------------- Regards, Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071112/27758c3c/attachment-0023.html From tjarvi at qbang.org Mon Nov 12 01:02:09 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Nov 2007 01:02:09 -0700 (MST) Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> Message-ID: On Mon, 12 Nov 2007, Timothy Low wrote: > > Hi Trent, Hi Tim, Comments are inline. As I mentioned off the list, rxtx 2.0 is on the edge of deprecation. We can get it working but this is not the path of least resistance for future work. You will probably need to bounce another round of questions off the list. The following is intended to isolate the problem. > > I tried building RXTX from source, and I got this error. > > > I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm trying > to get the necessary ".so" files to use for my serial port communication > through java. > My linux kernal information is: > > *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 x86_64 > x86_64 x86_64 GNU/Linux* > > I'll most glad if you can provide me some direction on this. Thanks ! > > ---------------- > [root at smsgateway rxtx-2.0-7pre1]# ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > checking for C compiler default output... a.out > checking whether the C compiler works... yes > checking whether we are cross compiling... no > checking for suffix of executables... > checking for suffix of object files... o > checking whether we are using the GNU C compiler... yes > checking whether gcc accepts -g... yes > checking for gcc option to accept ANSI C... none needed > checking for ld used by GCC... /usr/bin/ld > checking if the linker (/usr/bin/ld) is GNU ld... yes > checking for /usr/bin/ld option to reload object files... -r > checking for BSD-compatible nm... /usr/bin/nm -B > checking for a sed that does not truncate output... /bin/sed > checking whether ln -s works... yes > checking how to recognise dependent libraries... pass_all > checking command to parse /usr/bin/nm -B output... ok > checking how to run the C preprocessor... gcc -E > checking for egrep... grep -E > checking for ANSI C header files... yes > checking for sys/types.h... yes > checking for sys/stat.h... yes > checking for stdlib.h... yes > checking for string.h... yes > checking for memory.h... yes > checking for strings.h... yes > checking for inttypes.h... yes > checking for stdint.h... yes > checking for unistd.h... yes > checking dlfcn.h usability... yes > checking dlfcn.h presence... yes > checking for dlfcn.h... yes > checking for ranlib... ranlib > checking for strip... strip > checking for objdir... .libs > checking for gcc option to produce PIC... -fPIC > checking if gcc PIC flag -fPIC works... yes > checking if gcc static flag -static works... yes > checking if gcc supports -c -o file.o... yes > checking if gcc supports -c -o file.lo... yes > checking if gcc supports -fno-rtti -fno-exceptions... yes > checking whether the linker (/usr/bin/ld) supports shared libraries... yes > checking how to hardcode library paths into programs... immediate > checking whether stripping libraries is possible... yes > checking dynamic linker characteristics... GNU/Linux ld.so > checking if libtool supports shared libraries... yes > checking whether to build shared libraries... yes > checking whether to build static libraries... no > checking whether -lc should be explicitly linked in... no > creating libtool > checking for a BSD-compatible install... /usr/bin/install -c > checking whether build environment is sane... yes > checking for gawk... gawk > checking whether make sets $(MAKE)... yes > checking for style of include used by make... GNU > checking dependency style of gcc... none > checking fcntl.h usability... yes > checking fcntl.h presence... yes > checking for fcntl.h... yes > checking sys/fcntl.h usability... yes > checking sys/fcntl.h presence... yes > checking for sys/fcntl.h... yes > checking sys/file.h usability... yes > checking sys/file.h presence... yes > checking for sys/file.h... yes > checking sys/time.h usability... yes > checking sys/time.h presence... yes > checking for sys/time.h... yes > checking sys/signal.h usability... yes > checking sys/signal.h presence... yes > checking for sys/signal.h... yes > checking signal.h usability... yes > checking signal.h presence... yes > checking for signal.h.. . yes > checking termios.h usability... yes > checking termios.h presence... yes > checking for termios.h... yes > checking asm/termbits.h usability... yes > checking asm/termbits.h presence... yes > checking for asm/termbits.h... yes > checking grp.h usability... yes > checking grp.h presence... yes > checking for grp.h... yes > checking pwd.h usability... yes > checking pwd.h presence... yes > checking for pwd.h... yes > checking whether gcc needs -traditional... no > checking whether to enable maintainer-specific portions of Makefiles... no > /usr/java/jdk1.5.0_13 > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /usr/java/jdk1.5.0_13 > checking os.name Linux > checking os.arch i386 > checking java.vendor Sun Microsystems Inc. > checking java.version 1.5.0_13 > checking os.version 2.6.18-8.el5xen > comm.jar appears to be installed already. > conftest.c: In function 'main': > conftest.c:6: warning: incompatible implicit declaration of built-in > function 'printf' > conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:6: error: (Each undeclared identifier is reported only once > conftest.c:6: error: for each function it appears in.) > conftest.c:6: error: expected ')' before string constant This is an outdated kernel version check for when headers and kernels could cause problems for rxtx. If we made it past this, then you are OK. > conftest.c:7: warning: incompatible implicit declaration of built-in > function 'exit' > ./configure: line 9649: ./conftest: No such file or directory > ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected It blew up but continues.. > conftest.c: In function 'main': > conftest.c:5: warning: incompatible implicit declaration of built-in > function 'printf' > conftest.c:10: warning: incompatible implicit declaration of built-in > function 'exit' > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status : config.h is unchanged > config.status: executing depfiles commands > [root at smsgateway rxtx-2.0-7pre1]# make install > /usr/java/jdk1.5.0_13/bin/javac -classpath > .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d > /home/jboss/sources/rxtx- 2.0-7pre1/ -O > /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java > /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/UnSupportedLoggerException.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java > Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or > overrides a deprecated API. > Note: Recompile with -Xlint:deprecation for details. > /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* The java jar should be fine now. You may need to change the source files as mentioned below. > gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. > -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g > -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o > /home/jboss/sources/rxtx-2.0-7pre1/x86_64-unknown-linux-gnu/SerialImp.lo > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'init_threads': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: cast > from pointer to integer of different size > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_nativeDrain': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: cast to > pointer from integer of different size > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'read_byte_array': > /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: cast to > pointer from integer of different size As I recall, this was caused by pointers (now 64 bit rather than 32 bit) being stored in java ints (jints). I would look at the diff between the CVS 2.1 SerialImp.c and RXTXPort.java files against 2.0. We did fix those issues. You have a .so file but the different pointer sizes will cause runtime errors. > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_readArray': > /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: > comparison is always false due to limited range of data type > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_readTerminatedArray': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: > comparison is always false due to limited range of data type > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial- > 2.0.7pre1.* > gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so -o > .libs/librxtxSerial-2.0.7pre1.so > (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.0.7pre1.so > librxtxSerial.so) > creating librxtxSerial.la > (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la > librxtxSerial.la) > gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. > -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g > -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o > /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/ParallelImp.lo > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function > 'Java_javax_comm_LPRPort_readArray': > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: > comparison is always false due to limited range of data type > rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* > .libs/librxtxParallel-2.0.7pre1.* > gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so -o > .libs/librxtxParallel- 2.0.7pre1.so > (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.0.7pre1.so > librxtxParallel.so) > creating librxtxParallel.la > (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la > librxtxParallel.la) > make all-am > make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' > make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' > libtool: install: `x86_64-unknown-linux-gnu' must be an absolute directory > name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 A libtool change? Assuming you ran configure && make install in /home/jboss/sources/rxtx- 2.0-7pre1, libtool is looking for /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/.libs/librxtxSerial-2.0.7pre1.so. I think you have this? The file is just being copied to ~JAVA/jre/lib/$(JAVA_ARCH). -- Trent Jarvi tjarvi at qbang.org From sarah_662005 at yahoo.com Mon Nov 12 16:10:28 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Mon, 12 Nov 2007 15:10:28 -0800 (PST) Subject: [Rxtx] [urgent] device's power off detection Message-ID: <766782.10076.qm@web55803.mail.re3.yahoo.com> Hello all, I have a small application built on top of rxtx api. This application can retrieve the incoming data from a device through a port. The device can be powered off after the port get closed from the application. I have been trying a couple of hours to find a way to detect the power switching from device. If anyone knows how to handle it through rxtx, could you please give me a help? Thank you very much. r, Sara ____________________________________________________________________________________ Get easy, one-click access to your favorites. Make Yahoo! your homepage. http://www.yahoo.com/r/hs -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071112/4599f3ec/attachment-0022.html From netbeans at gatworks.com Mon Nov 12 17:52:22 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 12 Nov 2007 19:52:22 -0500 Subject: [Rxtx] [urgent] device's power off detection In-Reply-To: <766782.10076.qm@web55803.mail.re3.yahoo.com> References: <766782.10076.qm@web55803.mail.re3.yahoo.com> Message-ID: <4738F546.5010101@gatworks.com> Not sure what u are asking for. Are u asking for a way to detect if the device is OFF? Are u asking how to power off the device - via software ? Is it a Serial device? is it a parallel device? is it a usb device? Sara Hugh wrote: > Hello all, > I have a small application built on top of rxtx api. This application > can retrieve the incoming data from a device through a port. The device > can be powered off after the port get closed from the application. I > have been trying a couple of hours to find a way to detect the power > switching from device. If anyone knows how to handle it through rxtx, > could you please give me a help? Thank you very much. From tjarvi at qbang.org Mon Nov 12 22:48:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Nov 2007 22:48:11 -0700 (MST) Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711120225x562db8cbxb750767ade3b0d73@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> <900c6ba90711120031p66edc001ted76f7ba24e34b98@mail.gmail.com> <900c6ba90711120225x562db8cbxb750767ade3b0d73@mail.gmail.com> Message-ID: Hi Tim, The gnu.io namespace looks just like the javax.comm 2.0 namespace. There are additional (discouraged) undocumented methods in gnu.io that you need not use. We just used the different namespace to avoid poluting Sun's by mistake and to make sure we stayed off any potential licensing related radar. Usuaully, you just change your imports and make sure you do not use the javax.comm namespace for anything like exception handling. As I mentioned off the list, there are no issues with rxtx going through the JSR process to be more Sun friendly other than time. rxtx has no hidden intentions there; anything that does not work like CommAPI 2.0 documented is a bug. The reason we do not support CommAPI 2.1 is technical in nature and is in the list archives as well as the front page of www.rxtx.org. On Mon, 12 Nov 2007, Timothy Low wrote: > Hi Trent, > > I'll move to use a JDK1.5 64-bit version... but do I need to make any source > code changes to use the package (gnu.io) in the RTXTcomm.jar instead of the > ones from the javacomm api ? > > > Regards, > Tim > > On Nov 12, 2007 5:22 PM, Trent Jarvi wrote: > >> >> Hi Tim, >> >> I see a couple things here. >> >> First your jdk is for i686 yet the library is compiled on a x86_64 >> machine. You may try passing configure the --target=i686-unknown-linux to >> try using the i686 backend to gcc if it is available. Or move to the 64 >> bit jdk. >> >> The other error I see is again the moved UTF_RELEASE define that we need >> to fix. You can probably get around that with: >> >> make -DUTF_RELEASE=`uname -r` >> >> even more simple would be to just specify the serial library which should >> be in configure --help. >> >> You can remove the UTF_RELEASE check from configure by editing >> configure.in, searching for the simple C program check and deleting it. >> Running autoconf after that will regenerate a new configure without the >> check. >> >> Note that you should remove the previous native libraries >> (librxtxSerial.so) when moving from rxtx 2.0 to 2.1. These are compiled >> for different namespaces (javax.comm/gnu.io). >> >> On Mon, 12 Nov 2007, Timothy Low wrote: >> >>> *Hi Trent, >>> >>> I moved on to rxtx 2.1.7r2, and updated my jre to 1.6.0 (64-bit)... I >> tried >>> the following 2 methods: >>> >>> (1) using the rxtx 2.1.7 binaries from the RXTX website* >>> *Are these binaries suitable for a 64-bit OS ? There mentioning of the >>> gnu.io that you've talked about previously...* >>> ------ >>> [root at smsgateway sources]# java -Djava.library.path=/usr/lib PortLister >>> Experimental: JNI_OnLoad called. >>> >>> java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion >>> ()Ljava/lang/String; >>> at gnu.io.RXTXCommDriver.nativeGetVersion(Native Method) >>> at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:85) >>> at java.lang.Class.forName0(Native Method) >>> at java.lang.Class.forName(Unknown Source) >>> at javax.comm.CommPortIdentifier.loadDriver( >> CommPortIdentifier.java >>> :237) >>> at javax.comm.CommPortIdentifier.(CommPortIdentifier.java >>> :109) >>> at PortLister.(PortLister.java:6) >>> at PortLister.main(PortLister.java:25) >>> Exception in thread "main" java.lang.UnsatisfiedLinkError: >>> com.sun.comm.SunrayInfo.isSessionActive()Z >>> at com.sun.comm.SunrayInfo.isSessionActive(Native Method) >>> at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java >> :155) >>> at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java >>> :100) >>> at javax.comm.CommPortIdentifier.(CommPortIdentifier.java >>> :138) >>> at PortLister.(PortLister.java:6) >>> at PortLister.main(PortLister.java:25) >>> >>> ------ >>> >>> (2) compiling the rxtx 2.1.7 from source >>> *but i got the following error while running ./configure and make all* >>> >>> ------ >>> [root at smsgateway rxtx-2.1-7r2]# ./configure >>> checking build system type... x86_64-unknown-linux-gnu >>> checking host system type... x86_64-unknown-linux-gnu >>> checking target system type... x86_64-unknown-linux-gnu >>> configure: WARNING: Trying libtool. If the following fails install >> libtool >>> checking for gcc... gcc >>> checking for C compiler default output file name... a.out >>> checking whether the C compiler works... yes >>> checking whether we are cross compiling... no >>> checking for suffix of executables... >>> checking for suffix of object files... o >>> checking whether we are using the GNU C compiler... yes >>> checking whether gcc accepts -g... yes >>> checking for gcc option to accept ANSI C... none needed >>> checking for a sed that does not truncate output... /bin/sed >>> checking for egrep... grep -E >>> checking for ld used by gcc... /usr/bin/ld >>> checking if the linker (/usr/bin/ld) is GNU ld... yes >>> checking for /usr/bin/ld option to reload object files... -r >>> checking for BSD-compatible nm... /usr/bin/nm -B >>> checking whether ln -s works... yes >>> checking how to recognise dependent libraries... pass_all >>> checking how to run the C preprocessor... gcc -E >>> checking for ANSI C header files... yes >>> checking for sys/types.h... yes >>> checking for sys/stat.h... yes >>> checking for stdlib.h... yes >>> checking for string.h... yes >>> checking for memory.h... yes >>> checking for strings.h... yes >>> checking for inttypes.h... yes >>> checking for stdint.h... yes >>> checking for unistd.h... yes >>> checking dlfcn.h usability... yes >>> checking dlfcn.h presence... yes >>> checking for dlfcn.h... yes >>> checking for g++... g++ >>> checking whether we are using the GNU C++ compiler... yes >>> checking whether g++ accepts -g... yes >>> checking how to run the C++ preprocessor... g++ -E >>> checking for g77... no >>> checking for f77... no >>> checking for xlf... no >>> checking for frt... no >>> checking for pgf77... no >>> checking for fort77... no >>> checking for fl32... no >>> checking for af77... no >>> checking for f90... no >>> checking for xlf90... no >>> checking for pgf90... no >>> checking for epcf90... no >>> checking for f95... f95 >>> checking whether we are using the GNU Fortran 77 compiler... yes >>> checking whether f95 accepts -g... yes >>> checking the maximum length of command line arguments... 32768 >>> checking command to parse /usr/bin/nm -B output from gcc object... ok >>> checking for objdir... .libs >>> checking for ar... ar >>> checking for ranlib... ranlib >>> checking for strip... strip >>> checking if gcc static flag works... yes >>> checking if gcc supports -fno-rtti -fno-exceptions... no >>> checking for gcc option to produce PIC... -fPIC >>> checking if gcc PIC flag -fPIC works... yes >>> checking if gcc supports -c -o file.o... yes >>> checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking whether -lc should be explicitly linked in... no >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> checking if libtool supports shared libraries... yes >>> checking whether to build shared libraries... yes >>> checking whether to build static libraries... no >>> configure: creating libtool >>> appending configuration tag "CXX" to libtool >>> checking for ld used by g++... /usr/bin/ld -m elf_x86_64 >>> checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes >>> checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking for g++ option to produce PIC... -fPIC >>> checking if g++ PIC flag -fPIC works... yes >>> checking if g++ supports -c -o file.o... yes >>> checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> appending configuration tag "F77" to libtool >>> checking if libtool supports shared libraries... yes >>> checking whether to build shared libraries... yes >>> checking whether to build static libraries... no >>> checking for f95 option to produce PIC... -fPIC >>> checking if f95 PIC flag -fPIC works... yes >>> checking if f95 supports -c -o file.o... yes >>> checking whether the f95 linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> checking for a BSD-compatible install... /usr/bin/install -c >>> checking whether build environment is sane... yes >>> checking for gawk... gawk >>> checking whether make sets $(MAKE)... yes >>> checking for style of include used by make... GNU >>> checking dependency style of gcc... none >>> checking dependency style of g++... none >>> checking fcntl.h usability... yes >>> checking fcntl.h presence... yes >>> checking for fcntl.h... yes >>> checking sys/fcntl.h usability... yes >>> checking sys/fcntl.h presence... yes >>> checking for sys/fcntl.h... yes >>> checking sys/file.h usability... yes >>> checking sys/file.h presence... yes >>> checking for sys/file.h... yes >>> checking sys/time.h usability... yes >>> checking sys/time.h presence... yes >>> checking for sys/time.h... yes >>> checking sys/signal.h usability... yes >>> checking sys/signal.h presence... yes >>> checking for sys/signal.h... yes >>> checking signal.h usability... yes >>> checking signal.h presence... yes >>> checking for signal.h... yes >>> checking termios.h usability... yes >>> checking termios.h presence... yes >>> checking for termios.h... yes >>> checking grp.h usability... yes >>> checking grp.h presence... yes >>> checking for grp.h... yes >>> checking pwd.h usability... yes >>> checking pwd.h presence... yes >>> checking for pwd.h... yes >>> checking whether gcc needs -traditional... no >>> checking whether to enable maintainer-specific portions of Makefiles... >> no >>> /usr/java/jdk1.5.0_13 >>> configure: WARNING: using JAVA_HOME environmental variable >>> adjusted java.home is /usr/java/jdk1.5.0_13 >>> checking os.name Linux >>> checking os.arch i386 >>> checking java.vendor Sun Microsystems Inc. >>> checking java.version 1.5.0_13 >>> checking os.version 2.6.18-8.el5xen >>> conftest.c: In function 'main': >>> conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this >> function) >>> conftest.c:8: error: (Each undeclared identifier is reported only once >>> conftest.c:8: error: for each function it appears in.) >>> conftest.c:8: error: expected ')' before string constant >>> ./configure: line 21462: ./conftest: No such file or directory >>> ./configure: line 21462: test: 2.6.18-8.el5xen: unary operator expected >>> configure: creating ./config.status >>> config.status: creating Makefile >>> config.status: creating config.h >>> config.status: executing depfiles commands >>> [root at smsgateway rxtx-2.1-7r2]# make install >>> /usr/java/jdk1.5.0_13/bin/javac -classpath .:/home/jboss/sources/rxtx- >>> >> 2.1-7r2:/home/jboss/sources/rxtx-2.1-7r2/src:/usr/java/jdk1.5.0_13/jre/lib/ext/RXTXcomm.jar-d >>> /home/jboss/sources/rxtx- >>> 2.1-7r2/ -O -source 1.3 -target 1.3 >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommDriver.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortEnumerator.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortIdentifier.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortOwnershipListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Configure.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2C.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/I2CPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/LPRPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/NoSuchPortException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/PortInUseException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Raw.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/RawPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RawPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RawPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/RS485PortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485PortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485Port.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXCommDriver.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXVersion.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPort.java >>> /home/jboss/sources/rxtx-2.1-7r2 >> /./src/UnsupportedCommOperationException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/UnSupportedLoggerException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Zystem.java >>> /usr/java/jdk1.5.0_13/bin/javah -classpath .:/home/jboss/sources/rxtx- >>> >> 2.1-7r2:/home/jboss/sources/rxtx-2.1-7r2/src:/usr/java/jdk1.5.0_13/jre/lib/ext/RXTXcomm.jar-d >>> x86_64-unknown-linux-gnu -jni `(for i in CommDriver CommPortEnumerator >>> CommPortIdentifier CommPort CommPortOwnershipListener Configure I2C >>> I2CPortEvent I2CPortEventListener I2CPort LPRPort NoSuchPortException >>> ParallelPortEvent ParallelPortEventListener ParallelPort >> PortInUseException >>> Raw RawPortEvent RawPortEventListener RawPort RS485 RS485PortEvent >>> RS485PortEventListener RS485Port RXTXCommDriver RXTXPort RXTXVersion >>> SerialPortEvent SerialPortEventListener SerialPort >>> UnsupportedCommOperationException UnSupportedLoggerException Zystem;do \ >>> if grep > /dev/null native.*\( /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/$i.java; then \ >>> echo gnu.io.$i; \ >>> fi; \ >>> done)` >>> /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialImp.c -o >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo; >>> \ >>> if [ "Serial" = "Serial" ]; >>> then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxSerial.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxSerial.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo; >> \ >>> fi; \ >>> ) >>> mkdir /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/.libs >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/SerialImp.o >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/fuserImp.o >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c: In function >> 'show_user': >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c:238: warning: cast >> from >>> pointer to integer of different size >>> gcc -shared /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/SerialImp.o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/fuserImp.o >>> -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7.so -o >> .libs/librxtxSerial- >>> 2.1-7.so >>> (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.1-7.so >>> librxtxSerial.so) >>> creating librxtxSerial.la >>> (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la >>> librxtxSerial.la) >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelImp.c -o >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/ParallelImp.lo; >>> \ >>> if [ "Parallel" = "Serial" ]; >>> then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxParallel.la -rpath >>> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/ParallelImp.lo >>> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxParallel.la -rpath >>> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/ParallelImp.lo; >>> \ >>> fi; \ >>> ) >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >>> /x86_64-unknown-linux-gnu/.libs/ParallelImp.o >>> gcc -shared /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/ParallelImp.o >>> -lpthread -Wl,-soname -Wl,librxtxParallel-2.1-7.so -o >>> .libs/librxtxParallel-2.1-7.so >>> (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.1-7.so >>> librxtxParallel.so) >>> creating librxtxParallel.la >>> (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la >>> librxtxParallel.la) >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo; >>> \ >>> if [ "I2C" = "Serial" ]; then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxI2C.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo >>> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxI2C.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo; >>> \ >>> fi; \ >>> ) >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/.libs/I2CImp.o >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c: In function >>> 'Java_gnu_io_I2CPort_Initialize': >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: 'UTS_RELEASE' >>> undeclared (first use in this function) >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: (Each >> undeclared >>> identifier is reported only once >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: for each >> function >>> it appears in.) >>> libtool: link: `/home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/I2CImp.lo' >>> is not a valid libtool object >>> make: *** [x86_64-unknown-linux-gnu/librxtxI2C.la] Error 1 >>> >>> ------ >>> >>> >>> >>> On Nov 12, 2007 4:02 PM, Trent Jarvi wrote: >>> >>>> On Mon, 12 Nov 2007, Timothy Low wrote: >>>>> >>>>> Hi Trent, >>>> >>>> Hi Tim, >>>> >>>> Comments are inline. As I mentioned off the list, rxtx 2.0 is on the >> edge >>>> of deprecation. We can get it working but this is not the path of >> least >>>> resistance for future work. >>>> >>>> You will probably need to bounce another round of questions off the >> list. >>>> The following is intended to isolate the problem. >>>> >>>>> >>>>> I tried building RXTX from source, and I got this error. >>>>> >>>>> >>>>> I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm >>>> trying >>>>> to get the necessary ".so" files to use for my serial port >> communication >>>>> through java. >>>>> My linux kernal information is: >>>>> >>>>> *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 >>>> x86_64 >>>>> x86_64 x86_64 GNU/Linux* >>>>> >>>>> I'll most glad if you can provide me some direction on this. Thanks ! >>>>> >>>>> ---------------- >>>>> [root at smsgateway rxtx-2.0-7pre1]# ./configure >>>>> checking build system type... x86_64-unknown-linux-gnu >>>>> checking host system type... x86_64-unknown-linux-gnu >>>>> checking target system type... x86_64-unknown-linux-gnu >>>>> configure: WARNING: Trying libtool. If the following fails install >>>> libtool >>>>> checking for gcc... gcc >>>>> checking for C compiler default output... a.out >>>>> checking whether the C compiler works... yes >>>>> checking whether we are cross compiling... no >>>>> checking for suffix of executables... >>>>> checking for suffix of object files... o >>>>> checking whether we are using the GNU C compiler... yes >>>>> checking whether gcc accepts -g... yes >>>>> checking for gcc option to accept ANSI C... none needed >>>>> checking for ld used by GCC... /usr/bin/ld >>>>> checking if the linker (/usr/bin/ld) is GNU ld... yes >>>>> checking for /usr/bin/ld option to reload object files... -r >>>>> checking for BSD-compatible nm... /usr/bin/nm -B >>>>> checking for a sed that does not truncate output... /bin/sed >>>>> checking whether ln -s works... yes >>>>> checking how to recognise dependent libraries... pass_all >>>>> checking command to parse /usr/bin/nm -B output... ok >>>>> checking how to run the C preprocessor... gcc -E >>>>> checking for egrep... grep -E >>>>> checking for ANSI C header files... yes >>>>> checking for sys/types.h... yes >>>>> checking for sys/stat.h... yes >>>>> checking for stdlib.h... yes >>>>> checking for string.h... yes >>>>> checking for memory.h... yes >>>>> checking for strings.h... yes >>>>> checking for inttypes.h... yes >>>>> checking for stdint.h... yes >>>>> checking for unistd.h... yes >>>>> checking dlfcn.h usability... yes >>>>> checking dlfcn.h presence... yes >>>>> checking for dlfcn.h... yes >>>>> checking for ranlib... ranlib >>>>> checking for strip... strip >>>>> checking for objdir... .libs >>>>> checking for gcc option to produce PIC... -fPIC >>>>> checking if gcc PIC flag -fPIC works... yes >>>>> checking if gcc static flag -static works... yes >>>>> checking if gcc supports -c -o file.o... yes >>>>> checking if gcc supports -c -o file.lo... yes >>>>> checking if gcc supports -fno-rtti -fno-exceptions... yes >>>>> checking whether the linker (/usr/bin/ld) supports shared libraries... >>>> yes >>>>> checking how to hardcode library paths into programs... immediate >>>>> checking whether stripping libraries is possible... yes >>>>> checking dynamic linker characteristics... GNU/Linux ld.so >>>>> checking if libtool supports shared libraries... yes >>>>> checking whether to build shared libraries... yes >>>>> checking whether to build static libraries... no >>>>> checking whether -lc should be explicitly linked in... no >>>>> creating libtool >>>>> checking for a BSD-compatible install... /usr/bin/install -c >>>>> checking whether build environment is sane... yes >>>>> checking for gawk... gawk >>>>> checking whether make sets $(MAKE)... yes >>>>> checking for style of include used by make... GNU >>>>> checking dependency style of gcc... none >>>>> checking fcntl.h usability... yes >>>>> checking fcntl.h presence... yes >>>>> checking for fcntl.h... yes >>>>> checking sys/fcntl.h usability... yes >>>>> checking sys/fcntl.h presence... yes >>>>> checking for sys/fcntl.h... yes >>>>> checking sys/file.h usability... yes >>>>> checking sys/file.h presence... yes >>>>> checking for sys/file.h... yes >>>>> checking sys/time.h usability... yes >>>>> checking sys/time.h presence... yes >>>>> checking for sys/time.h... yes >>>>> checking sys/signal.h usability... yes >>>>> checking sys/signal.h presence... yes >>>>> checking for sys/signal.h... yes >>>>> checking signal.h usability... yes >>>>> checking signal.h presence... yes >>>>> checking for signal.h.. . yes >>>>> checking termios.h usability... yes >>>>> checking termios.h presence... yes >>>>> checking for termios.h... yes >>>>> checking asm/termbits.h usability... yes >>>>> checking asm/termbits.h presence... yes >>>>> checking for asm/termbits.h... yes >>>>> checking grp.h usability... yes >>>>> checking grp.h presence... yes >>>>> checking for grp.h... yes >>>>> checking pwd.h usability... yes >>>>> checking pwd.h presence... yes >>>>> checking for pwd.h... yes >>>>> checking whether gcc needs -traditional... no >>>>> checking whether to enable maintainer-specific portions of >> Makefiles... >>>> no >>>>> /usr/java/jdk1.5.0_13 >>>>> configure: WARNING: using JAVA_HOME environmental variable >>>>> adjusted java.home is /usr/java/jdk1.5.0_13 >>>>> checking os.name Linux >>>>> checking os.arch i386 >>>>> checking java.vendor Sun Microsystems Inc. >>>>> checking java.version 1.5.0_13 >>>>> checking os.version 2.6.18-8.el5xen >>>>> comm.jar appears to be installed already. >>>>> conftest.c: In function 'main': >>>>> conftest.c:6: warning: incompatible implicit declaration of built-in >>>>> function 'printf' >>>>> conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this >>>> function) >>>>> conftest.c:6: error: (Each undeclared identifier is reported only once >>>>> conftest.c:6: error: for each function it appears in.) >>>>> conftest.c:6: error: expected ')' before string constant >>>> >>>> >>>> This is an outdated kernel version check for when headers and kernels >>>> could cause problems for rxtx. If we made it past this, then you are >> OK. >>>> >>>> >>>>> conftest.c:7: warning: incompatible implicit declaration of built-in >>>>> function 'exit' >>>>> ./configure: line 9649: ./conftest: No such file or directory >>>>> ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected >>>> >>>> It blew up but continues.. >>>> >>>>> conftest.c: In function 'main': >>>>> conftest.c:5: warning: incompatible implicit declaration of built-in >>>>> function 'printf' >>>>> conftest.c:10: warning: incompatible implicit declaration of built-in >>>>> function 'exit' >>>>> configure: creating ./config.status >>>>> config.status: creating Makefile >>>>> config.status: creating config.h >>>>> config.status : config.h is unchanged >>>>> config.status: executing depfiles commands >>>>> [root at smsgateway rxtx-2.0-7pre1]# make install >>>>> /usr/java/jdk1.5.0_13/bin/javac -classpath >>>>> .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/ -O >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1 >> /./src/UnSupportedLoggerException.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java >>>>> Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or >>>>> overrides a deprecated API. >>>>> Note: Recompile with -Xlint:deprecation for details. >>>>> /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* >>>> >>>> >>>> The java jar should be fine now. You may need to change the source >> files >>>> as mentioned below. >>>> >>>>> gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu >> -I. >>>>> -I/usr/java/jdk1.5.0_13/include >> -I/usr/java/jdk1.5.0_13/include/./linux/ >>>> -g >>>>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o >>>>> /home/jboss/sources/rxtx-2.0-7pre1 >> /x86_64-unknown-linux-gnu/SerialImp.lo >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'init_threads': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: >>>> cast >>>>> from pointer to integer of different size >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_nativeDrain': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: >>>> cast to >>>>> pointer from integer of different size >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'read_byte_array': >>>>> /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: >>>> cast to >>>>> pointer from integer of different size >>>> >>>> >>>> As I recall, this was caused by pointers (now 64 bit rather than 32 >> bit) >>>> being stored in java ints (jints). I would look at the diff between >> the >>>> CVS 2.1 SerialImp.c and RXTXPort.java files against 2.0. We >>>> did fix those issues. >>>> >>>> You have a .so file but the different pointer sizes will cause runtime >>>> errors. >>>> >>>> >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_readArray': >>>>> /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: >>>>> comparison is always false due to limited range of data type >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_readTerminatedArray': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: >>>>> comparison is always false due to limited range of data type >>>>> mkdir .libs >>>>> rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* >> .libs/librxtxSerial- >>>>> 2.0.7pre1.* >>>>> gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so-o >>>>> .libs/librxtxSerial-2.0.7pre1.so >>>>> (cd .libs && rm -f librxtxSerial.so && ln -s >> librxtxSerial-2.0.7pre1.so >>>>> librxtxSerial.so) >>>>> creating librxtxSerial.la >>>>> (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la >>>>> librxtxSerial.la) >>>>> gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu >> -I. >>>>> -I/usr/java/jdk1.5.0_13/include >> -I/usr/java/jdk1.5.0_13/include/./linux/ >>>> -g >>>>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o >>>>> /home/jboss/sources/rxtx- 2.0-7pre1 >>>> /x86_64-unknown-linux-gnu/ParallelImp.lo >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function >>>>> 'Java_javax_comm_LPRPort_readArray': >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: >>>>> comparison is always false due to limited range of data type >>>>> rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* >>>>> .libs/librxtxParallel-2.0.7pre1.* >>>>> gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so-o >>>>> .libs/librxtxParallel- 2.0.7pre1.so >>>>> (cd .libs && rm -f librxtxParallel.so && ln -s >>>> librxtxParallel-2.0.7pre1.so >>>>> librxtxParallel.so) >>>>> creating librxtxParallel.la >>>>> (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la >>>>> librxtxParallel.la) >>>>> make all-am >>>>> make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' >>>>> make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' >>>>> libtool: install: `x86_64-unknown-linux-gnu' must be an absolute >>>> directory >>>>> name >>>>> Try `libtool --help --mode=install' for more information. >>>>> make: *** [install] Error 1 >>>> >>>> A libtool change? Assuming you ran configure && make install in >>>> /home/jboss/sources/rxtx- 2.0-7pre1, libtool is looking for >>>> /home/jboss/sources/rxtx- >>>> 2.0-7pre1/x86_64-unknown-linux-gnu/.libs/librxtxSerial-2.0.7pre1.so. >>>> >>>> I think you have this? The file is just being copied to >>>> ~JAVA/jre/lib/$(JAVA_ARCH). >>>> >>>> -- >>>> Trent Jarvi >>>> tjarvi at qbang.org >>>> >>> >> > From guido.vogt at celsi.ch Tue Nov 13 00:28:01 2007 From: guido.vogt at celsi.ch (Guido Vogt) Date: Tue, 13 Nov 2007 08:28:01 +0100 Subject: [Rxtx] RTS Line can't be set Message-ID: <47395201.1050400@celsi.ch> I'm working on an Windows XP /SP2 System. Version of RXTX: 2.1.7. The serial line is connected to a modem. As I can see, the RTS-Line of the serial Port is inactive, when the port is opened (flowcontrol=none). Obviously, no data is coming from the modem. If I use the setRTS(true) command after open, the comport does not send out my data any more. This behaviour is regardless of flowcontrol. Anybody has an idea what do do? Thanks for help. From Martin.Oberhuber at windriver.com Tue Nov 13 08:58:23 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 13 Nov 2007 16:58:23 +0100 Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803880918@ism-mail03.corp.ad.wrs.com> Hi Trent, as said before, I like the idea of discussing such quality engineering issues, but why hide these away from the rest of the public? Anyways, if you do want to create a new mailing list for these kinds of things I'll happily subscribe. 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: Sunday, November 11, 2007 1:46 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: RE: [Rxtx] Quality Engineering with rxtx > > On Mon, 5 Nov 2007, Oberhuber, Martin wrote: > > > Hi Trent, > > > > are the interestes of hobbyists really so different > > from commercial ones? Both should be interested in > > high quality and innovation the like. > > > > I haven't seen too many Open Source projects from the > > "inside" but those that I have seen did not have > > separate mailing lists for quality/testing/qa > > versus innovation/development. > > > > What I have seen with the Open Source projects that > > one would call "successful" is a good deal of > > process around automated builds, automated unit > > tests, predictable release dates and milestones, > > and policies around commiting/contributing/reviewing > > changes. > > > > I think that all of these benefit commercial users > > and hobbyists the like. > > > > If you were just asking about who's interested in > > discussing changes to foster more quality, count > > me in. I'm just not sure whether discussing these > > on a separate mailing list or other channel is the > > right thing to do. > > > > Hi Martin, > > There are two issues I'm thinking about. The first is the > generic unit > testing and quality initiatives required to move rxtx > forward. The second > is the inevitable fact that rxtx connects to external hardware. The > discussion deals with a different set of problems. > > Here is a simple example of what I'm getting at. > > We have the capability of setting custom baud rates in rxtx. > We may be > interested in seeing regressions in rxtx, the C library or > the kernel. > Some people may be doing some tests with loopback > connections. These will > always work even if the baud rate is not set to the expected > value. Some > people may use null modems between two ports. This may be > able to catch > the problem but not always. > > Will the build machines be able to test this? (no - for a few reasons) > Will people be trying to catch these type of regressions? (yes) > What type of coverage does the community have in the end? (?) > > We could include the discussions in the same list or another > equally open > list that may be of interest to some folks that deal with > these types of > problems on a regular basis. > > -- > Trent Jarvi > tjarvi at qbang.org > From toupsz at cs.tamu.edu Tue Nov 13 10:33:03 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 13 Nov 2007 11:33:03 -0600 Subject: [Rxtx] [urgent] device's power off detection In-Reply-To: <4738F546.5010101@gatworks.com> References: <766782.10076.qm@web55803.mail.re3.yahoo.com> <4738F546.5010101@gatworks.com> Message-ID: Lacking any other specification on it...but can you set up the device to notify your software when it turns off? Send a message or somesuch? Maybe it can signal using RTS or DTR? -Zach On Nov 12, 2007 6:52 PM, U. George wrote: > Not sure what u are asking for. Are u asking for a way to detect if the > device is OFF? Are u asking how to power off the device - via software ? > Is it a Serial device? > is it a parallel device? > is it a usb device? > > Sara Hugh wrote: > > Hello all, > > I have a small application built on top of rxtx api. This application > > can retrieve the incoming data from a device through a port. The device > > can be powered off after the port get closed from the application. I > > have been trying a couple of hours to find a way to detect the power > > switching from device. If anyone knows how to handle it through rxtx, > > could you please give me a help? Thank you very much. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071113/e5859e4d/attachment-0021.html From tjarvi at qbang.org Tue Nov 13 20:02:03 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 13 Nov 2007 20:02:03 -0700 (MST) Subject: [Rxtx] #ifndef TIOCSERGETLSR In-Reply-To: <472E3AAF.7050709@gatworks.com> References: <472E3AAF.7050709@gatworks.com> Message-ID: On Sun, 4 Nov 2007, U. George wrote: > For Linux, it seems that you need the code for both *having* a > TIOCSERGETLSR, and *not having* a TIOCSERGETLSR. Maybe the ioctl exists > system wide, but not necessarily for the device driver itself ( always > returns -1 ) . > > Are there systems that have a *functioning* TIOCSERGETLSR for all their > devices? Then this would be the case where the "#ifndef TIOCSERGETLSR" > directive could be useful is eliminating the unnecessary code and tests. > > And for those systems that dont have a TIOCSERGETLSR, then the code for > TIOCSERGETLSR can be eliminated. > > It would be a simple case to have, as a foundation, all the code to > simulate the missing TIOCSERGETLSR ioctl. If the system does have the > ioctl, then that code can be ifdef'd in, and co-exist with the > functionality of the code that simulates the missing TIOCSERGETLSR ioctl. > Ah, there is the post. Sorry I was on vacation. Hi George, Yes there are systems that have functioning TIOCSERGETLSR for all of their devices. These are machines that just use traditional UARTs. If you mean operating systems, then probably not. Let me explain a bit about the history of those #ifdefs to help clear up a mess. RXTX aims to follow POSIX. TIOCSERGETLSR turns out to not be POSIX at all as I understand. It isn't in BSD, Solaris, AIX or HP-UX. It certainly provides access to important information. I assumed it was standard when I coded rxtx on a Linux system. Ya, laugh. Then I looked at Win32.. Oh you are still laughing? ..I could not navigate msft's web site at the time [still can't really find anything today]. So google pointed me to someones 'reverse documentation' of the w32 API and an example msft put together back in the win3.0 days. It was enough but maybe not 100% correct. They covered overlapped IO which was important for events in rxtx. Looking at Win32 and Linux, it made sense to implement TIOCSERGETLSR for win32 with the way rxtx works. That was how things matched up. But when I got feedback about other systems, it didn't match up. When people used multiport cards with money saving designs in Linux, it didn't match up. And today, there are drivers for unusual serial ports that don't match up. Now we have some ugly logic that mostly works for most serial ports. It isn't right though. The important aspect of TIOSERGETLSR is knowing when the output is really gone. But POSIX tcdrain tells us the same thing. So there is logic in the ifdefs to match that up as you suggest. Perhaps a more formal solution along those lines would be worth looking into. I would suggest the roles should be switched though. We should use POSIX calls on all systems and hide things that don't work on everything like we have with other undocumented calls. TIOSERGETLSR is nice and would be great if it was standard. It isn't as far as I can tell. In the end, many people write Java code because they want portability. The TIOSERGETLSR does not really fit. In someways, this is limiting to the least common denominator which is Solaris if you have seen it's serial kernel driver code. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 15 09:10:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 15 Nov 2007 17:10:59 +0100 Subject: [Rxtx] RXTX blocking on unconnected virtual port Message-ID: <460801A4097E3D4CA04CC64EE648584803919080@ism-mail03.corp.ad.wrs.com> Hello, we came across the following issue: * Set up a virtual serial port, e.g. with com0com: http://com0com.sourceforge.net/ * Connect RXTX to one end, e.g. cnc1a * Do not connect the other end, e.g. cnc1b * Have RXTX write data to the port --> Since the data is not being read, RXTX blocks - RXTXPort.SerialOutputStream.write increases the RXTXPort.IOLocked variable - it then calls the native writeByte or writeArray method (which blocks) closing the RXTXPort hangs for ever too: - RXTXPort.close() has a while( IOLocked > 0 ) {..Thread.sleep(500);...} which spins for ever ==> once the communication hangs, it cannot recover. Has anybody else seen such a problem before, or even got an idea how to solve it? When I connect Hyperterminal to the same half-open port, and type a character, it hangs for about 3 seconds but then times out and is available again. I guess that's what I'd like to see in RXTX as well, with a (configurable) timeout. Our big problem with the current situation is that once RXTX gets stuck, there is nothing at all we can do to make it go live again - that's why our original workaround of writing to the port in a background thread is not good enough. For more background information, the issue is being tracked in https://bugs.eclipse.org/bugs/show_bug.cgi?id=208185 Thanks for any hints or ideas, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Sun Nov 18 09:43:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 09:43:26 -0700 (MST) Subject: [Rxtx] PortInUseException - Cannot close and reopen serial port In-Reply-To: <460801A4097E3D4CA04CC64EE64858480351C711@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858480351C711@ism-mail03.corp.ad.wrs.com> Message-ID: These have been submitted to CVS and the bugzilla entries have been changed to reflect the changes. ChangeLog: find ports which were added after program startup on Mac OS X. Martin Oberhuber http://bugzilla.qbang.org/show_bug.cgi?id=48 Clean up CommPort Ownership code, avoid possible deadlocks, fix lost commport ownership events. http://bugzilla.qbang.org/show_bug.cgi?id=83 Martin Oberhuber On Wed, 24 Oct 2007, Oberhuber, Martin wrote: > 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) > > > > > > > > > > > > > > > From tjarvi at qbang.org Sun Nov 18 09:45:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 09:45:39 -0700 (MST) Subject: [Rxtx] PortInUseException - Cannot close and reopen serial port In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848020CAF26@ism-mail03.corp.ad.wrs.com> Message-ID: The current CVS code should have all the entries. With version information, I usually do not change the version until we tag and release a zip file. Any feedback would be appreciated. On Wed, 27 Jun 2007, Greg Johnson wrote: > 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) >> >> >> >> >> > From tjarvi at qbang.org Sun Nov 18 13:51:27 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 13:51:27 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs Message-ID: The following bugs have been closed and CVS updated as needed: CommPortIdentifier.getPortIdentifier throws NoSuchPortException http://bugzilla.qbang.org/show_bug.cgi?id=48 CommPortOwnership events not sent http://bugzilla.qbang.org/show_bug.cgi?id=83 JVM 1.6 builds http://bugzilla.qbang.org/show_bug.cgi?id=84 I'd like to give Martin Oberhuber CVS write access. He has been doing a great job of pushing safe patches into rxtx. I'll be preparing seperate patches for the changes I have and submitting them to the list. I'll need to work with George to do a couple things: 1) break the patch into smaller pieces to isolate issues for discussion. 2) work through the Line Status Register changes so it does not cause problems on other systems. George: If you could do the first one, it would be greatly appreciated. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Nov 18 15:33:36 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 15:33:36 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: Message-ID: I'm not running any tests at this point, I'm trying to apply the small safe patches and make sure everything is compiling. As mentioned at the bottom, there are 3 patches + the USB fix posted here that need more review before accepting. The following bugs have been closed and CVS updated as needed. Most of these are already in CVS. The diff will be small. configure script failed at line UTS_RELEASE megov http://bugzilla.qbang.org/show_bug.cgi?id=80 code cleanup patch (extra ';' creates bug for if statements + new String() calls removed) Xavier Le Vourch http://bugzilla.qbang.org/show_bug.cgi?id=77 Wont compile on linux ppc with glibc 2.5 - no sys/io.h Brian Johnson http://bugzilla.qbang.org/show_bug.cgi?id=72 rxtx overwrites System properties Andrew Gillett Nektarios K. Papadopoulos Neboj??a http://bugzilla.qbang.org/show_bug.cgi?id=64 Solaris ACM port support Dave Cleal http://bugzilla.qbang.org/show_bug.cgi?id=59 Setting of non-standard baud rate fails. Andrew Prunicki http://bugzilla.qbang.org/show_bug.cgi?id=58 RXTX uses lockfiles on MacOS X (instead of ioctl TIOCEXCL) Joachim Buechse http://bugzilla.qbang.org/show_bug.cgi?id=50 JavaDoc fixes Joachim Buechse http://bugzilla.qbang.org/show_bug.cgi?id=49 I need to further review the following: http://bugzilla.qbang.org/show_bug.cgi?id=53 http://bugzilla.qbang.org/show_bug.cgi?id=46 http://bugzilla.qbang.org/show_bug.cgi?id=41 On Sun, 18 Nov 2007, Trent Jarvi wrote: > > The following bugs have been closed and CVS updated as needed: > > CommPortIdentifier.getPortIdentifier throws NoSuchPortException > http://bugzilla.qbang.org/show_bug.cgi?id=48 > CommPortOwnership events not sent > http://bugzilla.qbang.org/show_bug.cgi?id=83 > JVM 1.6 builds > http://bugzilla.qbang.org/show_bug.cgi?id=84 > > I'd like to give Martin Oberhuber CVS write access. He has been doing a > great job of pushing safe patches into rxtx. > > I'll be preparing seperate patches for the changes I have and submitting > them to the list. > > I'll need to work with George to do a couple things: > > 1) break the patch into smaller pieces to isolate issues for discussion. > 2) work through the Line Status Register changes so it does not cause > problems on other systems. > > George: If you could do the first one, it would be greatly appreciated. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From netbeans at gatworks.com Sun Nov 18 16:20:02 2007 From: netbeans at gatworks.com (U. George) Date: Sun, 18 Nov 2007 18:20:02 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: Message-ID: <4740C8A2.6030908@gatworks.com> > I'll need to work with George to do a couple things: > > 1) break the patch into smaller pieces to isolate issues for discussion. > 2) work through the Line Status Register changes so it does not cause > problems on other systems. > > George: If you could do the first one, it would be greatly appreciated. there are ( probably ) 3 pieces: 1) the select() failure when the USB-serial device is unceremoniously unplugged ( causes rxtx to spin ) 2) TIOCSERGETLSR, need to have the simulation of it available for all os's . If the system has the capability, don't simulate for devices that have the capability. For devices that dont have the capability, but the OS still defines TIOCSERGETLSR, fall back to simulation. 3) I rearranged DEBUG ifdef's. This is probably the bulk of the patches. From tjarvi at qbang.org Sun Nov 18 18:26:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 18:26:26 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <4740C8A2.6030908@gatworks.com> References: <4740C8A2.6030908@gatworks.com> Message-ID: On Sun, 18 Nov 2007, U. George wrote: > >> I'll need to work with George to do a couple things: >> >> 1) break the patch into smaller pieces to isolate issues for discussion. >> 2) work through the Line Status Register changes so it does not cause >> problems on other systems. >> >> George: If you could do the first one, it would be greatly appreciated. > > there are ( probably ) 3 pieces: > 1) the select() failure when the USB-serial device is unceremoniously > unplugged ( causes rxtx to spin ) > 2) TIOCSERGETLSR, need to have the simulation of it available for all os's . > If the system has the capability, don't simulate for devices that have the > capability. For devices that dont have the capability, but the OS still > defines TIOCSERGETLSR, fall back to simulation. > 3) I rearranged DEBUG ifdef's. This is probably the bulk of the patches. > Hi George, I suspect if you do cvs update, there will be very few conflicts if any. While the list of fixes is fairly long, the changes are small. -- Trent Jarvi tjarvi at qbang.org From EdwardRF at xtremax.com Mon Nov 19 03:32:29 2007 From: EdwardRF at xtremax.com (Edward) Date: Mon, 19 Nov 2007 18:32:29 +0800 Subject: [Rxtx] Cannot Read under Windows XP Message-ID: <4741663D.4070200@xtremax.com> Hi Guys, I have a iTegno 3000 usb GSM modem, it is an usb-serial device. I am trying to use RXTX with it under Windows XP. The problem is it seems RXTX cannot read any data from it, but writing to it seems successful. I blindly issue a series of command to send off a SMS, it is successfully delivered, but neither the echo from the modem nor the "OK" response was received. I tried to connect to the modem directly using hyper terminal, there was no problem reading or writing. So can i assume it is not the driver problem? Then i turned to Serial Port Monitor for help, when I use hyper terminal, monitor shows both way traffic, and nothing abnormal, but when I connect using RXTX, only the data I sent to the modem is being detected, no input was detected. Does anyone else experience similar problem? Best Regards Edward From tjarvi at qbang.org Mon Nov 19 03:38:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Nov 2007 03:38:02 -0700 (MST) Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: <4741663D.4070200@xtremax.com> References: <4741663D.4070200@xtremax.com> Message-ID: On Mon, 19 Nov 2007, Edward wrote: > Hi Guys, > > I have a iTegno 3000 usb GSM modem, it is an usb-serial device. I am > trying to use RXTX with it under Windows XP. > The problem is it seems RXTX cannot read any data from it, but writing > to it seems successful. I blindly issue a series of command to send off > a SMS, it is successfully delivered, but neither the echo from the modem > nor the "OK" response was received. > > I tried to connect to the modem directly using hyper terminal, there was > no problem reading or writing. So can i assume it is not the driver problem? > > Then i turned to Serial Port Monitor for help, when I use hyper > terminal, monitor shows both way traffic, and nothing abnormal, but when > I connect using RXTX, only the data I sent to the modem is being > detected, no input was detected. > > Does anyone else experience similar problem? > Hi Edward, A common mistake is to send Strings to the modem which are i18n. You want to send the bytes. Examples of doing this are in the contrib directory with the sourcecode. ie SimpleSnuV1.java -- Trent Jarvi tjarvi at qbang.org From EdwardRF at xtremax.com Mon Nov 19 04:42:16 2007 From: EdwardRF at xtremax.com (Edward) Date: Mon, 19 Nov 2007 19:42:16 +0800 Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: References: <4741663D.4070200@xtremax.com> Message-ID: <47417698.3060705@xtremax.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071119/b0f08ba9/attachment-0016.html From netbeans at gatworks.com Mon Nov 19 06:31:30 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 19 Nov 2007 08:31:30 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: <4740C8A2.6030908@gatworks.com> Message-ID: <47419032.8080406@gatworks.com> Did the "make install". The install does not want to go to or use Makefiles's prefix = /usr/local/rxtx-devel Not terribly happy that it installed in /home/gat/JAVA/JDK14/j2sdk1.4.2_08/jre/lib/i386 Trent Jarvi wrote: > > I suspect if you do cvs update, there will be very few conflicts if any. > While the list of fixes is fairly long, the changes are small. > > -- > Trent Jarvi > tjarvi at qbang.org > > From Martin.Oberhuber at windriver.com Mon Nov 19 07:00:48 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 19 Nov 2007 15:00:48 +0100 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE6485848039986E6@ism-mail03.corp.ad.wrs.com> It's great to see things progressing - thanks Trent! I checked CVS, and it seems that most of the patch authors are yet missing from the AUTHORS file, is this intentional? The issues areound RXTXPort.close() are interesting for us in the context of Eclipse as well: https://bugs.eclipse.org/bugs/show_bug.cgi?id=208185#c3 I did a quick review and found some issues / comments: http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 http://bugzilla.qbang.org/show_bug.cgi?id=53#c9 Thanks for proposing CVS write access for me. I promise to use these thoughtfully, and discuss potential fixes openly (on bugzilla) before applying them [unless it's really trivial issues only like obvious Javadoc syntax or spelling errors]. Cheers, -- 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 Mon Nov 19 07:24:16 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 19 Nov 2007 15:24:16 +0100 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803998711@ism-mail03.corp.ad.wrs.com> Hi all, I think I've got a better version for RXTXCommDriver.checkSolaris(): http://bugzilla.qbang.org/show_bug.cgi?id=77#c3 Cheers, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From netbeans at gatworks.com Mon Nov 19 09:01:22 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 19 Nov 2007 11:01:22 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <47419032.8080406@gatworks.com> References: <4740C8A2.6030908@gatworks.com> <47419032.8080406@gatworks.com> Message-ID: <4741B352.8070205@gatworks.com> U. George wrote: > Did the "make install". The install does not want to go to or use > Makefiles's prefix = /usr/local/rxtx-devel > > Not terribly happy that it installed in > /home/gat/JAVA/JDK14/j2sdk1.4.2_08/jre/lib/i386 > Put libs and jar in MY preferential places. Ran application. And it loves to spin. Deja gnu all over again. :-/ It did find the avail /dev/ttyUSB0 port connected to LINUX usbserial/pl2303 device driver. Now to find the spin. and apply simpler set of patches From tjarvi at qbang.org Mon Nov 19 10:14:38 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Nov 2007 10:14:38 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <4741B352.8070205@gatworks.com> References: <4740C8A2.6030908@gatworks.com> <47419032.8080406@gatworks.com> <4741B352.8070205@gatworks.com> Message-ID: On Mon, 19 Nov 2007, U. George wrote: > U. George wrote: >> Did the "make install". The install does not want to go to or use >> Makefiles's prefix = /usr/local/rxtx-devel >> >> Not terribly happy that it installed in >> /home/gat/JAVA/JDK14/j2sdk1.4.2_08/jre/lib/i386 >> > Put libs and jar in MY preferential places. Ran application. And it loves to > spin. Deja gnu all over again. :-/ > > It did find the avail /dev/ttyUSB0 port connected to LINUX usbserial/pl2303 > device driver. > > Now to find the spin. and apply simpler set of patches > Hi George, When the prefix code was stomped on and the library was installed in the jre, It wasnt clear how the layout would end up looking. I'm still not sure. My usual attack was to dump a jdk onto the filesystem, set JAVA_HOME and install. When I was done, I would nuke the jdk. Obviously that may not be what people want but I'm not sure a prefix is enough to let us know what they do want. For a shared library prefix /usr/local means the library goes in /usr/local/lib. What would it mean for the jar and shared library in Java? -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Nov 19 10:24:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Nov 2007 10:24:08 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <460801A4097E3D4CA04CC64EE6485848039986E6@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848039986E6@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 19 Nov 2007, Oberhuber, Martin wrote: > > I checked CVS, and it seems that most of the patch > authors are yet missing from the AUTHORS file, > is this intentional? > There isn't a hard rule covering who goes into AUTHORS. If I recognize a person from previous patches, I try to make sure they are in. Everyone contributing (authors) is in the ChangeLog with what they did going all the way back to the first release. AUTHORS is more of a summary of what they did after a few submissions. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Nov 19 11:39:51 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 19 Nov 2007 13:39:51 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: <4740C8A2.6030908@gatworks.com> <47419032.8080406@gatworks.com> <4741B352.8070205@gatworks.com> Message-ID: <4741D877.80203@gatworks.com> For me, the makefile/prefix = /usr/local sorta suggest thats where the libs/bins/jars/... should eventually wind up. If a user does not like /usr/local, then a quick change would put it somewhere else. At this moment I dont care where the jar winds up ( in lib, or a jar directory ). So I like to keep the jre/sdk directory protected from meddling, and changes. But if a user has a penchant to use 'java -jar', then the RXTXcomm.jar file should be stuffed with the other jre/sdk jar files. From ajmas at sympatico.ca Mon Nov 19 11:54:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 19 Nov 2007 13:54:29 -0500 Subject: [Rxtx] CVS updates and closed bugs Message-ID: <20071119185429.SPYK18413.tomts22-srv.bellnexxia.net@smtp1.sympatico.ca> On this day in November "U. George" wrote: > > For me, the makefile/prefix = /usr/local sorta suggest thats where the > libs/bins/jars/... should eventually wind up. > If a user does not like /usr/local, then a quick change would put it > somewhere else. At this moment I dont care where the jar winds up ( in > lib, or a jar directory ). > So I like to keep the jre/sdk directory protected from meddling, and > changes. > But if a user has a penchant to use 'java -jar', then the RXTXcomm.jar > file should be stuffed with the other jre/sdk jar files. It should be noted that some platforms, such as MacOS X might have different conventions. In the case of MacOS X there are two 'correct' places for Java libraries that aren't part of an application: - /Library/Java/Extensions/ - ~/Library/Java/Extensions/ Andre From ajmas at sympatico.ca Mon Nov 19 18:15:37 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 19 Nov 2007 20:15:37 -0500 Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: <47417698.3060705@xtremax.com> References: <4741663D.4070200@xtremax.com> <47417698.3060705@xtremax.com> Message-ID: <3D24B671-06CA-4709-AE3C-BCDB542F427F@sympatico.ca> On 19-Nov-07, at 06:42 , Edward wrote: > Hi Trent, > > First of all, I did sent them as bytes, eg, > > output.write("at\r\n".getBytes()); > > And if writing is every the problem, it wouldn't be able to explain > why i could send out a sms successfully using RXTX. > If you have the section of code that does the communicating, could you share it with us? This should help us tell whether it is a coding issue or something more fundamental with RXTX. Andre From EdwardRF at xtremax.com Mon Nov 19 19:39:36 2007 From: EdwardRF at xtremax.com (EdwardRF) Date: Tue, 20 Nov 2007 10:39:36 +0800 Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: <3D24B671-06CA-4709-AE3C-BCDB542F427F@sympatico.ca> References: <4741663D.4070200@xtremax.com> <47417698.3060705@xtremax.com> <3D24B671-06CA-4709-AE3C-BCDB542F427F@sympatico.ca> Message-ID: <474248E8.7070002@xtremax.com> Hi Guys, Thanks for the help, i've finally found out the problem. It was a flow control issue, i did not set the flow control properly. Btw, what is the default flow control behavior for rxtx2.1.7? was it the same as 2.0? Because i remember i did not need to set the flow control when I use rxtx 2.0 2 years back. Best Regards Edward Andre-John Mas wrote: > > On 19-Nov-07, at 06:42 , Edward wrote: > >> Hi Trent, >> >> First of all, I did sent them as bytes, eg, >> >> output.write("at\r\n".getBytes()); >> >> And if writing is every the problem, it wouldn't be able to explain >> why i could send out a sms successfully using RXTX. >> > > If you have the section of code that does the communicating, could you > share it with us? This should help us tell whether it is a coding > issue or something more fundamental with RXTX. > > Andre > From netbeans at gatworks.com Tue Nov 20 06:23:26 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 20 Nov 2007 08:23:26 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: <4740C8A2.6030908@gatworks.com> Message-ID: <4742DFCE.5070504@gatworks.com> Here is the small subset of diffs just for TIOCSERGETLSR :) Next I'll pull out the usb device, and see if that also causes rxtx to spin. >> 2) TIOCSERGETLSR, need to have the simulation of it available for all >> os's . If the system has the capability, don't simulate for devices >> that have the capability. For devices that dont have the capability, >> but the OS still defines TIOCSERGETLSR, fall back to simulation. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: a Url: http://mailman.qbang.org/pipermail/rxtx/attachments/20071120/2c5c8ee7/attachment-0013.pl From tjarvi at qbang.org Tue Nov 20 08:20:21 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 20 Nov 2007 08:20:21 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <4742DFCE.5070504@gatworks.com> References: <4740C8A2.6030908@gatworks.com> <4742DFCE.5070504@gatworks.com> Message-ID: On Tue, 20 Nov 2007, U. George wrote: > Here is the small subset of diffs just for TIOCSERGETLSR :) > > Next I'll pull out the usb device, and see if that also causes rxtx to spin. > >>> 2) TIOCSERGETLSR, need to have the simulation of it available for all os's >>> . If the system has the capability, don't simulate for devices that have >>> the capability. For devices that dont have the capability, but the OS >>> still defines TIOCSERGETLSR, fall back to simulation. > Hi George, I'll be looking through this patch in detail tonight. I just wanted to make sure you are aware of this line in win32termios.h. The ifdef logic is messy as you noticed. That is combined with the later addition of support for it to windows. #define TIOCSERGETLSR 0x5459 (this is by far the strangest code in rxtx in retrospect) I'll be able to do extensive automated testing once we get to that point. I'm confident we can get something in that has a low probability of causing regressions. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Tue Nov 20 08:42:08 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 20 Nov 2007 10:42:08 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: <4740C8A2.6030908@gatworks.com> <4742DFCE.5070504@gatworks.com> Message-ID: <47430050.1010203@gatworks.com> It is of no difference. 1) If the define does not exist, then it should be as before. 2) If it does exist, then it should also be as before. 3) If it does exist, but the ioctl fails, then it will fallback as if it did not exist in the first place. Trent Jarvi wrote: > On Tue, 20 Nov 2007, U. George wrote: > >> Here is the small subset of diffs just for TIOCSERGETLSR :) >> >> Next I'll pull out the usb device, and see if that also causes rxtx to >> spin. >> >>>> 2) TIOCSERGETLSR, need to have the simulation of it available for >>>> all os's . If the system has the capability, don't simulate for >>>> devices that have the capability. For devices that dont have the >>>> capability, but the OS still defines TIOCSERGETLSR, fall back to >>>> simulation. >> > > Hi George, > > I'll be looking through this patch in detail tonight. I just wanted to > make sure you are aware of this line in win32termios.h. The ifdef logic > is messy as you noticed. That is combined with the later addition of > support for it to windows. > > #define TIOCSERGETLSR 0x5459 > > (this is by far the strangest code in rxtx in retrospect) > > I'll be able to do extensive automated testing once we get to that > point. I'm confident we can get something in that has a low probability > of causing regressions. > > -- > Trent Jarvi > tjarvi at qbang.org > > From netbeans at gatworks.com Tue Nov 20 08:36:56 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 20 Nov 2007 10:36:56 -0500 Subject: [Rxtx] Unplugged Opened USB devices In-Reply-To: <4742DFCE.5070504@gatworks.com> References: <4740C8A2.6030908@gatworks.com> <4742DFCE.5070504@gatworks.com> Message-ID: <4742FF18.3050005@gatworks.com> > Next I'll pull out the usb device, and see if that also causes rxtx to > spin. This is the error on a read. The select() should have failed, as well as the read(). java.io.IOException: Input/output error in nativeavailable at gnu.io.RXTXPort.nativeavailable(Native Method) at gnu.io.RXTXPort$SerialInputStream.read(RXTXPort.java:1420) at jGPS.GpsData.DeviceDrivers.SerialPort.SerialPort_NMEA_GNU.serialEvent (SerialPort_NMEA_GNU.java:449) at gnu.io.RXTXPort.sendEvent(RXTXPort.java:771) at gnu.io.RXTXPort.eventLoop(Native Method) at gnu.io.RXTXPort$MonitorThread.run(RXTXPort.java:1622) But for java program, it sees( when USB device is unplugged ) : 1) event: SerialPortEvent.DATA_AVAILABLE 2) read (non-existant) data. I think that its bad form to say DATA_AVAILABLE, when there is no data to be obtained. There does not seem to be an I/O error event. So basically, I think, and IMHO, that no events should be sent. Rather a thread timeout ( ie no data in X seconds ) AND recovery from user code should be instantiated. From manujnaman at yahoo.com Wed Nov 21 12:35:46 2007 From: manujnaman at yahoo.com (manuj naman) Date: Wed, 21 Nov 2007 11:35:46 -0800 (PST) Subject: [Rxtx] Problem reading 1-wire device using RXTX on Linux Message-ID: <371969.66249.qm@web37911.mail.mud.yahoo.com> Hello, I am trying to use the RXTX library on Ubuntu (Debian) linux to read iButtons. It works perfectly on Windows. However on my linux machines it gives the following errors. I am using DS9490 (USB port adapter) to read the iButtons. I have followed your instructions on the Wiki. I recompiled the rxtx library to produce the .so and .jar files. But still it gives me this: manujnaman at sensor:~/iButton/onewireviewer$ java -cp $CLASSPATH:./OneWireAPI.jar:./OneWireViewer.jar OneWireViewer Experimental: JNI_OnLoad called. Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Warning: serial communications API not setup properly, no ports in enumeration Pure-Java DS9097U adapter will not work, not added to adapter enum Standard drivers for 1-Wire are not found. Please download the latest drivers from http://www.ibutton.com Or install RXTX Serial Communications API from http://www.rxtx.org Do you know how to solve the "Serial communications API not setup properly, no ports in enumeration" problem? Also, how to detect which what /dev/* is the port to be used? On Windows this is simply USB1, on linux this is a bit unclear. Many thanks for your advice, Manuj Naman Dallas, TX, US manujnaman at yahoo.com --------------------------------- Be a better pen pal. Text or chat with friends inside Yahoo! Mail. See how. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071121/2760f691/attachment-0012.html From Martin.Oberhuber at windriver.com Wed Nov 21 13:55:25 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Wed, 21 Nov 2007 21:55:25 +0100 Subject: [Rxtx] Should RXTX Lixense link to LGPL-2.1 be changed? In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803A21160@ism-mail03.corp.ad.wrs.com> Hi Trent and all, In all the RXTX source files as well as http://users.frii.com/jarvi/rxtx/license.html there is the following lines: | A copy of the LGPL v 2.1 may be found at | http://www.gnu.org/licenses/lgpl.txt on March 4th 2007. A copy is | here for your convenience. But, as of today, at the link provided there is only a copy of the LGPL v3.0. I think there should be a link to the LGPL v2.1, e.g. http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html What do you think? Cheers, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Wed Nov 21 20:46:18 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Nov 2007 20:46:18 -0700 (MST) Subject: [Rxtx] Problem reading 1-wire device using RXTX on Linux In-Reply-To: <371969.66249.qm@web37911.mail.mud.yahoo.com> References: <371969.66249.qm@web37911.mail.mud.yahoo.com> Message-ID: On Wed, 21 Nov 2007, manuj naman wrote: > Hello, > > I am trying to use the RXTX library on Ubuntu (Debian) linux to read iButtons. It works perfectly on Windows. However on my linux machines it gives the following errors. I am using DS9490 (USB port adapter) to read the iButtons. > > I have followed your instructions on the Wiki. I recompiled the rxtx library to produce the .so and .jar files. But still it gives me this: > > manujnaman at sensor:~/iButton/onewireviewer$ java -cp $CLASSPATH:./OneWireAPI.jar:./OneWireViewer.jar OneWireViewer > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > Warning: serial communications API not setup properly, no ports in enumeration > Pure-Java DS9097U adapter will not work, not added to adapter enum > > Standard drivers for 1-Wire are not found. > Please download the latest drivers from http://www.ibutton.com > Or install RXTX Serial Communications API from http://www.rxtx.org > > Do you know how to solve the "Serial communications API not setup properly, no ports in enumeration" problem? > > Also, how to detect which what /dev/* is the port to be used? On Windows this is simply USB1, on linux this is a bit unclear. Hi Manuj What is the output of the following? dmesg |grep tty touch /var/lock/test.lock && rm -f /var/lock/test.lock If you see something like /dev/ttyUSB0 in the dmesg output, what happens if you do something like tail -f /dev/ttyUSB0? These test each of the usual suspects. We are looking for missing USB drivers, no permission to create a lockfile and no read permission for the device. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Wed Nov 21 21:05:23 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 21 Nov 2007 21:05:23 -0700 (MST) Subject: [Rxtx] Should RXTX Lixense link to LGPL-2.1 be changed? In-Reply-To: <460801A4097E3D4CA04CC64EE648584803A21160@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803A21160@ism-mail03.corp.ad.wrs.com> Message-ID: On Wed, 21 Nov 2007, Oberhuber, Martin wrote: > Hi Trent and all, > > In all the RXTX source files as well as > http://users.frii.com/jarvi/rxtx/license.html > there is the following lines: > > | A copy of the LGPL v 2.1 may be found at > | http://www.gnu.org/licenses/lgpl.txt on March 4th 2007. A copy is > | here for your convenience. > > But, as of today, at the link provided there is only > a copy of the LGPL v3.0. I think there should be a link > to the LGPL v2.1, e.g. > http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html > > What do you think? > Hi Martin, Thanks. I updated the link. Changing licences is a heavy process for me as a free software developer and an employee so I'd rather stay with 2.1 unless the current license becomes a show stopper. I figured that would happen someday so I put the date in to be clear. -- Trent Jarvi tjarvi at qbang.org From beat.arnet at gmail.com Thu Nov 22 08:45:45 2007 From: beat.arnet at gmail.com (Beat Arnet) Date: Thu, 22 Nov 2007 10:45:45 -0500 Subject: [Rxtx] Dual Core Problem Message-ID: <4745A429.9060604@gmail.com> Dear All, I am struggling with an application that uses RXTX 2.1.7 and has been working reliably in the past. When this program runs on a dual-core DELL (Intel T2500), strange things happen with the RS232 communication. The application is missing incoming characters and also often freezes when trying to close the serial port. I highly suspect a threading problem and was wondering if a) anybody had run into a similar problem with dual core processors and b) if there is a list of does and dont's when it comes to RXTX and threads. Regards, Beat From tjarvi at qbang.org Thu Nov 22 13:22:43 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 22 Nov 2007 13:22:43 -0700 (MST) Subject: [Rxtx] Dual Core Problem In-Reply-To: <4745A429.9060604@gmail.com> References: <4745A429.9060604@gmail.com> Message-ID: On Thu, 22 Nov 2007, Beat Arnet wrote: > Dear All, > I am struggling with an application that uses RXTX 2.1.7 and has been > working reliably in the past. When this program runs on a dual-core DELL > (Intel T2500), strange things happen with the RS232 communication. The > application is missing incoming characters and also often freezes when > trying to close the serial port. I highly suspect a threading problem > and was wondering if a) anybody had run into a similar problem with dual > core processors and b) if there is a list of does and dont's when it > comes to RXTX and threads. > I've used rxtx with SMP systems but have not experimented very much with threading and rxtx. One red flag rxtx raises is it stores pointers to java objects in SerialImp.c. If the JVM decides to move things around, rxtx becomes confused. Missing incomming characters is usually caused by someone running two applications. They then fight over the incomming data. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Fri Nov 23 03:12:28 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Fri, 23 Nov 2007 11:12:28 +0100 Subject: [Rxtx] Dual Core Problem In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803A84C59@ism-mail03.corp.ad.wrs.com> > Missing incomming characters is usually caused by someone running two > applications. They then fight over the incomming data. I've seen exactly this scenario on Linux with Lockfiles disabled. Usually, port locking (through Lockfiles or Ioctl method) should avoid exactly this problem. I know that on Mac, port locking through Kernel/Ioctl method has been added for the upcoming RXTX 2.1-8. What's the status of this feature for Linux and other Unixes? Cheers, Martin From chris.paton at red61.com Fri Nov 23 05:26:10 2007 From: chris.paton at red61.com (Chris Paton) Date: Fri, 23 Nov 2007 12:26:10 +0000 Subject: [Rxtx] RXTX parallel port issues Message-ID: <4746C6E2.3000304@red61.com> Hi there, I've been happily using RXTX to communicate with a serial based point-of-sale printer for a several months. I've recently received a parallel based printer and have been trying to get RXTX to talk to this too. I've encountered a few problems along the way and just wanted to check if I'm doing anything wrong, or if I've found any bugs. Writing ------- Writing to the parallel port using ParallelPort.getOutputStream works well, except when I use OutputStream.write(byte[]) to write a multiple of 8 bytes (!). Doing this causes the JVM to crash with an EXCEPTION_PRIV_INSTRUCTION on Windows. I worked around this in my application by adding an additional byte if bytesToWrite % 8 == 0. I guess I could also have called write(byte) repeatedly. This also generated a SIGSEGV on Linux but I was unable to reproduce it today using the CVS version of RXTX and a recent kernel. Reading status pins ------------------- On Linux, I've found that ParallelPort.isPaperOut and ParallelPort.isPrinterSelected appear to be inverted; i.e. when the paper is out ParallelPort.isPaperOut returns false, and when there is paper ParallelPort.isPaperOut returns true! I've tested this in both Sun JDK5 and JDK6 on machines running Linux 2.6.21 and 2.6.23. Fortunately it's easy to use a conditional based on System.getProperty("os.name") to hack around this. Reading from InputStream ------------------------ I've had more serious issues trying to read from ParallelPort.getInputStream. On Windows, readByte seems to return -1 (end of stream) any time data isn't available. On Linux, I got a kernel oops, even with a recent 2.6.23.1 kernel. I was able to stop this using a kernel patch that I found via Google. Although this stopped the oops, I still get frequent IOExceptions when calling InputStream.readByte. It appears that instead of blocking, readByte throws an IOException with message "Resource temporarily unavailable in readByte" any time it is called when no data is available. Occasionally, I get an exception instead of the data I was expecting to read, e.g when asking my printer for a version string I get "VER: S3306 * 06.03* 10/*6/06" where the *s indicate that an exception occurred and data was missed. Any advice that anyone can offer would be much appreciated. If you need any more details or debugging information about any of these problems then let me know. Cheers -- Chris Paton Technical Developer Red61 -- Transaction Marketing Software http://www.red61.com -------------- next part -------------- A non-text attachment was scrubbed... Name: chris.paton.vcf Type: text/x-vcard Size: 230 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20071123/00a747b6/attachment-0022.vcf From chris.paton at red61.com Fri Nov 23 05:26:10 2007 From: chris.paton at red61.com (Chris Paton) Date: Fri, 23 Nov 2007 12:26:10 +0000 Subject: [Rxtx] RXTX parallel port issues Message-ID: <4746C6E2.3000304@red61.com> Hi there, I've been happily using RXTX to communicate with a serial based point-of-sale printer for a several months. I've recently received a parallel based printer and have been trying to get RXTX to talk to this too. I've encountered a few problems along the way and just wanted to check if I'm doing anything wrong, or if I've found any bugs. Writing ------- Writing to the parallel port using ParallelPort.getOutputStream works well, except when I use OutputStream.write(byte[]) to write a multiple of 8 bytes (!). Doing this causes the JVM to crash with an EXCEPTION_PRIV_INSTRUCTION on Windows. I worked around this in my application by adding an additional byte if bytesToWrite % 8 == 0. I guess I could also have called write(byte) repeatedly. This also generated a SIGSEGV on Linux but I was unable to reproduce it today using the CVS version of RXTX and a recent kernel. Reading status pins ------------------- On Linux, I've found that ParallelPort.isPaperOut and ParallelPort.isPrinterSelected appear to be inverted; i.e. when the paper is out ParallelPort.isPaperOut returns false, and when there is paper ParallelPort.isPaperOut returns true! I've tested this in both Sun JDK5 and JDK6 on machines running Linux 2.6.21 and 2.6.23. Fortunately it's easy to use a conditional based on System.getProperty("os.name") to hack around this. Reading from InputStream ------------------------ I've had more serious issues trying to read from ParallelPort.getInputStream. On Windows, readByte seems to return -1 (end of stream) any time data isn't available. On Linux, I got a kernel oops, even with a recent 2.6.23.1 kernel. I was able to stop this using a kernel patch that I found via Google. Although this stopped the oops, I still get frequent IOExceptions when calling InputStream.readByte. It appears that instead of blocking, readByte throws an IOException with message "Resource temporarily unavailable in readByte" any time it is called when no data is available. Occasionally, I get an exception instead of the data I was expecting to read, e.g when asking my printer for a version string I get "VER: S3306 * 06.03* 10/*6/06" where the *s indicate that an exception occurred and data was missed. Any advice that anyone can offer would be much appreciated. If you need any more details or debugging information about any of these problems then let me know. Cheers -- Chris Paton Technical Developer Red61 -- Transaction Marketing Software http://www.red61.com -------------- next part -------------- A non-text attachment was scrubbed... Name: chris.paton.vcf Type: text/x-vcard Size: 230 bytes Desc: not available Url : http://mailman.qbang.org/pipermail/rxtx/attachments/20071123/00a747b6/attachment-0023.vcf From hho at bibliotheca.dk Fri Nov 23 06:45:36 2007 From: hho at bibliotheca.dk (Hans Hvelplund Odborg) Date: Fri, 23 Nov 2007 14:45:36 +0100 Subject: [Rxtx] RXTX parallel port issues In-Reply-To: <4746C6E2.3000304@red61.com> References: <4746C6E2.3000304@red61.com> Message-ID: <001201c82dd7$21c6e2c0$6a37a8c0@HANSLAPTOP> I've experienced similar crashes in JVM when writing to the parallel port in windows (with rxtx). Unfortunately I did not save the data sent to the parallel port so cannot say anything about the length. Furthermore, I recall having problems with .write(byte) (would never exit if I recall correctly), but I do not recall if this was with serial or parallel or both. In the end, we ended printing through Java's support of the windows driver. Unfortunately I currently don?t have the time to investigate these issues further. I just wanted to let you know that currently there are bugs in rxtx. Med venlig hilsen / Best regards / Med v?nliga h?lsningar Hans Hvelplund Odborg BIBLIOTHECA A/S Vallensb?kvej 20B ? 2605 Br?ndby ? Denmark Tel.: +45 70271008 Fax: +45 70271009 hho at bibliotheca.dk www.bibliotheca.dk -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Chris Paton Sent: 23. november 2007 13:26 To: rxtx at qbang.org Subject: [Rxtx] RXTX parallel port issues Hi there, I've been happily using RXTX to communicate with a serial based point-of-sale printer for a several months. I've recently received a parallel based printer and have been trying to get RXTX to talk to this too. I've encountered a few problems along the way and just wanted to check if I'm doing anything wrong, or if I've found any bugs. Writing ------- Writing to the parallel port using ParallelPort.getOutputStream works well, except when I use OutputStream.write(byte[]) to write a multiple of 8 bytes (!). Doing this causes the JVM to crash with an EXCEPTION_PRIV_INSTRUCTION on Windows. I worked around this in my application by adding an additional byte if bytesToWrite % 8 == 0. I guess I could also have called write(byte) repeatedly. This also generated a SIGSEGV on Linux but I was unable to reproduce it today using the CVS version of RXTX and a recent kernel. Reading status pins ------------------- On Linux, I've found that ParallelPort.isPaperOut and ParallelPort.isPrinterSelected appear to be inverted; i.e. when the paper is out ParallelPort.isPaperOut returns false, and when there is paper ParallelPort.isPaperOut returns true! I've tested this in both Sun JDK5 and JDK6 on machines running Linux 2.6.21 and 2.6.23. Fortunately it's easy to use a conditional based on System.getProperty("os.name") to hack around this. Reading from InputStream ------------------------ I've had more serious issues trying to read from ParallelPort.getInputStream. On Windows, readByte seems to return -1 (end of stream) any time data isn't available. On Linux, I got a kernel oops, even with a recent 2.6.23.1 kernel. I was able to stop this using a kernel patch that I found via Google. Although this stopped the oops, I still get frequent IOExceptions when calling InputStream.readByte. It appears that instead of blocking, readByte throws an IOException with message "Resource temporarily unavailable in readByte" any time it is called when no data is available. Occasionally, I get an exception instead of the data I was expecting to read, e.g when asking my printer for a version string I get "VER: S3306 * 06.03* 10/*6/06" where the *s indicate that an exception occurred and data was missed. Any advice that anyone can offer would be much appreciated. If you need any more details or debugging information about any of these problems then let me know. Cheers -- Chris Paton Technical Developer Red61 -- Transaction Marketing Software http://www.red61.com From tjarvi at qbang.org Fri Nov 23 16:28:23 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 23 Nov 2007 16:28:23 -0700 (MST) Subject: [Rxtx] RXTX parallel port issues In-Reply-To: <001201c82dd7$21c6e2c0$6a37a8c0@HANSLAPTOP> References: <4746C6E2.3000304@red61.com> <001201c82dd7$21c6e2c0$6a37a8c0@HANSLAPTOP> Message-ID: It would be good to create a bug report for this so others can either look into it or find the report to confirm their suspicions. Currently, there is only one parallel port bug report. http://bugzilla.qbang.org/show_bug.cgi?id=40 As we do update the reports when bugs are fixed, it gives people a chance to put themselves on the CC list and get notification of fixes they are interested in. On Fri, 23 Nov 2007, Hans Hvelplund Odborg wrote: > > I've experienced similar crashes in JVM when writing to the parallel port in > windows (with rxtx). > > Unfortunately I did not save the data sent to the parallel port so cannot > say anything about the length. > > Furthermore, I recall having problems with .write(byte) (would never exit if > I recall correctly), but I do not recall if this was with serial or parallel > or both. > > In the end, we ended printing through Java's support of the windows driver. > > Unfortunately I currently don?t have the time to investigate these issues > further. I just wanted to let you know that currently there are bugs in > rxtx. > > > Med venlig hilsen / Best regards / Med v?nliga h?lsningar > Hans Hvelplund Odborg > > BIBLIOTHECA A/S > Vallensb?kvej 20B ? 2605 Br?ndby ? Denmark > Tel.: +45 70271008 > Fax: +45 70271009 > hho at bibliotheca.dk > www.bibliotheca.dk > > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of > Chris Paton > Sent: 23. november 2007 13:26 > To: rxtx at qbang.org > Subject: [Rxtx] RXTX parallel port issues > > Hi there, > > I've been happily using RXTX to communicate with a serial based > point-of-sale printer for a several months. I've recently received a > parallel based printer and have been trying to get RXTX to talk to this > too. I've encountered a few problems along the way and just wanted to > check if I'm doing anything wrong, or if I've found any bugs. > > Writing > ------- > Writing to the parallel port using ParallelPort.getOutputStream works > well, except when I use OutputStream.write(byte[]) to write a multiple > of 8 bytes (!). Doing this causes the JVM to crash with an > EXCEPTION_PRIV_INSTRUCTION on Windows. I worked around this in my > application by adding an additional byte if bytesToWrite % 8 == 0. I > guess I could also have called write(byte) repeatedly. > > This also generated a SIGSEGV on Linux but I was unable to reproduce it > today using the CVS version of RXTX and a recent kernel. > > Reading status pins > ------------------- > On Linux, I've found that ParallelPort.isPaperOut and > ParallelPort.isPrinterSelected appear to be inverted; i.e. when the > paper is out ParallelPort.isPaperOut returns false, and when there is > paper ParallelPort.isPaperOut returns true! I've tested this in both Sun > JDK5 and JDK6 on machines running Linux 2.6.21 and 2.6.23. Fortunately > it's easy to use a conditional based on System.getProperty("os.name") to > hack around this. > > Reading from InputStream > ------------------------ > > I've had more serious issues trying to read from > ParallelPort.getInputStream. On Windows, readByte seems to return -1 > (end of stream) any time data isn't available. > > On Linux, I got a kernel oops, even with a recent 2.6.23.1 > kernel. I was able to stop this using a kernel patch > > that I found via Google. Although this stopped the oops, I still get > frequent IOExceptions when calling InputStream.readByte. It appears that > instead of blocking, readByte throws an IOException with message > "Resource temporarily unavailable in readByte" any time it is called > when no data is available. Occasionally, I get an exception instead of > the data I was expecting to read, e.g when asking my printer for a > version string I get "VER: S3306 * 06.03* 10/*6/06" where the *s > indicate that an exception occurred and data was missed. > > > Any advice that anyone can offer would be much appreciated. If you need > any more details or debugging information about any of these problems > then let me know. > > Cheers > From manujnaman at yahoo.com Sun Nov 25 14:59:21 2007 From: manujnaman at yahoo.com (manuj naman) Date: Sun, 25 Nov 2007 13:59:21 -0800 (PST) Subject: [Rxtx] Problem reading 1-wire device using RXTX on Linux In-Reply-To: Message-ID: <104159.48942.qm@web37909.mail.mud.yahoo.com> Trent, dmesg | grep tty gives nothing. however, greping for usb does. The output for that is below. touch /var/lock/test.lock file does not exist, the directory does exits though. tail -f /dev/ttyUSB0 gives nothing simply because ttyUSB0 does not exist. Seems as if USB ports are not there... however, numerous /dev/tty* exist starting from /dev/tty, /dev/tty0, /dev/tty1... to ... /dev/ttyzf. The result of dmesg | grep usb is as follows: [17179576.220000] usbcore: registered new driver usbfs [17179576.220000] usbcore: registered new driver hub [17179576.572000] usb 1-1: new low speed USB device using uhci_hcd and address 2 [17179576.992000] usb 2-1: new full speed USB device using uhci_hcd and address 2 [17179577.132000] usbcore: registered new driver hiddev [17179577.188000] input: USB HID v1.11 Mouse [Microsoft Microsoft Wireless Optical Mouse� 1.00] on usb-0000:00:1f.2-1 [17179577.188000] usbcore: registered new driver usbhid [17179577.188000] drivers/usb/input/hid-core.c: v2.6:USB HID core driver [17179577.192000] usb-storage: device found at 2 [17179577.192000] usb-storage: waiting for device to settle before scanning [17179577.192000] usbcore: registered new driver usb-storage [17179582.192000] usb-storage: device scan complete [17209993.728000] usb 1-2: new full speed USB device using uhci_hcd and address 3 [17209994.816000] usbcore: registered new driver DS9490R [17248016.760000] usb 1-1: USB disconnect, address 2 [17302939.908000] usb 1-2: USB disconnect, address 3 [17302944.856000] usb 1-2: new full speed USB device using uhci_hcd and address 4 [17794170.232000] usb 1-2: USB disconnect, address 4 Does it help in diagnosis? The name of the 1-wire viewer device is DS9490 Best regards, Manuj Trent Jarvi wrote: On Wed, 21 Nov 2007, manuj naman wrote: > Hello, > > I am trying to use the RXTX library on Ubuntu (Debian) linux to read iButtons. It works perfectly on Windows. However on my linux machines it gives the following errors. I am using DS9490 (USB port adapter) to read the iButtons. > > I have followed your instructions on the Wiki. I recompiled the rxtx library to produce the .so and .jar files. But still it gives me this: > > manujnaman at sensor:~/iButton/onewireviewer$ java -cp $CLASSPATH:./OneWireAPI.jar:./OneWireViewer.jar OneWireViewer > Experimental: JNI_OnLoad called. > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > Warning: serial communications API not setup properly, no ports in enumeration > Pure-Java DS9097U adapter will not work, not added to adapter enum > > Standard drivers for 1-Wire are not found. > Please download the latest drivers from http://www.ibutton.com > Or install RXTX Serial Communications API from http://www.rxtx.org > > Do you know how to solve the "Serial communications API not setup properly, no ports in enumeration" problem? > > Also, how to detect which what /dev/* is the port to be used? On Windows this is simply USB1, on linux this is a bit unclear. Hi Manuj What is the output of the following? dmesg |grep tty touch /var/lock/test.lock && rm -f /var/lock/test.lock If you see something like /dev/ttyUSB0 in the dmesg output, what happens if you do something like tail -f /dev/ttyUSB0? These test each of the usual suspects. We are looking for missing USB drivers, no permission to create a lockfile and no read permission for the device. -- Trent Jarvi tjarvi at qbang.org --------------------------------- Be a better sports nut! Let your teams follow you with Yahoo Mobile. Try it now. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071125/ef4f80c4/attachment-0008.html From tjarvi at qbang.org Sun Nov 25 16:43:04 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 25 Nov 2007 16:43:04 -0700 (MST) Subject: [Rxtx] Problem reading 1-wire device using RXTX on Linux In-Reply-To: <104159.48942.qm@web37909.mail.mud.yahoo.com> References: <104159.48942.qm@web37909.mail.mud.yahoo.com> Message-ID: Hi Manuj, This does help diagnose the problem. Sadly the answer is in the system configuration of your debian system. I can only point you towards some areas that are suspect. /dev/tty01->/dev/ttyzz are terminals which are not of interest. It appears that the usb serial kernel module is not loading. That is usually in a directory like the following: /lib/modules/2.6.*/kernel/drivers/usb/serial modprobe is used to manually load the drivers. Your /dev/* may be created based upon the kernel modules loaded or MAKEDEV may be used to create the devices. /etc/modules.conf may be what is misconfigured though I'm not sure. One of the modules in usb/serial is probably responsible for representing your USB dongle as a tty. UDEV is probably responsible for creating ttyUSB01 once the kernel module is loaded. Perhaps someone has been through this before but basically this is a system configuration problem or a missing kernel driver. Once /dev/USB?? are present, rxtx should find the port. On Sun, 25 Nov 2007, manuj naman wrote: > Trent, > > dmesg | grep tty > gives nothing. however, greping for usb does. The output for that is below. > > touch /var/lock/test.lock file does not exist, the directory does exits though. > > tail -f /dev/ttyUSB0 gives nothing simply because ttyUSB0 does not exist. > > Seems as if USB ports are not there... however, numerous /dev/tty* exist starting from /dev/tty, /dev/tty0, /dev/tty1... to ... /dev/ttyzf. > > The result of dmesg | grep usb is as follows: > > [17179576.220000] usbcore: registered new driver usbfs > [17179576.220000] usbcore: registered new driver hub > [17179576.572000] usb 1-1: new low speed USB device using uhci_hcd and address 2 > [17179576.992000] usb 2-1: new full speed USB device using uhci_hcd and address 2 > [17179577.132000] usbcore: registered new driver hiddev > [17179577.188000] input: USB HID v1.11 Mouse [Microsoft Microsoft Wireless Optical Mouse� 1.00] on usb-0000:00:1f.2-1 > [17179577.188000] usbcore: registered new driver usbhid > [17179577.188000] drivers/usb/input/hid-core.c: v2.6:USB HID core driver > [17179577.192000] usb-storage: device found at 2 > [17179577.192000] usb-storage: waiting for device to settle before scanning > [17179577.192000] usbcore: registered new driver usb-storage > [17179582.192000] usb-storage: device scan complete > [17209993.728000] usb 1-2: new full speed USB device using uhci_hcd and address 3 > [17209994.816000] usbcore: registered new driver DS9490R > [17248016.760000] usb 1-1: USB disconnect, address 2 > [17302939.908000] usb 1-2: USB disconnect, address 3 > [17302944.856000] usb 1-2: new full speed USB device using uhci_hcd and address 4 > [17794170.232000] usb 1-2: USB disconnect, address 4 > > Does it help in diagnosis? The name of the 1-wire viewer device is DS9490 > > Best regards, > Manuj > > > Trent Jarvi wrote: On Wed, 21 Nov 2007, manuj naman wrote: > >> Hello, >> >> I am trying to use the RXTX library on Ubuntu (Debian) linux to read iButtons. It works perfectly on Windows. However on my linux machines it gives the following errors. I am using DS9490 (USB port adapter) to read the iButtons. >> >> I have followed your instructions on the Wiki. I recompiled the rxtx library to produce the .so and .jar files. But still it gives me this: >> >> manujnaman at sensor:~/iButton/onewireviewer$ java -cp $CLASSPATH:./OneWireAPI.jar:./OneWireViewer.jar OneWireViewer >> Experimental: JNI_OnLoad called. >> Stable Library >> ========================================= >> Native lib Version = RXTX-2.1-7 >> Java lib Version = RXTX-2.1-7 >> Warning: serial communications API not setup properly, no ports in enumeration >> Pure-Java DS9097U adapter will not work, not added to adapter enum >> >> Standard drivers for 1-Wire are not found. >> Please download the latest drivers from http://www.ibutton.com >> Or install RXTX Serial Communications API from http://www.rxtx.org >> >> Do you know how to solve the "Serial communications API not setup properly, no ports in enumeration" problem? >> >> Also, how to detect which what /dev/* is the port to be used? On Windows this is simply USB1, on linux this is a bit unclear. > > > Hi Manuj > > What is the output of the following? > > dmesg |grep tty > > touch /var/lock/test.lock && rm -f /var/lock/test.lock > > If you see something like /dev/ttyUSB0 in the dmesg output, what happens > if you do something like > > tail -f /dev/ttyUSB0? > > These test each of the usual suspects. We are looking for missing USB > drivers, no permission to create a lockfile and no read permission for the > device. > > -- > Trent Jarvi > tjarvi at qbang.org > > > > --------------------------------- > Be a better sports nut! Let your teams follow you with Yahoo Mobile. Try it now. From netbeans at gatworks.com Mon Nov 26 06:53:02 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 26 Nov 2007 08:53:02 -0500 Subject: [Rxtx] #undef TIOCSERGETLSR on LINUX Message-ID: <474ACFBE.5050406@gatworks.com> So I undef'ed the define TIOCSERGETLSR on a linux box, I find that RXTX no longer works . this is a :{ It appears that the sigprocmask( SIG_SETMASK, &newmask, &oldmask ) at src/SerialImp.c:1427 seems to unblock more events than it should. On a linux box there are 2 other events that are blocked, and this code un-sets them, and the thread hangs. It also appears that this code is incomplete. Also, if you only add in the block for SIGCHLD ( which I think is what someone wanted ) , the code will (soon) core-dump ( or silently exit ). So has anyone run with this code ? From tjarvi at qbang.org Mon Nov 26 19:32:54 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 26 Nov 2007 19:32:54 -0700 (MST) Subject: [Rxtx] #undef TIOCSERGETLSR on LINUX In-Reply-To: <474ACFBE.5050406@gatworks.com> References: <474ACFBE.5050406@gatworks.com> Message-ID: On Mon, 26 Nov 2007, U. George wrote: > So I undef'ed the define TIOCSERGETLSR on a linux box, I find that RXTX > no longer works . this is a :{ > > It appears that the sigprocmask( SIG_SETMASK, &newmask, &oldmask ) at > src/SerialImp.c:1427 seems to unblock more events than it should. On a > linux box there are 2 other events that are blocked, and this code > un-sets them, and the thread hangs. > > It also appears that this code is incomplete. > Also, if you only add in the block for SIGCHLD ( which I think is what > someone wanted ) , the code will (soon) core-dump ( or silently exit ). > > So has anyone run with this code ? Hi George, The case when TIOCSERGETLSR is not defined is currently used on Solaris. Linux has used the TIOCSERGETLSR. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Nov 26 19:56:24 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 26 Nov 2007 21:56:24 -0500 Subject: [Rxtx] #undef TIOCSERGETLSR on LINUX In-Reply-To: References: <474ACFBE.5050406@gatworks.com> Message-ID: <474B8758.6010006@gatworks.com> Technically, with, or without TIOCSERGETLSR it *SHOULD* work the same. Still does not explain the SIGSEGV on the current development code Trent Jarvi wrote: > On Mon, 26 Nov 2007, U. George wrote: > >> So I undef'ed the define TIOCSERGETLSR on a linux box, I find that RXTX >> no longer works . this is a :{ From Joshua.Gerdes at xerox.com Tue Nov 27 16:00:07 2007 From: Joshua.Gerdes at xerox.com (Gerdes, Joshua) Date: Tue, 27 Nov 2007 15:00:07 -0800 Subject: [Rxtx] Trying to use RXTX Message-ID: Hello, I've been using Java for a little while, but am no master. This is my story: I'm trying to write a simple program that will use RXTX to open a serial port on com4, read from it and write to it. I must be doing something wrong because this doesn't seem to be working - I sort of hodge-podged this together from an example that was on the rxtx website. Basically I call the connect method I wrote, that seems to work (no exceptions atleast), I call writeSerial method, and though I don't know for sure if this works it doesn't throw any exceptions, but then I try calling readSerial and never get anything. Can anyone tell me why this isn't working? I must just be doing something flat out wrong. I know that my serial device responds fine when communicated to - I've checked it on a serial terminal. Also, what is considered the end of the input stream? I nabbed this from an example and wonder when the while loop in readSerial will end. /******************************************** * name: readSerial * description: reads from serial port until \0? * arguments: none * returns: read bytes from serial port *******************************************/ private byte [] readSerial() throws IOException{ byte [] buffer = new byte [128]; //read until end of stream. whats considered the end? int len = -1; while ( ( len = serialIn.read(buffer)) > -1 ); return(buffer); } /******************************************** * name: writeSerial * description: writes to serial port until * arguments: String to write * returns: none *******************************************/ private void writeSerial(String data) throws IOException{ byte [] buffer = data.getBytes(); serialOut.write(buffer); } /******************************************** * name: connect * description: opens serial port. * arguments: Com port name * returns: none *******************************************/ void connect ( String portName ) throws Exception { CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(portName); if ( portIdentifier.isCurrentlyOwned() ) { System.out.println("Error: Port is currently in use"); } else { CommPort commPort = portIdentifier.open(this.getClass().getName(),2000); if ( commPort instanceof SerialPort ) { SerialPort serialPort = (SerialPort) commPort; serialPort.setSerialPortParams(9600,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE); serialIn = serialPort.getInputStream(); serialOut = serialPort.getOutputStream(); } else { System.out.println("Error: Only serial ports are handled by this example."); } } } /******************************************** * name: closeSerial * description: close serial port. * arguments: none * returns: none *******************************************/ private void closeSerial() throws IOException{ serialIn.close(); serialOut.close(); } //some globals private InputStream serialIn; private OutputStream serialOut; -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071127/b9b8cae8/attachment-0006.html From tjarvi at qbang.org Tue Nov 27 21:45:07 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Nov 2007 21:45:07 -0700 (MST) Subject: [Rxtx] Trying to use RXTX In-Reply-To: References: Message-ID: On Tue, 27 Nov 2007, Gerdes, Joshua wrote: > Hello, > > I've been using Java for a little while, but am no master. This is my > story: > > I'm trying to write a simple program that will use RXTX to open a serial > port on com4, read from it and write to it. I must be doing something > wrong because this doesn't seem to be working - I sort of hodge-podged > this together from an example that was on the rxtx website. Basically I > call the connect method I wrote, that seems to work (no exceptions > atleast), I call writeSerial method, and though I don't know for sure if > this works it doesn't throw any exceptions, but then I try calling > readSerial and never get anything. Can anyone tell me why this isn't > working? I must just be doing something flat out wrong. I know that my > serial device responds fine when communicated to - I've checked it on a > serial terminal. Also, what is considered the end of the input stream? I > nabbed this from an example and wonder when the while loop in readSerial > will end. > It is hard to tell for sure without seeing main(). Here are a few hints. Sometimes when you try to communicate with a device, the white space is important. Perhaps the device knows that you are done transmitting a message when it reads a new line. Maybe it is a null character. Maybe you typed the same string into the terminal and then hit not thinking that was a character too. Serial communication can now go 3 Mb/sec with the right hardware but most of use don't have that :). Don't read right after you right. You can look at the bytes available with tha API. You can wait for bytes available events. Give the electrons a running head start if in doubt; they have been doing this since the 1960's and need a break now and then. The exact behavior of read depends upon the timeout and threshold. A 0 timeout and 0 threshold should block. There is no end of to a stream. Some terminals consider control-d the EOF and close. That is always the interesting part of serial communication. Often you end up creating some sort of packet based communication to know when you are done reading. Other times, you eat a byte at a time and make some decision. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Tue Nov 27 22:40:41 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 27 Nov 2007 22:40:41 -0700 (MST) Subject: [Rxtx] #undef TIOCSERGETLSR on LINUX In-Reply-To: <474B8758.6010006@gatworks.com> References: <474ACFBE.5050406@gatworks.com> <474B8758.6010006@gatworks.com> Message-ID: Hi George, The last time I saw a segv it was related to 64 bit processors and how we stored pointers. Could you describe your system a bit and the serial device being used? I might just make sure I have access to one before the next release. I agree that doing an undef on TIOCSERGETLSR is a good thing to try. But given the afterthought/reaction nature of the ifdefs in rxtx, I would not put it past silly preprocessing mistakes that may be as simple as you don't have a Solaris machine or have a Linux machine and we didn't handle that case right. The ifdefs go both ways there. It is possible to attach gdb to the jvm. HP and IBM have published some info on that that google can find. Usually when rxtx segv's it is so blatant, the eventThread does not even start. I've usually just sprinkled some debug messages then stared at the sillyness. The Linux code should not be hard to figure out with an example system. The w32 issues have been what takes me time to figure out. On Mon, 26 Nov 2007, U. George wrote: > Technically, with, or without TIOCSERGETLSR it *SHOULD* work the same. > Still does not explain the SIGSEGV on the current development code > > Trent Jarvi wrote: >> On Mon, 26 Nov 2007, U. George wrote: >> >>> So I undef'ed the define TIOCSERGETLSR on a linux box, I find that RXTX >>> no longer works . this is a :{ > From netbeans at gatworks.com Wed Nov 28 07:16:17 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 28 Nov 2007 09:16:17 -0500 Subject: [Rxtx] #undef TIOCSERGETLSR on LINUX In-Reply-To: References: <474ACFBE.5050406@gatworks.com> <474B8758.6010006@gatworks.com> Message-ID: <474D7831.5010300@gatworks.com> Box is a PIII laptop, with a USB 1 port. Device is a serialUSB device ( as per linux/redhat ) Debugging is not terribly easy on LINUX when there are pthreads involved. Its not getting easier when SUN/java has placed extensive hooks in catching and logging ( catchable ) events. for example this logfile excerp: > # > # An unexpected error has been detected by Java Runtime Environment: > # > # SIGSEGV (0xb) at pc=0xb50ad67b, pid=4291, tid=16386 > # > # Java VM: Java HotSpot(TM) Client VM (1.6.0-b105 mixed mode, sharing) > # Problematic frame: > # C [librxtxSerial.so+0x567b] Java_gnu_io_RXTXPort_interruptEventLoop+0xd3 > # > # If you would like to submit a bug report, please visit: > # http://java.sun.com/webapps/bugreport/crash.jsp > # > > --------------- T H R E A D --------------- > > Current thread (0x08291800): JavaThread "main" [_thread_in_native, id=4293] > > siginfo:si_signo=11, si_errno=0, si_code=1, si_addr=0xb50a77a0 > There are more java magical switches to aid in debugging, but they appear to be undocumented. So I have to go back to some old e-mails Right now I think its the SIGABRT that is sent a second time ( the first is caught ) to interrupt the drain_loop thread. > > The Linux code should not be hard to figure out with an example system. > The w32 issues have been what takes me time to figure out. From dwippermann at gmx.net Wed Nov 28 08:47:04 2007 From: dwippermann at gmx.net (Daniel Wippermann) Date: Wed, 28 Nov 2007 16:47:04 +0100 Subject: [Rxtx] Dual Core Problem In-Reply-To: References: Message-ID: Hi all, > I am struggling with an application that uses RXTX 2.1.7 and has been > working reliably in the past. When this program runs on a dual-core DELL > (Intel T2500), strange things happen with the RS232 communication. The > application is missing incoming characters and also often freezes when > trying to close the serial port. I highly suspect a threading problem > and was wondering if a) anybody had run into a similar problem with dual > core processors and b) if there is a list of does and dont's when it > comes to RXTX and threads. I just stumbled over the same "freeze" of the application while trying to "close()" the RXTXPort. In this rare circumstances the "IOLocked" variable of the RXTXPort class still has a value greater than 0 although no action is pending. That makes the close() method sleep forever in expectation of some other thread to end its work... I believe this is caused by the "IOLocked++" and "IOLocked--" instructions not being synchronized. I suspect that in a multi-core- CPU environment there is a chance that this instructions may interfere if two threads are operating on the same port, but in different CPU cores. In my example the monitor thread is reading the port, while the main thread, that opened the port, is writing to it. I just changed my application so that every port handling method call is done from within a synchronized method or block. I have not observed another freeze since then, although I did an extensive stress test. But I think it would be nice if you could do the synchronisation from within the library in a future release. Best regards, Daniel From netbeans at gatworks.com Fri Nov 30 17:22:28 2007 From: netbeans at gatworks.com (U. George) Date: Fri, 30 Nov 2007 19:22:28 -0500 Subject: [Rxtx] #undef TIOCSERGETLSR on LINUX In-Reply-To: <474D7831.5010300@gatworks.com> References: <474ACFBE.5050406@gatworks.com> <474B8758.6010006@gatworks.com> <474D7831.5010300@gatworks.com> Message-ID: <4750A944.7010504@gatworks.com> U. George wrote: > Box is a PIII laptop, with a USB 1 port. Device is a serialUSB device ( > as per linux/redhat ) > Debugging is not terribly easy on LINUX when there are pthreads The issue seems to be a mis-coordination of the "drain_loop" thread use of the eis struct which is created from the "RXTXPort(eventLoop)" stack. Once the flag eis.closing is set, the call to event loop is completed, and the stack space is released ( re-used ). unfortunately drain_loop still appears to be using the data, as the pthread_kill() signal has yet to be processed by the drain_loop thread. The pthread_join() could be used here to wait for the drain_loop thread to terminate. It might work if the pthread_detach() is *not* used, which unfortunately is called by the thread creator as well as the thread itself :{ From keithvz at verizon.net Thu Nov 1 08:08:58 2007 From: keithvz at verizon.net (Keith) Date: Thu, 01 Nov 2007 10:08:58 -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: <4729DDFA.7080206@verizon.net> Trent Jarvi wrote: > 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? Well, I honestly don't know how all this fits together. I think it's just a matter of enabling the right flow control option within the standard serial framework to tell the device driver, "HEY START USING DTR/DSR FOR FLOW CONTROL." If what UGeorge said,(about that type of nitty-gritty lead control being done within the device driver), is true, then this confirms my suspicion. I tried narrowing down within the Linux drivers what you are looking for, but I can't entirely tell wth I'm looking at. (virtual com port drivers -- they are included compiled by default with Ubuntu, source included) http://www.ftdichip.com/Drivers/VCP/Linux/ftdi_sio.tar.gz Hahahaa, they make a reference to DTR flow control being supported but say (UGH) in parenthesis. You can also use their direct device driver library on Ubuntu -- libftd2xx.so.0.4.13. No source code. http://www.ftdichip.com/Drivers/D2XX/Linux/libftd2xx0.4.13.tar.gz In that case, you make a call to their FT_SetFlowControl() function. FT_STATUS FT_SetFlowControl (FT_HANDLE ftHandle, USHORT usFlowControl, UCHAR uXon,UCHAR uXoff) Parameters ftHandle Handle of the device. usFlowControl Must be one of FT_FLOW_NONE, FT_FLOW_RTS_CTS, ****FT_FLOW_DTR_DSR**** or FT_FLOW_XON_XOFF. uXon Character used to signal Xon. Only used if flow control is FT_FLOW_XON_XOFF. uXoff Character used to signal Xoff. Only used if flow control is FT_FLOW_XON_XOFF. This is from their programming guide http://www.ftdichip.com/Documents/ProgramGuides/D2XXPG34.pdf I actually want to take this a step further and say that I think the flow control is actually handled right on the device itself in hardware/firmware. It's enabled through the device driver, but I think the maintaining of buffers, asserting/deasserting of leads, etc is handled by the device. For the time being, I've switched to jd2xx, https://jd2xx.dev.java.net/ and http://bleyer.org/jd2xx/ These are Java wrappers for the device driver libraries. It allows almost direct access to the well-documented device drivers from Java. I hope this helps Keith From tjarvi at qbang.org Thu Nov 1 11:09:51 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:09:51 -0600 (MDT) 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: Hi Martin, What I usually have done is allow changes that do not impact working software including changes to methods not documented in CommAPI (which remain undocumented in rxtx) and fixes to known problems in the documented portions. That way if you use the documented API, the releases should only become better with time. If you use the undocumented portions, the behavior is not as predictable but open for improvement. On Wed, 31 Oct 2007, 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 >> > From tjarvi at qbang.org Thu Nov 1 11:15:52 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:15:52 -0600 (MDT) 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: I too use rxtx in commercial products. The problem I've been trying to address while bringing the server back was how to make it possible for hobby folks to build the same software as companies so we can move rxtx along a little faster. Exposing internal tools is not an option at this time, the public rxtx builds have been done on my home machine which has drives hanging out of it all over the place dying one at a time. This isn't maintainable. I'm currently looking at the possibility of making an S3 image available on Amazon's EC. These are machines you can rent for ~10 cents an hour which is more than enough to build rxtx. The S3 image is not changed when people use it so everyone has the same starting point. With this, we could all build rxtx for ~20 platforms for a small price and eliminate tool issues. On Wed, 31 Oct 2007, Greg Johnson wrote: > 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 tjarvi at qbang.org Thu Nov 1 11:19:55 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 11:19:55 -0600 (MDT) 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: On Wed, 31 Oct 2007, 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. I was helping Dmitry do the Mac OS X port without access to a machine when we put that in. In the archives there is information (easily found with google on Apple's site) that describes how their API (and others) can determine if a port is used and ignore it. I think these changes are in CVS but need to confirm. The bottom line is that rxtx should not have used lock files on Mac. It was just ignorance of the system on my part. -- Trent Jarvi tjarvi at qbang.org From fabioanjos at gmail.com Thu Nov 1 12:35:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Thu, 1 Nov 2007 15:35:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: References: <600074.21299.qm@web55806.mail.re3.yahoo.com> Message-ID: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Hi, I was using SerialEventListener in my project. But, as was said here, id doesnt work very well with virtual serial ports. So, I changed the strategy using the code posted here in this thread: try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > 0) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } The thing is that in my tests I could notice that in.read(buffer) never blocks. Even when there's nothing to read. Instead of blocking when there's nothing to read it returns 0. So, my questions are: 1. Am I doing something wrong? 2. If not, wouldnt this decrease performance? (the thread would be locked in a loop that does nothing.) 3. Is there a better way to do the job? Thanks in advance!! F?bio -------- On 10/31/07, Andre-John Mas wrote: > > > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071101/0aee59d0/attachment-0034.html From ajmas at sympatico.ca Thu Nov 1 16:07:55 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Thu, 1 Nov 2007 18:07:55 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> Message-ID: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From sarah_662005 at yahoo.com Thu Nov 1 17:10:05 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Thu, 1 Nov 2007 16:10:05 -0700 (PDT) Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Message-ID: <351433.37166.qm@web55814.mail.re3.yahoo.com> Thank you very much for your help. Now the application works fine. the serialEvent gets triggered. Rxtx is cool! ----- Original Message ---- From: Andre-John Mas To: Sara Hugh ; RXTX Developers and Users Sent: Wednesday, October 31, 2007 9:55:45 AM Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered 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 __________________________________________________ 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/20071101/4a86bea6/attachment-0034.html From tjarvi at qbang.org Thu Nov 1 17:58:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 1 Nov 2007 17:58:02 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx Message-ID: The rxtx.org site is primarily interested in the hobby aspects of rxtx. Obviously, there are some companies following the work too. These interests bring larger workflows and concerns about details hobby folks may not care about. They also bring many more users. I know the company I work for has a quality engineering effort going on which includes rxtx. While the server was down, I was contacted by another company that was missing the binaries for their testing. Several people have mentioned concerns about a stable release for like reasons. Would there be interest on the quality side of the coin to get together? It could be just sharing email's with each other or a seperate list for QE/QA. I can not say for sure, but we may be able to share some of our efforts/results that could help keep rxtx releases stable. -- Trent Jarvi tjarvi at qbang.org From scldad at sdc.com.au Fri Nov 2 01:42:55 2007 From: scldad at sdc.com.au (Stephen Davies) Date: Fri, 2 Nov 2007 18:12:55 +1030 Subject: [Rxtx] Multiple modems Message-ID: <200711021812.56047.scldad@sdc.com.au> This may or may not be related to the Multiple Ports thread. I have an application which uses rxtx on Linux (via cron jobs) to connect multiple modems to remote sensing devices. The application works fine most of the time but occasionally fails to connect if two (or more) connection attempts happen at about the same time. When it fails, it looks as if it may get confused as to which port it is talking to. The app has a "base" component that looks for an available port, opens it and then creates an input thread and an output thread for the connection and data transfer. The "base" component uses this code: // loop round all known ports until one is available. Give up after three minutes Counter ptimeout = new Counter(); while(!portFound && ptimeout.elapsed() < 180000) { portList = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId = (CommPortIdentifier) portList.nextElement(); if (portId.getPortType() == CommPortIdentifier.PORT_SERIAL) { // special case. ttyS0 is not available to us on this server. if (!portId.isCurrentlyOwned() && !portId.getName().equals("/dev/ttyS0")) { gLog.debug(lognm + ": Found port " + portId.getName()); try { serialPort = (RXTXPort) portId.open("AguaModem", 10000); } catch (Exception e) { gLog.error(lognm + ": Port " + portId.getName() + " will not open."); gLog.error(e.getMessage()); continue; } AguaModem aguamodem = new AguaModem(); portFound = true; break; } gLog.debug(lognm + ": Port " + portId.getName() + " is busy"); } } } I am wondering about the isCurrentlyOwned method. Does this actually tell me whether a port is currently being used by another process? TIA, Stephen Davies -- ======================================================================== This email is for the person(s) identified above, and is confidential to the sender and the person(s). No one else is authorised to use or disseminate this email or its contents. Stephen Davies Consulting Voice: 08-8177 1595 Adelaide, South Australia. Fax: 08-8177 0133 Computing & Network solutions. Mobile:0403 0405 83 From fabioanjos at gmail.com Fri Nov 2 04:59:58 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 07:59:58 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> Message-ID: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/9009eb1d/attachment-0034.html From netbeans at gatworks.com Fri Nov 2 06:28:13 2007 From: netbeans at gatworks.com (U. George) Date: Fri, 02 Nov 2007 08:28:13 -0400 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <472B17DD.1050508@gatworks.com> It should normally block ( unless eof / event ) . so its a :{ whats the device ( to recreate if possible ) and how do u open. > My question is, is there a way to make in.read block the thead until > there's something to read? > From fabioanjos at gmail.com Fri Nov 2 06:34:46 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 09:34:46 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> Message-ID: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream(); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > On 11/1/07, Andre-John Mas wrote: > > > > Fabio, > > > > Turns out there was a small error in my example. The test should be: > > > > (numBytes = in.read(buffer)) > -1 > > > > This is because -1 indicates an end of file (end of data stream) > > > > Andre > > > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > > > Hi, > > > > > > I was using SerialEventListener in my project. But, as was said > > > here, id doesnt work very well with virtual serial ports. > > > So, I changed the strategy using the code posted here in this thread: > > > > > > try{ > > > in = port.getInputStream(); > > > out = port.getOutputStream(); > > > int numBytes = 0; > > > while(active){ > > > > > > byte[] buffer = new byte[10]; > > > > > > while ( (numBytes = in.read(buffer)) > 0) > > > { > > > String dataValue = new String(buffer,0,numBytes); > > > processInput(dataValue); > > > } > > > > > > if(numBytes==-1){ > > > break; > > > } > > > > > > Thread.sleep(50); > > > } > > > > > > }catch(IOException e){ > > > logger.info("falha de comunicacao "+ > > > getReceptor().getPort() ); > > > > > > }catch(InterruptedException e){ > > > logger.info ("Interrompendo leitura da porta "+ > > > getReceptor().getPort() ); > > > } > > > > > > The thing is that in my tests I could notice that in.read(buffer) > > > never blocks. Even when there's nothing to read. Instead of blocking > > > when there's nothing to read it returns 0. > > > > > > So, my questions are: > > > > > > 1. Am I doing something wrong? > > > 2. If not, wouldnt this decrease performance? (the thread would be > > > locked in a loop that does nothing.) > > > 3. Is there a better way to do the job? > > > > > > Thanks in advance!! > > > > > > F?bio > > > -------- > > > > > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > > 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 > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > > > > > -- > > > Atenciosamente, > > > F?bio Cristiano dos Anjos > > > _______________________________________________ > > > Rxtx mailing list > > > Rxtx at qbang.org > > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/5306c4b1/attachment-0034.html From nick.circelli at infrasafe.com Fri Nov 2 07:01:17 2007 From: nick.circelli at infrasafe.com (Nick Circelli) Date: Fri, 2 Nov 2007 08:01:17 -0500 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com><29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com><90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca><29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> Message-ID: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> I'm pretty sure that not blocking has to do with you virtual ports. Cause it should block. Maybe you should try: while ((numBytes = in.available()) > 0) { If (numBytes > buffer.length) { numBytes = buffer.length; // in case you have buffer overflow } numBytes = in.read(buffer, 0 , numBytes)); String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } Also, just for optimization, I'd move that byte[] buffer = new byte[10]; out of the while since you don't need to reallocate it every iteration. ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of F?bio Cristiano dos Anjos Sent: Friday, November 02, 2007 8:35 AM To: RXTX Developers and Users Subject: Re: [Rxtx] serialEvent(SerialPortEvent event) never be triggered Hi, I think i missunderstand something here. The code you post here was meant to be used inside serialEvent method, right? The think is, that i cannot user SerialEventListener to read serial ports, because i need to read virual serial ports and id does not behaves well, as said here before. serialEvent is never triggered. So what I quit using SerialEventListener and created a thread to listen to the port: public void run(){ try{ in = port.getInputStream(); out = port.getOutputStream (); int numBytes = 0; while(active){ byte[] buffer = new byte[10]; while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes,"ASCII"); processInput(dataValue); } if(numBytes==-1){ break; } Thread.sleep(50); } }catch(IOException e){ logger.info("falha de comunicacao "+ getReceptor().getPort() ); }catch(InterruptedException e){ logger.info("Interrompendo leitura da porta "+ getReceptor().getPort() ); } } So, the problem is that in.read(buffer) always returns 0 when there is nothing to read, instead of blocking the flow, and the thread becames locked in the loop. I hope you can help me solve this. Thanks in advance! F?bio -------- On 11/2/07, F?bio Cristiano dos Anjos wrote: Hi Andre! Thaks for answering! My real problem is that the in.read never blocks. It always returns 0 and the thread stays locked in the loop. while ( (numBytes = in.read(buffer)) > -1) { String dataValue = new String(buffer,0,numBytes); processInput(dataValue); } Theres nothing being written in the port, so the in.read should block the processing flow, until there's something to read or the end o data stream, as you said. But, instead, it always returns 0. My question is, is there a way to make in.read block the thead until there's something to read? Tanks again! F?bio -------- On 11/1/07, Andre-John Mas < ajmas at sympatico.ca > wrote: Fabio, Turns out there was a small error in my example. The test should be: (numBytes = in.read(buffer)) > -1 This is because -1 indicates an end of file (end of data stream) Andre On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > Hi, > > I was using SerialEventListener in my project. But, as was said > here, id doesnt work very well with virtual serial ports. > So, I changed the strategy using the code posted here in this thread: > > try{ > in = port.getInputStream(); > out = port.getOutputStream(); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > 0) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ > getReceptor().getPort() ); > > }catch(InterruptedException e){ > logger.info ("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > > The thing is that in my tests I could notice that in.read(buffer) > never blocks. Even when there's nothing to read. Instead of blocking > when there's nothing to read it returns 0. > > So, my questions are: > > 1. Am I doing something wrong? > 2. If not, wouldnt this decrease performance? (the thread would be > locked in a loop that does nothing.) > 3. Is there a better way to do the job? > > Thanks in advance!! > > F?bio > -------- > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > 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 > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx -- Atenciosamente, F?bio Cristiano dos Anjos -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/4de7f6a3/attachment-0034.html From fabioanjos at gmail.com Fri Nov 2 07:36:53 2007 From: fabioanjos at gmail.com (=?ISO-8859-1?Q?F=E1bio_Cristiano_dos_Anjos?=) Date: Fri, 2 Nov 2007 10:36:53 -0300 Subject: [Rxtx] serialEvent(SerialPortEvent event) never be triggered In-Reply-To: <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> References: <600074.21299.qm@web55806.mail.re3.yahoo.com> <29788b250711011135t7d5ba252ocd870ef38c10cb09@mail.gmail.com> <90182AF1-C45D-400A-8D38-432FBE02420F@sympatico.ca> <29788b250711020359l64455154h5e50a6bead3c2554@mail.gmail.com> <29788b250711020534n6d6472b8ndf4c7e24aec976a6@mail.gmail.com> <26942855A698324184B3BA0F7896028B0281D594@34093-EVS2C1.exchange.rackspace.com> Message-ID: <29788b250711020636q1588c88fgaa5e27f5504164fb@mail.gmail.com> Hi Nick, Actually, it doesnt block for physical ports too. And, the method avaiable does not block either, so when there's nothing avaiable the loop ends and the thread stops lintening to the port. But I did some more test with serialEventListener, and now its working. I realy dont know what I've done to get it working. I just start woking as soon as I decided to test it again. It was said here that serialEventListener is not reliable for virtual serial ports. Is there another way to read it, without compromising performance? Tanks again!! F?bio ------- On 11/2/07, Nick Circelli wrote: > > I'm pretty sure that not blocking has to do with you virtual ports. > Cause it should block. > > Maybe you should try: > > > > while ((numBytes = in.available()) > 0) > > { > > If (numBytes > buffer.length) { > > numBytes = buffer.length; // in case you have buffer overflow > > } > > numBytes = in.read(buffer, 0 , numBytes)); > > String dataValue = new String(buffer,0,numBytes,"ASCII"); > > processInput(dataValue); > > } > > > > Also, just for optimization, I'd move that byte[] buffer = new > byte[10]; > > out of the while since you don't need to reallocate it every iteration. > > > ------------------------------ > > *From:* rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] *On Behalf > Of *F?bio Cristiano dos Anjos > *Sent:* Friday, November 02, 2007 8:35 AM > *To:* RXTX Developers and Users > *Subject:* Re: [Rxtx] serialEvent(SerialPortEvent event) never be > triggered > > > > Hi, > > I think i missunderstand something here. > The code you post here was meant to be used inside serialEvent method, > right? > > The think is, that i cannot user SerialEventListener to read serial ports, > because i need to read virual serial ports and id does not behaves well, as > said here before. serialEvent is never triggered. > > So what I quit using SerialEventListener and created a thread to listen to > the port: > > public void run(){ > try{ > in = port.getInputStream(); > out = port.getOutputStream (); > int numBytes = 0; > while(active){ > > byte[] buffer = new byte[10]; > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new > String(buffer,0,numBytes,"ASCII"); > processInput(dataValue); > } > > if(numBytes==-1){ > break; > } > > Thread.sleep(50); > } > > }catch(IOException e){ > logger.info("falha de comunicacao "+ getReceptor().getPort() > ); > > }catch(InterruptedException e){ > logger.info("Interrompendo leitura da porta "+ > getReceptor().getPort() ); > } > } > > > So, the problem is that in.read(buffer) always returns 0 when there is > nothing to read, instead of blocking the flow, and the thread becames locked > in the loop. > > I hope you can help me solve this. > > Thanks in advance! > > F?bio > -------- > > On 11/2/07, *F?bio Cristiano dos Anjos* wrote: > > Hi Andre! Thaks for answering! > > My real problem is that the in.read never blocks. It always returns 0 and > the thread stays locked in the loop. > > while ( (numBytes = in.read(buffer)) > -1) > { > String dataValue = new String(buffer,0,numBytes); > processInput(dataValue); > } > > Theres nothing being written in the port, so the in.read should block the > processing flow, until there's something to read or the end o data stream, > as you said. But, instead, it always returns 0. > > My question is, is there a way to make in.read block the thead until > there's something to read? > > Tanks again! > > F?bio > -------- > > > > On 11/1/07, *Andre-John Mas* < ajmas at sympatico.ca> wrote: > > Fabio, > > Turns out there was a small error in my example. The test should be: > > (numBytes = in.read(buffer)) > -1 > > This is because -1 indicates an end of file (end of data stream) > > Andre > > On 1-Nov-07, at 14:35 , F?bio Cristiano dos Anjos wrote: > > > Hi, > > > > I was using SerialEventListener in my project. But, as was said > > here, id doesnt work very well with virtual serial ports. > > So, I changed the strategy using the code posted here in this thread: > > > > try{ > > in = port.getInputStream(); > > out = port.getOutputStream(); > > int numBytes = 0; > > while(active){ > > > > byte[] buffer = new byte[10]; > > > > while ( (numBytes = in.read(buffer)) > 0) > > { > > String dataValue = new String(buffer,0,numBytes); > > processInput(dataValue); > > } > > > > if(numBytes==-1){ > > break; > > } > > > > Thread.sleep(50); > > } > > > > }catch(IOException e){ > > logger.info("falha de comunicacao "+ > > getReceptor().getPort() ); > > > > }catch(InterruptedException e){ > > logger.info ("Interrompendo leitura da porta "+ > > getReceptor().getPort() ); > > } > > > > The thing is that in my tests I could notice that in.read(buffer) > > never blocks. Even when there's nothing to read. Instead of blocking > > when there's nothing to read it returns 0. > > > > So, my questions are: > > > > 1. Am I doing something wrong? > > 2. If not, wouldnt this decrease performance? (the thread would be > > locked in a loop that does nothing.) > > 3. Is there a better way to do the job? > > > > Thanks in advance!! > > > > F?bio > > -------- > > > > > > > > On 10/31/07, Andre-John Mas < ajmas at sympatico.ca > wrote: > > 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 > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > > > > -- > > Atenciosamente, > > F?bio Cristiano dos Anjos > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > > > > > -- > Atenciosamente, > F?bio Cristiano dos Anjos > -- Atenciosamente, F?bio Cristiano dos Anjos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071102/571df6ea/attachment-0033.html From tjarvi at qbang.org Fri Nov 2 08:32:15 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 2 Nov 2007 08:32:15 -0600 (MDT) Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: References: Message-ID: On Fri, 2 Nov 2007, Greg Johnson wrote: > Hi Trent, folks, > Having a single rxtx that is suitable for commercial uses and hobbyists both > would be a great idea? Perhaps it would be worth submitting rxtx as a > proposal to Codehaus - they not only provide excellent tools (Jira (bug > tracker), Confluence (wiki)) but also support build management ( > maestro, continuum, bamboo). Relying on your personal machine (btw, frii.com > / rxtx.org is down again?) seems like a burden you shouldn't have to shoulder > alone. Hi Greg, There may be a little confusion here. There is no need to have two seperate rxtx releases. What I'm trying to encourage is a discussion between some of the people responsible for making sure rxtx does not break their products each release. Usually these people are interested in testing a set of functionality their product depends upon. They do not work with rxtx code but rather traps to catch when rxtx developers break something. This goes on all the time in isolated labs. There are many services that offer to do various pieces of a project for you if you... Anyone is free to do the 'if you' portion with rxtx and see how it goes. I'm actually interested in doing less of that than more. The rxtx.org work I do just happens to overlap with other things I do for personal/family use. The reason I suggest the amazon solution is that anyone can take full control of the environment for a day and it costs less than a package of gum without causing harm to what anyone else is doing. I assume the down question was with respect to a mod_security setting that has been resolved. If not, please post a url to the problem. -- Trent Jarvi tjarvi at qbang.org From nsayer at kfu.com Sat Nov 3 20:17:49 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 19:17:49 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? Message-ID: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Has anyone got RXTX working with an app under Leopard? My app hangs on port open (it works fine with Tiger). The relevant thread looks like this in the activity monitor: 1536 JVM_InvokeMethod 1536 0x48ccd0 1536 0x46f8a0 1536 0x4c3ff4 1536 0x4c4284 1536 0x357d160 1536 0x357faac 1536 Java_gnu_io_RXTXPort_open 1536 open $NOCANCEL$UNIX2003 1536 open $NOCANCEL$UNIX2003 From ajmas at sympatico.ca Sat Nov 3 22:02:04 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 00:02:04 -0400 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> RXTX works for me with Leopard. I am currently using it communicate with a Bluetooth GPS. What computer and device are you trying to use? Is the driver for your serial device compatible with MacOS X 10.5? Andre On 3-Nov-07, at 22:17 , Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From nsayer at kfu.com Sat Nov 3 22:17:47 2007 From: nsayer at kfu.com (Nick Sayer) Date: Sat, 3 Nov 2007 21:17:47 -0700 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> <36E67FBE-FE60-4A60-87BE-4698AE8D1CFE@sympatico.ca> Message-ID: <1720F723-3643-438C-B3AB-E09A67536977@kfu.com> On Nov 3, 2007, at 9:02 PM, Andre-John Mas wrote: > RXTX works for me with Leopard. I am currently using it communicate > with a Bluetooth GPS. > > What computer and device are you trying to use? Is the driver for > your serial device compatible with MacOS X 10.5? An Intel mac mini The FTDI USB serial driver an XMPCR, which is just a fancy serial controlled radio and an FTDI usb-to-serial chip I've successfully used the FTDI driver with another FTDI device in another context. > > > Andre > > On 3-Nov-07, at 22:17 , Nick Sayer wrote: > >> Has anyone got RXTX working with an app under Leopard? >> >> My app hangs on port open (it works fine with Tiger). The relevant >> thread looks like this in the activity monitor: >> >> 1536 JVM_InvokeMethod >> 1536 0x48ccd0 >> 1536 0x46f8a0 >> 1536 0x4c3ff4 >> 1536 0x4c4284 >> 1536 0x357d160 >> 1536 0x357faac >> 1536 >> Java_gnu_io_RXTXPort_open >> 1536 open >> $NOCANCEL$UNIX2003 >> 1536 open >> $NOCANCEL$UNIX2003 >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From racecar at gmail.com Sat Nov 3 22:25:53 2007 From: racecar at gmail.com (Kevin Mateo Lim) Date: Sat, 3 Nov 2007 21:25:53 -0700 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: Message-ID: I am alternating between two errors. After i run the macosx_setup.command, "everyone" is set to Read only in /var/lock. I notice in the terminal that the group for these perms is _uucp, not uucp. In that state, I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 check_group_uucp(): error testing lock file creation Error details:Permission deniedcheck_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException : Error inside Serial.() at processing.serial.Serial.errorMessage(Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.( Serial.java:102) at Temporary_829_3245.setup(Temporary_829_3245.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java :690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) Then, I hand edit the "everyone" permissions for /var/lock/ to Read and Write (note /var/spool/uucp is Read/Write in all cases, and doesn't change). I get this error: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 RXTX uucp_lock() /var/lock/LK.003.009.000 is there gnu.io.PortInUseException: Unknown Application at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) java.lang.RuntimeException: Error inside Serial.() at processing.serial.Serial.errorMessage (Serial.java:583) at processing.serial.Serial.(Serial.java:148) at processing.serial.Serial.(Serial.java:102) at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) at processing.core.PApplet.handleDisplay(PApplet.java:1384) at processing.core.PGraphics.requestDisplay(PGraphics.java:690) at processing.core.PApplet.run(PApplet.java:1556) at java.lang.Thread.run(Thread.java:613) See here: http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071103/f1a2c467/attachment-0032.html From greg.johnson at manchester.ac.uk Sun Nov 4 02:31:13 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sun, 4 Nov 2007 10:31:13 +0100 Subject: [Rxtx] MacOS X Leopard compatibility? In-Reply-To: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> References: <73275D6D-1D1A-481A-AF97-5365F49A50C4@kfu.com> Message-ID: <28B5E0A0-0802-4C74-AC21-87ED35F3B9A2@manchester.ac.uk> Hi Nick, I also had problems initially with Leopard, but it was resolved by reinstalling the serial USB driver (FTDI in my case). The symptoms were a non-detection of any ports (but I twigged when I tried ZTerm and it had the same problem). Good luck! Cheers, greg PS I did a "Archive and install" which may be the reason my FTDI driver had disappeared - I don't think the driver has changed for 10.5 ------------------------------------------------------------------------- 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 4 Nov 2007, at 03:17, Nick Sayer wrote: > Has anyone got RXTX working with an app under Leopard? > > My app hangs on port open (it works fine with Tiger). The relevant > thread looks like this in the activity monitor: > > 1536 JVM_InvokeMethod > 1536 0x48ccd0 > 1536 0x46f8a0 > 1536 0x4c3ff4 > 1536 0x4c4284 > 1536 0x357d160 > 1536 0x357faac > 1536 > Java_gnu_io_RXTXPort_open > 1536 open > $NOCANCEL$UNIX2003 > 1536 open > $NOCANCEL$UNIX2003 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From ajmas at sympatico.ca Sun Nov 4 13:01:12 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 15:01:12 -0500 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: Message-ID: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Hi, You will need to get the 2.1-8 code from CVS. See the FAQ for more information: http://rxtx.qbang.org/wiki/index.php/FAQ Andre On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > I am alternating between two errors. > > After i run the macosx_setup.command, "everyone" is set to Read only > in /var/lock. I notice in the terminal that the group for these > perms is _uucp, not uucp. > > In that state, I get this error: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > check_group_uucp(): error testing lock file creation Error > details:Permission deniedcheck_lock_status: No permission to create > lock file. > please see: How can I use Lock Files with rxtx? in INSTALL > gnu.io.PortInUseException: Unknown Application > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > java.lang.RuntimeException : Error inside Serial.() > > at processing.serial.Serial.errorMessage(Serial.java:583) > > at processing.serial.Serial.(Serial.java:148) > > at processing.serial.Serial.( Serial.java:102) > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > at processing.core.PApplet.run(PApplet.java:1556) > > at java.lang.Thread.run(Thread.java:613) > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > and Write (note /var/spool/uucp is Read/Write in all cases, and > doesn't change). I get this error: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > gnu.io.PortInUseException: Unknown Application > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > java.lang.RuntimeException: Error inside Serial.() > > at processing.serial.Serial.errorMessage (Serial.java:583) > > at processing.serial.Serial.(Serial.java:148) > > at processing.serial.Serial.(Serial.java:102) > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > at processing.core.PApplet.run(PApplet.java:1556) > > at java.lang.Thread.run(Thread.java:613) > > See here: > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From netbeans at gatworks.com Sun Nov 4 14:33:35 2007 From: netbeans at gatworks.com (U. George) Date: Sun, 04 Nov 2007 16:33:35 -0500 Subject: [Rxtx] #ifndef TIOCSERGETLSR Message-ID: <472E3AAF.7050709@gatworks.com> For Linux, it seems that you need the code for both *having* a TIOCSERGETLSR, and *not having* a TIOCSERGETLSR. Maybe the ioctl exists system wide, but not necessarily for the device driver itself ( always returns -1 ) . Are there systems that have a *functioning* TIOCSERGETLSR for all their devices? Then this would be the case where the "#ifndef TIOCSERGETLSR" directive could be useful is eliminating the unnecessary code and tests. And for those systems that dont have a TIOCSERGETLSR, then the code for TIOCSERGETLSR can be eliminated. It would be a simple case to have, as a foundation, all the code to simulate the missing TIOCSERGETLSR ioctl. If the system does have the ioctl, then that code can be ifdef'd in, and co-exist with the functionality of the code that simulates the missing TIOCSERGETLSR ioctl. From racecar at gmail.com Sun Nov 4 17:30:19 2007 From: racecar at gmail.com (Kevin Mateo Lim) Date: Sun, 4 Nov 2007 17:30:19 -0700 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: the README.OSX reads: Put libSerial.jnilib in the directory of the application (the JavaVM will find it there). Add RXTXComm.jar to the application classpath or include the classes in the application jar. (Some applications already include the RXTX classes in their application jar, in which case only the file libSerial.jnilib is required). I can't find libSerial.jnilib I put librxtxSerial.jnilib into my Processing /libraries/serial/library/ directory. Yet it still sees the old version: Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 On 11/4/07, Andre-John Mas wrote: > > Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > 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/20071104/c0a83f91/attachment-0031.html From ajmas at sympatico.ca Sun Nov 4 17:41:47 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 4 Nov 2007 19:41:47 -0500 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> If you are wanting it to be available for all applications, - for all users: /Library/Java/Extensions - for your user: ~/Library/Java/Extensions Or just for your application, then it should be in the same directory from which yo are launching your application. If you are getting the 2.1-8 source, then the library built is called: librxtxSerial.jnilib despite what the docs say. Andre On 4-Nov-07, at 19:30 , Kevin Mateo Lim wrote: > > the README.OSX reads: > Put > libSerial.jnilib > in the directory of the application (the JavaVM will find it there). > Add > RXTXComm.jar > to the application classpath or include the classes in the > application jar. > (Some applications already include the RXTX classes in their > application jar, > in which case only the file libSerial.jnilib is required). > > > I can't find libSerial.jnilib > I put librxtxSerial.jnilib into my Processing /libraries/serial/ > library/ directory. > > Yet it still sees the old version: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > On 11/4/07, Andre-John Mas wrote: Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial .(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay (PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at qbang.org > > http://mailman.qbang.org/mailman/listinfo/rxtx > From bschlining at gmail.com Sun Nov 4 19:46:23 2007 From: bschlining at gmail.com (Brian Schlining) Date: Sun, 4 Nov 2007 18:46:23 -0800 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> <63D33018-83DD-4ED5-9BB0-FFFE3F29F47B@sympatico.ca> Message-ID: > > Or just for your application, then it should be in the same directory > from which yo are launching your application. Just wanted to add one more way of specifying the native lib location... If you don't want to define it globally by putting it in /Library/Java/Extensions (and you don't, it's a very very bad practice) you can also specify the location of the native library when starting the JVM by specifying the 'java.library.path' property. For example: java -Djava.library.path=/Path/To/Directory/With/RXTX/Library YourMainClass -- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Brian Schlining -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071104/c5af6980/attachment-0031.html From greg.johnson at manchester.ac.uk Mon Nov 5 01:39:02 2007 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Mon, 5 Nov 2007 09:39:02 +0100 Subject: [Rxtx] RXTX issue in Leopard while using Processing In-Reply-To: References: <48EEB6BB-A13E-4107-A314-7BA245D6FADF@sympatico.ca> Message-ID: The 2.1-8 code reports 2.1-7, hence your (and my) confusion. But as long as you've removed all traces of the old library, it really _is_ 2.1-8. And if you specify the library path to the VM, don't make my mistake (on OSX at least) - you need to respecify the entire library path it had by default, as the command line argument replaces the path, rather than appending to it. 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 5 Nov 2007, at 01:30, Kevin Mateo Lim wrote: > > the README.OSX reads: > Put > libSerial.jnilib > in the directory of the application (the JavaVM will find it there). > Add > RXTXComm.jar > to the application classpath or include the classes in the > application jar. > (Some applications already include the RXTX classes in their > application jar, > in which case only the file libSerial.jnilib is required). > > > I can't find libSerial.jnilib > I put librxtxSerial.jnilib into my Processing /libraries/serial/ > library/ directory. > > Yet it still sees the old version: > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 > On 11/4/07, Andre-John Mas wrote: > Hi, > > You will need to get the 2.1-8 code from CVS. See the FAQ for more > information: > > http://rxtx.qbang.org/wiki/index.php/FAQ > > Andre > > On 4-Nov-07, at 00:25 , Kevin Mateo Lim wrote: > > > > > I am alternating between two errors. > > > > After i run the macosx_setup.command, "everyone" is set to Read only > > in /var/lock. I notice in the terminal that the group for these > > perms is _uucp, not uucp. > > > > In that state, I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > check_group_uucp(): error testing lock file creation Error > > details:Permission deniedcheck_lock_status: No permission to create > > lock file. > > please see: How can I use Lock Files with rxtx? in INSTALL > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354) > > > > java.lang.RuntimeException : Error inside Serial.() > > > > at processing.serial.Serial.errorMessage(Serial.java:583) > > > > at processing.serial.Serial.(Serial.java:148) > > > > at processing.serial.Serial.( Serial.java:102) > > > > at Temporary_829_3245.setup(Temporary_829_3245.java:10) > > > > at processing.core.PApplet.handleDisplay(PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java :690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > > > > > > > Then, I hand edit the "everyone" permissions for /var/lock/ to Read > > and Write (note /var/spool/uucp is Read/Write in all cases, and > > doesn't change). I get this error: > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 > > > > RXTX uucp_lock() /var/lock/LK.003.009.000 is there > > gnu.io.PortInUseException: Unknown Application > > > > at gnu.io.CommPortIdentifier.open (CommPortIdentifier.java:354) > > > > java.lang.RuntimeException: Error inside Serial.() > > > > at processing.serial.Serial.errorMessage (Serial.java:583) > > > > at processing.serial.Serial .(Serial.java:148) > > > > at processing.serial.Serial.(Serial.java:102) > > > > at Temporary_4187_6908.setup(Temporary_4187_6908.java:10) > > > > at processing.core.PApplet.handleDisplay (PApplet.java:1384) > > > > at processing.core.PGraphics.requestDisplay(PGraphics.java:690) > > > > at processing.core.PApplet.run(PApplet.java:1556) > > > > at java.lang.Thread.run(Thread.java:613) > > > > See here: > > http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Electronics;action=display;num=1193459849 > > > > _______________________________________________ > > 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 HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071105/7f50506d/attachment-0031.html From cyrille.dumont at tatexpress.fr Mon Nov 5 05:46:03 2007 From: cyrille.dumont at tatexpress.fr (Cyrille DUMONT) Date: Mon, 05 Nov 2007 13:46:03 +0100 Subject: [Rxtx] READ PDF417 - PB if more than 200 chars on port COM In-Reply-To: References: <472727F1.1000704@tatexpress.fr> Message-ID: <472F108B.2090101@tatexpress.fr> Thanks a lot for your solution ... but I'm not a expert in JAVA ... (sorry) For the moment I've this function : """ public void serialEvent(SerialPortEvent e) { StringBuffer inputBuffer = new StringBuffer(); int newData = 0; switch (e.getEventType()) { case SerialPortEvent.DATA_AVAILABLE: while (newData != -1) { try { newData = is.read(); if (newData == -1) { break; } inputBuffer.append((char) newData); } catch (IOException ex) { System.err.println(ex); return; } } //-- Manag. Data from Scanner this.MngDataScanner(inputBuffer.toString()); break; case SerialPortEvent.BI:; //-- Break Received } } """ How can I do what you write ? ( maybe a simple ex ? ) PS : I don't know the PDF417 size (could be, for example, 338 char, or 500 ... ; what I know is that it can't be more than 800 char) Thanks in advance. Best regards. Trent Jarvi a ?crit : > 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 Martin.Oberhuber at windriver.com Mon Nov 5 08:47:50 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 5 Nov 2007 16:47:50 +0100 Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> Hi Trent, are the interestes of hobbyists really so different from commercial ones? Both should be interested in high quality and innovation the like. I haven't seen too many Open Source projects from the "inside" but those that I have seen did not have separate mailing lists for quality/testing/qa versus innovation/development. What I have seen with the Open Source projects that one would call "successful" is a good deal of process around automated builds, automated unit tests, predictable release dates and milestones, and policies around commiting/contributing/reviewing changes. I think that all of these benefit commercial users and hobbyists the like. If you were just asking about who's interested in discussing changes to foster more quality, count me in. I'm just not sure whether discussing these on a separate mailing list or other channel is the right thing to do. Cheers, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From toupsz at cs.tamu.edu Tue Nov 6 14:27:04 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 15:27:04 -0600 Subject: [Rxtx] reading TTL level signals from serial? Message-ID: Dear RXTX community- I've been using RXTX to handle communicating with several hardware devices in Java (a GPS and some custom audio circuitry for my dissertation work). I have a new, high-accuracy GPS which only communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there any way to communicate with this device using RXTX, perhaps by modding the native code for Windows? If so, does anyone have any tips on how to do it? Has it perhaps already been done? Another option is for me to invert / amplify the signal in hardware, but this is difficult for me to pull off due to the sensitivity of the electronics involved...I'll likely end up using a much less accurate piece of equipment rather than go that far! If anyone could help out, I'd really appreciate it! Thanks! -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/b6c59c2b/attachment-0029.html From netbeans at gatworks.com Tue Nov 6 14:55:22 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 06 Nov 2007 16:55:22 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: Message-ID: <4730E2CA.3090009@gatworks.com> This is really a hardware issue. Is there any device ( ie the serial port ) on your computer that will accept the voltage signals ( and load ) that your device produces? Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it happen safely ( ie u dont cook the GPS device ) I have a new, high-accuracy GPS which only > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there > any way to communicate with this device using RXTX, From toupsz at cs.tamu.edu Tue Nov 6 15:14:01 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 16:14:01 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4730E2CA.3090009@gatworks.com> References: <4730E2CA.3090009@gatworks.com> Message-ID: Actually, the device runs over USB, but shows up as a virtual serial port and is outputting these signals. The software that comes with the device (a u-blox ANTARIS 4 eval kit) is able to communicate. RXTX is able to detect and properly configure the port, but does not get any of the data from it. :-/ It seems like there must be some way to do it (obviously, ublox knows how)... -Zach On Nov 6, 2007 3:55 PM, U. George wrote: > This is really a hardware issue. > Is there any device ( ie the serial port ) on your computer that will > accept the voltage signals ( and load ) that your device produces? > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it > happen safely ( ie u dont cook the GPS device ) > > > I have a new, high-accuracy GPS which only > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is there > > any way to communicate with this device using RXTX, > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/15ae7a0b/attachment-0029.html From keithvz at verizon.net Tue Nov 6 16:16:55 2007 From: keithvz at verizon.net (Keith Monahan) Date: Tue, 06 Nov 2007 18:16:55 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> Message-ID: <4730F5E7.1030704@verizon.net> Zach Toups wrote: > On Nov 6, 2007 3:55 PM, U. George > wrote: > > This is really a hardware issue. > Is there any device ( ie the serial port ) on your computer that will > accept the voltage signals ( and load ) that your device produces? > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make it > happen safely ( ie u dont cook the GPS device ) > > > I have a new, high-accuracy GPS which only > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is > there > > any way to communicate with this device using RXTX, > _______________________________________________ As UGeorge intimated, it's a hardware issue. If your device outputs TTL level voltages, and your USB to serial converter is RS-232, then you've got a physical hardware differences. Inverted leads and voltage issues are mainly the problem. MAXIM makes a neat little chip called the MAX233 (better than the 232, no extern caps required) You can't solve this in software. Now, there are TTL level compatible USB to serial converters available, I happen to be using one right now. This unit below is from a UK company (there might be sources in the US) http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm Parallax makes one that does 3.3 and 5v http://www.parallax.com/detail.asp?product_id=32201 (but only supports RX, TX, GND, AND DTR towards device) (i've tested a variant of the unit above, and it works with RXTX) In both cases, you'll need some creative wiring depending on the interface on your GPS. Hope this helps Keith From toupsz at cs.tamu.edu Tue Nov 6 16:53:01 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 6 Nov 2007 17:53:01 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4730F5E7.1030704@verizon.net> References: <4730E2CA.3090009@gatworks.com> <4730F5E7.1030704@verizon.net> Message-ID: Yeah...I used an FTDI chip to handle USB/serial conversion on the audio equipment I built. I'm leery of trying to build a board for this ublox GPS due to all the grounding/shielding issues around it. Anyway, I apreciate the help...just sad that I can't handle the problem in software! Ublox did send me the source code for their USB drivers...but as a Java programmer, it's a bit tough for me to sort out. ;) Thanks again! -Zach On Nov 6, 2007 5:16 PM, Keith Monahan wrote: > Zach Toups wrote: > > > On Nov 6, 2007 3:55 PM, U. George > > wrote: > > > > This is really a hardware issue. > > Is there any device ( ie the serial port ) on your computer that > will > > accept the voltage signals ( and load ) that your device produces? > > Maybe u just need a ttl to rs232 converter ( one IC chip ) to make > it > > happen safely ( ie u dont cook the GPS device ) > > > > > > I have a new, high-accuracy GPS which only > > > communicates at TTL levels (so about +3V for 1 and 0V for 0). Is > > there > > > any way to communicate with this device using RXTX, > > _______________________________________________ > > As UGeorge intimated, it's a hardware issue. > > If your device outputs TTL level voltages, and your USB to serial > converter is RS-232, then you've got a physical hardware differences. > Inverted leads and voltage issues are mainly the problem. MAXIM makes a > neat little chip called the MAX233 (better than the 232, no extern caps > required) > > You can't solve this in software. > > Now, there are TTL level compatible USB to serial converters available, > I happen to be using one right now. > > This unit below is from a UK company (there might be sources in the US) > > http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm > > Parallax makes one that does 3.3 and 5v > > http://www.parallax.com/detail.asp?product_id=32201 > (but only supports RX, TX, GND, AND DTR towards device) > > (i've tested a variant of the unit above, and it works with RXTX) > > In both cases, you'll need some creative wiring depending on the > interface on your GPS. > > Hope this helps > > Keith > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071106/06e88ad4/attachment-0029.html From netbeans at gatworks.com Tue Nov 6 17:14:01 2007 From: netbeans at gatworks.com (U. George) Date: Tue, 06 Nov 2007 19:14:01 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> <4730F5E7.1030704@verizon.net> Message-ID: <47310349.5000406@gatworks.com> what gps chipset do u have? > Ublox did send me the source code for their USB drivers...but as a Java > programmer, it's a bit tough for me to sort out. ;) From Steffen.DETTMER at ingenico.com Wed Nov 7 03:10:01 2007 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 7 Nov 2007 11:10:01 +0100 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> Message-ID: <20071107101000.GN10978@elberon.bln.de.ingenico.com> * Zach Toups wrote on Tue, Nov 06, 2007 at 16:14 -0600: > Actually, the device runs over USB, but shows up as a virtual > serial port and is outputting these signals. Ahh, so what you want is to use rxtx on the serial port that is created by the driver and mapped maybe as some COM8 or whatever? I this case then IMHO it would be no hardware question but maybe a problem in your application, or some driver or indeed a rxtx issue. > The software that > comes with the device (a u-blox ANTARIS 4 eval kit) is able to > communicate. Is it sure that this software is really using the virtual serial port and only this port? oki, Steffen -- About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. About Ingenico Throughout the world businesses rely on Ingenico for secure and expedient electronic transaction acceptance. Ingenico products leverage proven technology, established standards and unparalleled ergonomics to provide optimal reliability, versatility and usability. This comprehensive range of products is complemented by a global array of services and partnerships, enabling businesses in a number of vertical sectors to accept transactions anywhere their business takes them. www.ingenico.com This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. From netbeans at gatworks.com Wed Nov 7 04:59:10 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 06:59:10 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <20071107101000.GN10978@elberon.bln.de.ingenico.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> Message-ID: <4731A88E.6080705@gatworks.com> >> The software that >> comes with the device (a u-blox ANTARIS 4 eval kit) is able to >> communicate. > > Is it sure that this software is really using the virtual serial > port and only this port? > I have tried to read the docs. I have yet to find any explanation on a (windoz) device driver for this device ( the usb device ). That magic is not explained. For a developer thats important magic. Maybe a call to their support team is in order? From netbeans at gatworks.com Wed Nov 7 05:01:38 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 07:01:38 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <20071107101000.GN10978@elberon.bln.de.ingenico.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> Message-ID: <4731A922.7@gatworks.com> Steffen DETTMER wrote: > * Zach Toups wrote on Tue, Nov 06, 2007 at 16:14 -0600: >> Actually, the device runs over USB, but shows up as a virtual BTW: it seems that I am not getting all the Rxtx mail. Is there still a problem? From toupsz at cs.tamu.edu Wed Nov 7 07:36:20 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Wed, 7 Nov 2007 08:36:20 -0600 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: <4731A88E.6080705@gatworks.com> References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> <4731A88E.6080705@gatworks.com> Message-ID: When I emailed them about this issue, they sent me their WinCE drivers, which are apparently based on this open source driver: http://www.yetanotherhomepage.com/j7xx/j7xx.html?/j7xx/software/util/usbdriver.html These include srcdll, and x86 subfolders, though it's not 100% clear to me that these are useful. The ublox communication suite appears to only communicate with serial ports...I've communicated with the ublox on two different comm ports (one with the serial adapter plugged into the serial port, one with the main USB connection), as well as a Garmin bluetooth GPS (which comes up as a bluetooth serial device). I'm not well versed in code this close to the hardware, but it seems to me that if you're running a virtual serial port, then you're virtually controlling the "voltages" that come in on this "port"...so why would they be "ttl level"? :-/ Shouldn't the USB driver be able to interpret the signals in whatever way it wants and just supply software with the binary interpretation? Thanks for all the help, guys, it's really appreciated! -Zach On Nov 7, 2007 5:59 AM, U. George wrote: > > >> The software that > >> comes with the device (a u-blox ANTARIS 4 eval kit) is able to > >> communicate. > > > > Is it sure that this software is really using the virtual serial > > port and only this port? > > > > I have tried to read the docs. I have yet to find any explanation on a > (windoz) device driver for this device ( the usb device ). That magic > is not explained. For a developer thats important magic. Maybe a call > to their support team is in order? > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071107/18a13314/attachment-0028.html From netbeans at gatworks.com Wed Nov 7 08:55:55 2007 From: netbeans at gatworks.com (U. George) Date: Wed, 07 Nov 2007 10:55:55 -0500 Subject: [Rxtx] reading TTL level signals from serial? In-Reply-To: References: <4730E2CA.3090009@gatworks.com> <20071107101000.GN10978@elberon.bln.de.ingenico.com> <4731A88E.6080705@gatworks.com> Message-ID: <4731E00B.9030902@gatworks.com> There are 2 components to talking to hardware. There is the electrical specification, and then there is the software specification. there is the rs232 specification, parallel port specification, and the USB electrical specification. Generally these are used to plug in the various devices, and hook up electrically. Then there is the software side. There is the device driver, a software component that sits somewhere in the kernel that handles the USB ( in your case ) controller. The device driver generally does not care about the electrical component. There are various chips that handle USB signals, and these chips have I/O addresses so that signals and data can be properly routed. There is also the side that communicates to the user via the COM port device-name. The device driver that you mentioned is for the "Support PL2303 serial chip". This device driver, which hopefully works, handles the USB chip, and eventually recognzes the gps device, and hopefully creates an COM port so the user can open up and communicate. These are a lot of "HOPES". Since u have the web address of the device driver, and developer, I would think that the developer, and any docs, might be better able to help u to first determine if the GPS device is recognized, and the COM port ( maybe its called by another name ) is created, as per documentation. > > These include srcdll, and x86 subfolders, though it's not 100% clear to > me that these are useful. From tjarvi at qbang.org Sat Nov 10 17:46:13 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 10 Nov 2007 17:46:13 -0700 (MST) Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE648584803789267@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 5 Nov 2007, Oberhuber, Martin wrote: > Hi Trent, > > are the interestes of hobbyists really so different > from commercial ones? Both should be interested in > high quality and innovation the like. > > I haven't seen too many Open Source projects from the > "inside" but those that I have seen did not have > separate mailing lists for quality/testing/qa > versus innovation/development. > > What I have seen with the Open Source projects that > one would call "successful" is a good deal of > process around automated builds, automated unit > tests, predictable release dates and milestones, > and policies around commiting/contributing/reviewing > changes. > > I think that all of these benefit commercial users > and hobbyists the like. > > If you were just asking about who's interested in > discussing changes to foster more quality, count > me in. I'm just not sure whether discussing these > on a separate mailing list or other channel is the > right thing to do. > Hi Martin, There are two issues I'm thinking about. The first is the generic unit testing and quality initiatives required to move rxtx forward. The second is the inevitable fact that rxtx connects to external hardware. The discussion deals with a different set of problems. Here is a simple example of what I'm getting at. We have the capability of setting custom baud rates in rxtx. We may be interested in seeing regressions in rxtx, the C library or the kernel. Some people may be doing some tests with loopback connections. These will always work even if the baud rate is not set to the expected value. Some people may use null modems between two ports. This may be able to catch the problem but not always. Will the build machines be able to test this? (no - for a few reasons) Will people be trying to catch these type of regressions? (yes) What type of coverage does the community have in the end? (?) We could include the discussions in the same list or another equally open list that may be of interest to some folks that deal with these types of problems on a regular basis. -- Trent Jarvi tjarvi at qbang.org From timlow84 at gmail.com Mon Nov 12 00:31:17 2007 From: timlow84 at gmail.com (Timothy Low) Date: Mon, 12 Nov 2007 15:31:17 +0800 Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> Message-ID: <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> ---------- Forwarded message ---------- From: Timothy Low Date: Nov 12, 2007 3:02 PM Subject: Building RXTX From Source To: taj at www.linux.org.uk Cc: ferdinand.tang at tangs.net, Timothy Low , chweehuat.ng at tangs.net Hi Trent, I tried building RXTX from source, and I got this error. I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm trying to get the necessary ".so" files to use for my serial port communication through java. My linux kernal information is: *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 x86_64 x86_64 x86_64 GNU/Linux* I'll most glad if you can provide me some direction on this. Thanks ! ---------------- [root at smsgateway rxtx-2.0-7pre1]# ./configure checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking target system type... x86_64-unknown-linux-gnu configure: WARNING: Trying libtool. If the following fails install libtool checking for gcc... gcc checking for C compiler default output... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking for ld used by GCC... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for /usr/bin/ld option to reload object files... -r checking for BSD-compatible nm... /usr/bin/nm -B checking for a sed that does not truncate output... /bin/sed checking whether ln -s works... yes checking how to recognise dependent libraries... pass_all checking command to parse /usr/bin/nm -B output... ok checking how to run the C preprocessor... gcc -E checking for egrep... grep -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for ranlib... ranlib checking for strip... strip checking for objdir... .libs checking for gcc option to produce PIC... -fPIC checking if gcc PIC flag -fPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.lo... yes checking if gcc supports -fno-rtti -fno-exceptions... yes checking whether the linker (/usr/bin/ld) supports shared libraries... yes checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking dynamic linker characteristics... GNU/Linux ld.so checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... no checking whether -lc should be explicitly linked in... no creating libtool checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for gawk... gawk checking whether make sets $(MAKE)... yes checking for style of include used by make... GNU checking dependency style of gcc... none checking fcntl.h usability... yes checking fcntl.h presence... yes checking for fcntl.h... yes checking sys/fcntl.h usability... yes checking sys/fcntl.h presence... yes checking for sys/fcntl.h... yes checking sys/file.h usability... yes checking sys/file.h presence... yes checking for sys/file.h... yes checking sys/time.h usability... yes checking sys/time.h presence... yes checking for sys/time.h... yes checking sys/signal.h usability... yes checking sys/signal.h presence... yes checking for sys/signal.h... yes checking signal.h usability... yes checking signal.h presence... yes checking for signal.h.. . yes checking termios.h usability... yes checking termios.h presence... yes checking for termios.h... yes checking asm/termbits.h usability... yes checking asm/termbits.h presence... yes checking for asm/termbits.h... yes checking grp.h usability... yes checking grp.h presence... yes checking for grp.h... yes checking pwd.h usability... yes checking pwd.h presence... yes checking for pwd.h... yes checking whether gcc needs -traditional... no checking whether to enable maintainer-specific portions of Makefiles... no /usr/java/jdk1.5.0_13 configure: WARNING: using JAVA_HOME environmental variable adjusted java.home is /usr/java/jdk1.5.0_13 checking os.name Linux checking os.arch i386 checking java.vendor Sun Microsystems Inc. checking java.version 1.5.0_13 checking os.version 2.6.18-8.el5xen comm.jar appears to be installed already. conftest.c: In function 'main': conftest.c:6: warning: incompatible implicit declaration of built-in function 'printf' conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this function) conftest.c:6: error: (Each undeclared identifier is reported only once conftest.c:6: error: for each function it appears in.) conftest.c:6: error: expected ')' before string constant conftest.c:7: warning: incompatible implicit declaration of built-in function 'exit' ./configure: line 9649: ./conftest: No such file or directory ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected conftest.c: In function 'main': conftest.c:5: warning: incompatible implicit declaration of built-in function 'printf' conftest.c:10: warning: incompatible implicit declaration of built-in function 'exit' configure: creating ./config.status config.status: creating Makefile config.status: creating config.h config.status : config.h is unchanged config.status: executing depfiles commands [root at smsgateway rxtx-2.0-7pre1]# make install /usr/java/jdk1.5.0_13/bin/javac -classpath .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d /home/jboss/sources/rxtx- 2.0-7pre1/ -O /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java /home/jboss/sources/rxtx-2.0-7pre1/./src/UnSupportedLoggerException.java /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o /home/jboss/sources/rxtx-2.0-7pre1/x86_64-unknown-linux-gnu/SerialImp.lo /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'init_threads': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: cast from pointer to integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_nativeDrain': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: cast to pointer from integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'read_byte_array': /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: cast to pointer from integer of different size /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_readArray': /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: comparison is always false due to limited range of data type /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function 'Java_gnu_io_RXTXPort_readTerminatedArray': /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: comparison is always false due to limited range of data type mkdir .libs rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial- 2.0.7pre1.* gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so -o .libs/librxtxSerial-2.0.7pre1.so (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.0.7pre1.so librxtxSerial.so) creating librxtxSerial.la (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la librxtxSerial.la) gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/ParallelImp.lo /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function 'Java_javax_comm_LPRPort_readArray': /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: comparison is always false due to limited range of data type rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* .libs/librxtxParallel-2.0.7pre1.* gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so -o .libs/librxtxParallel- 2.0.7pre1.so (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.0.7pre1.so librxtxParallel.so) creating librxtxParallel.la (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la librxtxParallel.la) make all-am make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' libtool: install: `x86_64-unknown-linux-gnu' must be an absolute directory name Try `libtool --help --mode=install' for more information. make: *** [install] Error 1 ------------- Regards, Tim -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071112/27758c3c/attachment-0024.html From tjarvi at qbang.org Mon Nov 12 01:02:09 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Nov 2007 01:02:09 -0700 (MST) Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> Message-ID: On Mon, 12 Nov 2007, Timothy Low wrote: > > Hi Trent, Hi Tim, Comments are inline. As I mentioned off the list, rxtx 2.0 is on the edge of deprecation. We can get it working but this is not the path of least resistance for future work. You will probably need to bounce another round of questions off the list. The following is intended to isolate the problem. > > I tried building RXTX from source, and I got this error. > > > I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm trying > to get the necessary ".so" files to use for my serial port communication > through java. > My linux kernal information is: > > *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 x86_64 > x86_64 x86_64 GNU/Linux* > > I'll most glad if you can provide me some direction on this. Thanks ! > > ---------------- > [root at smsgateway rxtx-2.0-7pre1]# ./configure > checking build system type... x86_64-unknown-linux-gnu > checking host system type... x86_64-unknown-linux-gnu > checking target system type... x86_64-unknown-linux-gnu > configure: WARNING: Trying libtool. If the following fails install libtool > checking for gcc... gcc > checking for C compiler default output... a.out > checking whether the C compiler works... yes > checking whether we are cross compiling... no > checking for suffix of executables... > checking for suffix of object files... o > checking whether we are using the GNU C compiler... yes > checking whether gcc accepts -g... yes > checking for gcc option to accept ANSI C... none needed > checking for ld used by GCC... /usr/bin/ld > checking if the linker (/usr/bin/ld) is GNU ld... yes > checking for /usr/bin/ld option to reload object files... -r > checking for BSD-compatible nm... /usr/bin/nm -B > checking for a sed that does not truncate output... /bin/sed > checking whether ln -s works... yes > checking how to recognise dependent libraries... pass_all > checking command to parse /usr/bin/nm -B output... ok > checking how to run the C preprocessor... gcc -E > checking for egrep... grep -E > checking for ANSI C header files... yes > checking for sys/types.h... yes > checking for sys/stat.h... yes > checking for stdlib.h... yes > checking for string.h... yes > checking for memory.h... yes > checking for strings.h... yes > checking for inttypes.h... yes > checking for stdint.h... yes > checking for unistd.h... yes > checking dlfcn.h usability... yes > checking dlfcn.h presence... yes > checking for dlfcn.h... yes > checking for ranlib... ranlib > checking for strip... strip > checking for objdir... .libs > checking for gcc option to produce PIC... -fPIC > checking if gcc PIC flag -fPIC works... yes > checking if gcc static flag -static works... yes > checking if gcc supports -c -o file.o... yes > checking if gcc supports -c -o file.lo... yes > checking if gcc supports -fno-rtti -fno-exceptions... yes > checking whether the linker (/usr/bin/ld) supports shared libraries... yes > checking how to hardcode library paths into programs... immediate > checking whether stripping libraries is possible... yes > checking dynamic linker characteristics... GNU/Linux ld.so > checking if libtool supports shared libraries... yes > checking whether to build shared libraries... yes > checking whether to build static libraries... no > checking whether -lc should be explicitly linked in... no > creating libtool > checking for a BSD-compatible install... /usr/bin/install -c > checking whether build environment is sane... yes > checking for gawk... gawk > checking whether make sets $(MAKE)... yes > checking for style of include used by make... GNU > checking dependency style of gcc... none > checking fcntl.h usability... yes > checking fcntl.h presence... yes > checking for fcntl.h... yes > checking sys/fcntl.h usability... yes > checking sys/fcntl.h presence... yes > checking for sys/fcntl.h... yes > checking sys/file.h usability... yes > checking sys/file.h presence... yes > checking for sys/file.h... yes > checking sys/time.h usability... yes > checking sys/time.h presence... yes > checking for sys/time.h... yes > checking sys/signal.h usability... yes > checking sys/signal.h presence... yes > checking for sys/signal.h... yes > checking signal.h usability... yes > checking signal.h presence... yes > checking for signal.h.. . yes > checking termios.h usability... yes > checking termios.h presence... yes > checking for termios.h... yes > checking asm/termbits.h usability... yes > checking asm/termbits.h presence... yes > checking for asm/termbits.h... yes > checking grp.h usability... yes > checking grp.h presence... yes > checking for grp.h... yes > checking pwd.h usability... yes > checking pwd.h presence... yes > checking for pwd.h... yes > checking whether gcc needs -traditional... no > checking whether to enable maintainer-specific portions of Makefiles... no > /usr/java/jdk1.5.0_13 > configure: WARNING: using JAVA_HOME environmental variable > adjusted java.home is /usr/java/jdk1.5.0_13 > checking os.name Linux > checking os.arch i386 > checking java.vendor Sun Microsystems Inc. > checking java.version 1.5.0_13 > checking os.version 2.6.18-8.el5xen > comm.jar appears to be installed already. > conftest.c: In function 'main': > conftest.c:6: warning: incompatible implicit declaration of built-in > function 'printf' > conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this function) > conftest.c:6: error: (Each undeclared identifier is reported only once > conftest.c:6: error: for each function it appears in.) > conftest.c:6: error: expected ')' before string constant This is an outdated kernel version check for when headers and kernels could cause problems for rxtx. If we made it past this, then you are OK. > conftest.c:7: warning: incompatible implicit declaration of built-in > function 'exit' > ./configure: line 9649: ./conftest: No such file or directory > ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected It blew up but continues.. > conftest.c: In function 'main': > conftest.c:5: warning: incompatible implicit declaration of built-in > function 'printf' > conftest.c:10: warning: incompatible implicit declaration of built-in > function 'exit' > configure: creating ./config.status > config.status: creating Makefile > config.status: creating config.h > config.status : config.h is unchanged > config.status: executing depfiles commands > [root at smsgateway rxtx-2.0-7pre1]# make install > /usr/java/jdk1.5.0_13/bin/javac -classpath > .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d > /home/jboss/sources/rxtx- 2.0-7pre1/ -O > /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java > /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/UnSupportedLoggerException.java > /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java > Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or > overrides a deprecated API. > Note: Recompile with -Xlint:deprecation for details. > /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* The java jar should be fine now. You may need to change the source files as mentioned below. > gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. > -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g > -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o > /home/jboss/sources/rxtx-2.0-7pre1/x86_64-unknown-linux-gnu/SerialImp.lo > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'init_threads': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: cast > from pointer to integer of different size > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_nativeDrain': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: cast to > pointer from integer of different size > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'read_byte_array': > /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: cast to > pointer from integer of different size As I recall, this was caused by pointers (now 64 bit rather than 32 bit) being stored in java ints (jints). I would look at the diff between the CVS 2.1 SerialImp.c and RXTXPort.java files against 2.0. We did fix those issues. You have a .so file but the different pointer sizes will cause runtime errors. > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_readArray': > /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: > comparison is always false due to limited range of data type > /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function > 'Java_gnu_io_RXTXPort_readTerminatedArray': > /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: > comparison is always false due to limited range of data type > mkdir .libs > rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* .libs/librxtxSerial- > 2.0.7pre1.* > gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so -o > .libs/librxtxSerial-2.0.7pre1.so > (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.0.7pre1.so > librxtxSerial.so) > creating librxtxSerial.la > (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la > librxtxSerial.la) > gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu -I. > -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ -g > -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o > /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/ParallelImp.lo > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function > 'Java_javax_comm_LPRPort_readArray': > /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: > comparison is always false due to limited range of data type > rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* > .libs/librxtxParallel-2.0.7pre1.* > gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so -o > .libs/librxtxParallel- 2.0.7pre1.so > (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.0.7pre1.so > librxtxParallel.so) > creating librxtxParallel.la > (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la > librxtxParallel.la) > make all-am > make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' > make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' > libtool: install: `x86_64-unknown-linux-gnu' must be an absolute directory > name > Try `libtool --help --mode=install' for more information. > make: *** [install] Error 1 A libtool change? Assuming you ran configure && make install in /home/jboss/sources/rxtx- 2.0-7pre1, libtool is looking for /home/jboss/sources/rxtx- 2.0-7pre1/x86_64-unknown-linux-gnu/.libs/librxtxSerial-2.0.7pre1.so. I think you have this? The file is just being copied to ~JAVA/jre/lib/$(JAVA_ARCH). -- Trent Jarvi tjarvi at qbang.org From sarah_662005 at yahoo.com Mon Nov 12 16:10:28 2007 From: sarah_662005 at yahoo.com (Sara Hugh) Date: Mon, 12 Nov 2007 15:10:28 -0800 (PST) Subject: [Rxtx] [urgent] device's power off detection Message-ID: <766782.10076.qm@web55803.mail.re3.yahoo.com> Hello all, I have a small application built on top of rxtx api. This application can retrieve the incoming data from a device through a port. The device can be powered off after the port get closed from the application. I have been trying a couple of hours to find a way to detect the power switching from device. If anyone knows how to handle it through rxtx, could you please give me a help? Thank you very much. r, Sara ____________________________________________________________________________________ Get easy, one-click access to your favorites. Make Yahoo! your homepage. http://www.yahoo.com/r/hs -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071112/4599f3ec/attachment-0023.html From netbeans at gatworks.com Mon Nov 12 17:52:22 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 12 Nov 2007 19:52:22 -0500 Subject: [Rxtx] [urgent] device's power off detection In-Reply-To: <766782.10076.qm@web55803.mail.re3.yahoo.com> References: <766782.10076.qm@web55803.mail.re3.yahoo.com> Message-ID: <4738F546.5010101@gatworks.com> Not sure what u are asking for. Are u asking for a way to detect if the device is OFF? Are u asking how to power off the device - via software ? Is it a Serial device? is it a parallel device? is it a usb device? Sara Hugh wrote: > Hello all, > I have a small application built on top of rxtx api. This application > can retrieve the incoming data from a device through a port. The device > can be powered off after the port get closed from the application. I > have been trying a couple of hours to find a way to detect the power > switching from device. If anyone knows how to handle it through rxtx, > could you please give me a help? Thank you very much. From tjarvi at qbang.org Mon Nov 12 22:48:11 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 12 Nov 2007 22:48:11 -0700 (MST) Subject: [Rxtx] Fwd: Building RXTX From Source In-Reply-To: <900c6ba90711120225x562db8cbxb750767ade3b0d73@mail.gmail.com> References: <900c6ba90711112302s78914c5en873a581139ef69d6@mail.gmail.com> <900c6ba90711112331u13320b2x9d80ea3a6d6d84d4@mail.gmail.com> <900c6ba90711120031p66edc001ted76f7ba24e34b98@mail.gmail.com> <900c6ba90711120225x562db8cbxb750767ade3b0d73@mail.gmail.com> Message-ID: Hi Tim, The gnu.io namespace looks just like the javax.comm 2.0 namespace. There are additional (discouraged) undocumented methods in gnu.io that you need not use. We just used the different namespace to avoid poluting Sun's by mistake and to make sure we stayed off any potential licensing related radar. Usuaully, you just change your imports and make sure you do not use the javax.comm namespace for anything like exception handling. As I mentioned off the list, there are no issues with rxtx going through the JSR process to be more Sun friendly other than time. rxtx has no hidden intentions there; anything that does not work like CommAPI 2.0 documented is a bug. The reason we do not support CommAPI 2.1 is technical in nature and is in the list archives as well as the front page of www.rxtx.org. On Mon, 12 Nov 2007, Timothy Low wrote: > Hi Trent, > > I'll move to use a JDK1.5 64-bit version... but do I need to make any source > code changes to use the package (gnu.io) in the RTXTcomm.jar instead of the > ones from the javacomm api ? > > > Regards, > Tim > > On Nov 12, 2007 5:22 PM, Trent Jarvi wrote: > >> >> Hi Tim, >> >> I see a couple things here. >> >> First your jdk is for i686 yet the library is compiled on a x86_64 >> machine. You may try passing configure the --target=i686-unknown-linux to >> try using the i686 backend to gcc if it is available. Or move to the 64 >> bit jdk. >> >> The other error I see is again the moved UTF_RELEASE define that we need >> to fix. You can probably get around that with: >> >> make -DUTF_RELEASE=`uname -r` >> >> even more simple would be to just specify the serial library which should >> be in configure --help. >> >> You can remove the UTF_RELEASE check from configure by editing >> configure.in, searching for the simple C program check and deleting it. >> Running autoconf after that will regenerate a new configure without the >> check. >> >> Note that you should remove the previous native libraries >> (librxtxSerial.so) when moving from rxtx 2.0 to 2.1. These are compiled >> for different namespaces (javax.comm/gnu.io). >> >> On Mon, 12 Nov 2007, Timothy Low wrote: >> >>> *Hi Trent, >>> >>> I moved on to rxtx 2.1.7r2, and updated my jre to 1.6.0 (64-bit)... I >> tried >>> the following 2 methods: >>> >>> (1) using the rxtx 2.1.7 binaries from the RXTX website* >>> *Are these binaries suitable for a 64-bit OS ? There mentioning of the >>> gnu.io that you've talked about previously...* >>> ------ >>> [root at smsgateway sources]# java -Djava.library.path=/usr/lib PortLister >>> Experimental: JNI_OnLoad called. >>> >>> java.lang.UnsatisfiedLinkError: gnu.io.RXTXCommDriver.nativeGetVersion >>> ()Ljava/lang/String; >>> at gnu.io.RXTXCommDriver.nativeGetVersion(Native Method) >>> at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:85) >>> at java.lang.Class.forName0(Native Method) >>> at java.lang.Class.forName(Unknown Source) >>> at javax.comm.CommPortIdentifier.loadDriver( >> CommPortIdentifier.java >>> :237) >>> at javax.comm.CommPortIdentifier.(CommPortIdentifier.java >>> :109) >>> at PortLister.(PortLister.java:6) >>> at PortLister.main(PortLister.java:25) >>> Exception in thread "main" java.lang.UnsatisfiedLinkError: >>> com.sun.comm.SunrayInfo.isSessionActive()Z >>> at com.sun.comm.SunrayInfo.isSessionActive(Native Method) >>> at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java >> :155) >>> at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java >>> :100) >>> at javax.comm.CommPortIdentifier.(CommPortIdentifier.java >>> :138) >>> at PortLister.(PortLister.java:6) >>> at PortLister.main(PortLister.java:25) >>> >>> ------ >>> >>> (2) compiling the rxtx 2.1.7 from source >>> *but i got the following error while running ./configure and make all* >>> >>> ------ >>> [root at smsgateway rxtx-2.1-7r2]# ./configure >>> checking build system type... x86_64-unknown-linux-gnu >>> checking host system type... x86_64-unknown-linux-gnu >>> checking target system type... x86_64-unknown-linux-gnu >>> configure: WARNING: Trying libtool. If the following fails install >> libtool >>> checking for gcc... gcc >>> checking for C compiler default output file name... a.out >>> checking whether the C compiler works... yes >>> checking whether we are cross compiling... no >>> checking for suffix of executables... >>> checking for suffix of object files... o >>> checking whether we are using the GNU C compiler... yes >>> checking whether gcc accepts -g... yes >>> checking for gcc option to accept ANSI C... none needed >>> checking for a sed that does not truncate output... /bin/sed >>> checking for egrep... grep -E >>> checking for ld used by gcc... /usr/bin/ld >>> checking if the linker (/usr/bin/ld) is GNU ld... yes >>> checking for /usr/bin/ld option to reload object files... -r >>> checking for BSD-compatible nm... /usr/bin/nm -B >>> checking whether ln -s works... yes >>> checking how to recognise dependent libraries... pass_all >>> checking how to run the C preprocessor... gcc -E >>> checking for ANSI C header files... yes >>> checking for sys/types.h... yes >>> checking for sys/stat.h... yes >>> checking for stdlib.h... yes >>> checking for string.h... yes >>> checking for memory.h... yes >>> checking for strings.h... yes >>> checking for inttypes.h... yes >>> checking for stdint.h... yes >>> checking for unistd.h... yes >>> checking dlfcn.h usability... yes >>> checking dlfcn.h presence... yes >>> checking for dlfcn.h... yes >>> checking for g++... g++ >>> checking whether we are using the GNU C++ compiler... yes >>> checking whether g++ accepts -g... yes >>> checking how to run the C++ preprocessor... g++ -E >>> checking for g77... no >>> checking for f77... no >>> checking for xlf... no >>> checking for frt... no >>> checking for pgf77... no >>> checking for fort77... no >>> checking for fl32... no >>> checking for af77... no >>> checking for f90... no >>> checking for xlf90... no >>> checking for pgf90... no >>> checking for epcf90... no >>> checking for f95... f95 >>> checking whether we are using the GNU Fortran 77 compiler... yes >>> checking whether f95 accepts -g... yes >>> checking the maximum length of command line arguments... 32768 >>> checking command to parse /usr/bin/nm -B output from gcc object... ok >>> checking for objdir... .libs >>> checking for ar... ar >>> checking for ranlib... ranlib >>> checking for strip... strip >>> checking if gcc static flag works... yes >>> checking if gcc supports -fno-rtti -fno-exceptions... no >>> checking for gcc option to produce PIC... -fPIC >>> checking if gcc PIC flag -fPIC works... yes >>> checking if gcc supports -c -o file.o... yes >>> checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking whether -lc should be explicitly linked in... no >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> checking if libtool supports shared libraries... yes >>> checking whether to build shared libraries... yes >>> checking whether to build static libraries... no >>> configure: creating libtool >>> appending configuration tag "CXX" to libtool >>> checking for ld used by g++... /usr/bin/ld -m elf_x86_64 >>> checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes >>> checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking for g++ option to produce PIC... -fPIC >>> checking if g++ PIC flag -fPIC works... yes >>> checking if g++ supports -c -o file.o... yes >>> checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> appending configuration tag "F77" to libtool >>> checking if libtool supports shared libraries... yes >>> checking whether to build shared libraries... yes >>> checking whether to build static libraries... no >>> checking for f95 option to produce PIC... -fPIC >>> checking if f95 PIC flag -fPIC works... yes >>> checking if f95 supports -c -o file.o... yes >>> checking whether the f95 linker (/usr/bin/ld -m elf_x86_64) supports >> shared >>> libraries... yes >>> checking dynamic linker characteristics... GNU/Linux ld.so >>> checking how to hardcode library paths into programs... immediate >>> checking whether stripping libraries is possible... yes >>> checking for a BSD-compatible install... /usr/bin/install -c >>> checking whether build environment is sane... yes >>> checking for gawk... gawk >>> checking whether make sets $(MAKE)... yes >>> checking for style of include used by make... GNU >>> checking dependency style of gcc... none >>> checking dependency style of g++... none >>> checking fcntl.h usability... yes >>> checking fcntl.h presence... yes >>> checking for fcntl.h... yes >>> checking sys/fcntl.h usability... yes >>> checking sys/fcntl.h presence... yes >>> checking for sys/fcntl.h... yes >>> checking sys/file.h usability... yes >>> checking sys/file.h presence... yes >>> checking for sys/file.h... yes >>> checking sys/time.h usability... yes >>> checking sys/time.h presence... yes >>> checking for sys/time.h... yes >>> checking sys/signal.h usability... yes >>> checking sys/signal.h presence... yes >>> checking for sys/signal.h... yes >>> checking signal.h usability... yes >>> checking signal.h presence... yes >>> checking for signal.h... yes >>> checking termios.h usability... yes >>> checking termios.h presence... yes >>> checking for termios.h... yes >>> checking grp.h usability... yes >>> checking grp.h presence... yes >>> checking for grp.h... yes >>> checking pwd.h usability... yes >>> checking pwd.h presence... yes >>> checking for pwd.h... yes >>> checking whether gcc needs -traditional... no >>> checking whether to enable maintainer-specific portions of Makefiles... >> no >>> /usr/java/jdk1.5.0_13 >>> configure: WARNING: using JAVA_HOME environmental variable >>> adjusted java.home is /usr/java/jdk1.5.0_13 >>> checking os.name Linux >>> checking os.arch i386 >>> checking java.vendor Sun Microsystems Inc. >>> checking java.version 1.5.0_13 >>> checking os.version 2.6.18-8.el5xen >>> conftest.c: In function 'main': >>> conftest.c:8: error: 'UTS_RELEASE' undeclared (first use in this >> function) >>> conftest.c:8: error: (Each undeclared identifier is reported only once >>> conftest.c:8: error: for each function it appears in.) >>> conftest.c:8: error: expected ')' before string constant >>> ./configure: line 21462: ./conftest: No such file or directory >>> ./configure: line 21462: test: 2.6.18-8.el5xen: unary operator expected >>> configure: creating ./config.status >>> config.status: creating Makefile >>> config.status: creating config.h >>> config.status: executing depfiles commands >>> [root at smsgateway rxtx-2.1-7r2]# make install >>> /usr/java/jdk1.5.0_13/bin/javac -classpath .:/home/jboss/sources/rxtx- >>> >> 2.1-7r2:/home/jboss/sources/rxtx-2.1-7r2/src:/usr/java/jdk1.5.0_13/jre/lib/ext/RXTXcomm.jar-d >>> /home/jboss/sources/rxtx- >>> 2.1-7r2/ -O -source 1.3 -target 1.3 >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommDriver.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortEnumerator.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortIdentifier.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/CommPortOwnershipListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Configure.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2C.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/I2CPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/LPRPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/NoSuchPortException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/PortInUseException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Raw.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/RawPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RawPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RawPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485.java >> /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/RS485PortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485PortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RS485Port.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXCommDriver.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXPort.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/RXTXVersion.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPortEvent.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPortEventListener.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialPort.java >>> /home/jboss/sources/rxtx-2.1-7r2 >> /./src/UnsupportedCommOperationException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/UnSupportedLoggerException.java >>> /home/jboss/sources/rxtx-2.1-7r2/./src/Zystem.java >>> /usr/java/jdk1.5.0_13/bin/javah -classpath .:/home/jboss/sources/rxtx- >>> >> 2.1-7r2:/home/jboss/sources/rxtx-2.1-7r2/src:/usr/java/jdk1.5.0_13/jre/lib/ext/RXTXcomm.jar-d >>> x86_64-unknown-linux-gnu -jni `(for i in CommDriver CommPortEnumerator >>> CommPortIdentifier CommPort CommPortOwnershipListener Configure I2C >>> I2CPortEvent I2CPortEventListener I2CPort LPRPort NoSuchPortException >>> ParallelPortEvent ParallelPortEventListener ParallelPort >> PortInUseException >>> Raw RawPortEvent RawPortEventListener RawPort RS485 RS485PortEvent >>> RS485PortEventListener RS485Port RXTXCommDriver RXTXPort RXTXVersion >>> SerialPortEvent SerialPortEventListener SerialPort >>> UnsupportedCommOperationException UnSupportedLoggerException Zystem;do \ >>> if grep > /dev/null native.*\( /home/jboss/sources/rxtx- >>> 2.1-7r2/./src/$i.java; then \ >>> echo gnu.io.$i; \ >>> fi; \ >>> done)` >>> /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialImp.c -o >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo; >>> \ >>> if [ "Serial" = "Serial" ]; >>> then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxSerial.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxSerial.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/SerialImp.lo; >> \ >>> fi; \ >>> ) >>> mkdir /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/.libs >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/SerialImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/SerialImp.o >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/fuserImp.o >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c: In function >> 'show_user': >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c:238: warning: cast >> from >>> pointer to integer of different size >>> gcc -shared /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/SerialImp.o >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/fuserImp.o >>> -lpthread -Wl,-soname -Wl,librxtxSerial-2.1-7.so -o >> .libs/librxtxSerial- >>> 2.1-7.so >>> (cd .libs && rm -f librxtxSerial.so && ln -s librxtxSerial-2.1-7.so >>> librxtxSerial.so) >>> creating librxtxSerial.la >>> (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la >>> librxtxSerial.la) >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelImp.c -o >> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/ParallelImp.lo; >>> \ >>> if [ "Parallel" = "Serial" ]; >>> then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxParallel.la -rpath >>> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/ParallelImp.lo >>> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxParallel.la -rpath >>> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/ParallelImp.lo; >>> \ >>> fi; \ >>> ) >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/ParallelImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2 >>> /x86_64-unknown-linux-gnu/.libs/ParallelImp.o >>> gcc -shared /home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/.libs/ParallelImp.o >>> -lpthread -Wl,-soname -Wl,librxtxParallel-2.1-7.so -o >>> .libs/librxtxParallel-2.1-7.so >>> (cd .libs && rm -f librxtxParallel.so && ln -s librxtxParallel-2.1-7.so >>> librxtxParallel.so) >>> creating librxtxParallel.la >>> (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la >>> librxtxParallel.la) >>> ( \ >>> \ >>> cd >>> x86_64-unknown-linux-gnu; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool --mode=compile >> gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo; >>> \ >>> if [ "I2C" = "Serial" ]; then \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >>> --mode=compile gcc >>> -I/home/jboss/sources/rxtx-2.1-7r2-Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include >>> -I/usr/java/jdk1.5.0_13/include/./linux/ -g -O2 -D_POSIX_SOURCE >>> -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/fuserImp.c >>> -o \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxI2C.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo >>> \ >>> >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/fuserImp.lo; >>> \ >>> else \ >>> /bin/sh /home/jboss/sources/rxtx-2.1-7r2/libtool >> --mode=link >>> gcc -g -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -lpthread >>> -release 2.1-7 -o librxtxI2C.la -rpath >> /usr/java/jdk1.5.0_13/jre/lib/i386 >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/I2CImp.lo; >>> \ >>> fi; \ >>> ) >>> gcc -I/home/jboss/sources/rxtx-2.1-7r2 -Ix86_64-unknown-linux-gnu -I. >>> -I/usr/java/jdk1.5.0_13/include -I/usr/java/jdk1.5.0_13/include/./linux/ >> -g >>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c -fPIC -DPIC -o >>> /home/jboss/sources/rxtx-2.1-7r2/x86_64-unknown-linux-gnu/.libs/I2CImp.o >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c: In function >>> 'Java_gnu_io_I2CPort_Initialize': >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: 'UTS_RELEASE' >>> undeclared (first use in this function) >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: (Each >> undeclared >>> identifier is reported only once >>> /home/jboss/sources/rxtx-2.1-7r2/./src/I2CImp.c:96: error: for each >> function >>> it appears in.) >>> libtool: link: `/home/jboss/sources/rxtx-2.1-7r2 >> /x86_64-unknown-linux-gnu/I2CImp.lo' >>> is not a valid libtool object >>> make: *** [x86_64-unknown-linux-gnu/librxtxI2C.la] Error 1 >>> >>> ------ >>> >>> >>> >>> On Nov 12, 2007 4:02 PM, Trent Jarvi wrote: >>> >>>> On Mon, 12 Nov 2007, Timothy Low wrote: >>>>> >>>>> Hi Trent, >>>> >>>> Hi Tim, >>>> >>>> Comments are inline. As I mentioned off the list, rxtx 2.0 is on the >> edge >>>> of deprecation. We can get it working but this is not the path of >> least >>>> resistance for future work. >>>> >>>> You will probably need to bounce another round of questions off the >> list. >>>> The following is intended to isolate the problem. >>>> >>>>> >>>>> I tried building RXTX from source, and I got this error. >>>>> >>>>> >>>>> I'm running JDK1.5.0_13, Red Hat Enterprice Linux 5 (64-bit)... I'm >>>> trying >>>>> to get the necessary ".so" files to use for my serial port >> communication >>>>> through java. >>>>> My linux kernal information is: >>>>> >>>>> *Linux smsgateway 2.6.18-8.el5xen #1 SMP Fri Jan 26 14:29:35 EST 2007 >>>> x86_64 >>>>> x86_64 x86_64 GNU/Linux* >>>>> >>>>> I'll most glad if you can provide me some direction on this. Thanks ! >>>>> >>>>> ---------------- >>>>> [root at smsgateway rxtx-2.0-7pre1]# ./configure >>>>> checking build system type... x86_64-unknown-linux-gnu >>>>> checking host system type... x86_64-unknown-linux-gnu >>>>> checking target system type... x86_64-unknown-linux-gnu >>>>> configure: WARNING: Trying libtool. If the following fails install >>>> libtool >>>>> checking for gcc... gcc >>>>> checking for C compiler default output... a.out >>>>> checking whether the C compiler works... yes >>>>> checking whether we are cross compiling... no >>>>> checking for suffix of executables... >>>>> checking for suffix of object files... o >>>>> checking whether we are using the GNU C compiler... yes >>>>> checking whether gcc accepts -g... yes >>>>> checking for gcc option to accept ANSI C... none needed >>>>> checking for ld used by GCC... /usr/bin/ld >>>>> checking if the linker (/usr/bin/ld) is GNU ld... yes >>>>> checking for /usr/bin/ld option to reload object files... -r >>>>> checking for BSD-compatible nm... /usr/bin/nm -B >>>>> checking for a sed that does not truncate output... /bin/sed >>>>> checking whether ln -s works... yes >>>>> checking how to recognise dependent libraries... pass_all >>>>> checking command to parse /usr/bin/nm -B output... ok >>>>> checking how to run the C preprocessor... gcc -E >>>>> checking for egrep... grep -E >>>>> checking for ANSI C header files... yes >>>>> checking for sys/types.h... yes >>>>> checking for sys/stat.h... yes >>>>> checking for stdlib.h... yes >>>>> checking for string.h... yes >>>>> checking for memory.h... yes >>>>> checking for strings.h... yes >>>>> checking for inttypes.h... yes >>>>> checking for stdint.h... yes >>>>> checking for unistd.h... yes >>>>> checking dlfcn.h usability... yes >>>>> checking dlfcn.h presence... yes >>>>> checking for dlfcn.h... yes >>>>> checking for ranlib... ranlib >>>>> checking for strip... strip >>>>> checking for objdir... .libs >>>>> checking for gcc option to produce PIC... -fPIC >>>>> checking if gcc PIC flag -fPIC works... yes >>>>> checking if gcc static flag -static works... yes >>>>> checking if gcc supports -c -o file.o... yes >>>>> checking if gcc supports -c -o file.lo... yes >>>>> checking if gcc supports -fno-rtti -fno-exceptions... yes >>>>> checking whether the linker (/usr/bin/ld) supports shared libraries... >>>> yes >>>>> checking how to hardcode library paths into programs... immediate >>>>> checking whether stripping libraries is possible... yes >>>>> checking dynamic linker characteristics... GNU/Linux ld.so >>>>> checking if libtool supports shared libraries... yes >>>>> checking whether to build shared libraries... yes >>>>> checking whether to build static libraries... no >>>>> checking whether -lc should be explicitly linked in... no >>>>> creating libtool >>>>> checking for a BSD-compatible install... /usr/bin/install -c >>>>> checking whether build environment is sane... yes >>>>> checking for gawk... gawk >>>>> checking whether make sets $(MAKE)... yes >>>>> checking for style of include used by make... GNU >>>>> checking dependency style of gcc... none >>>>> checking fcntl.h usability... yes >>>>> checking fcntl.h presence... yes >>>>> checking for fcntl.h... yes >>>>> checking sys/fcntl.h usability... yes >>>>> checking sys/fcntl.h presence... yes >>>>> checking for sys/fcntl.h... yes >>>>> checking sys/file.h usability... yes >>>>> checking sys/file.h presence... yes >>>>> checking for sys/file.h... yes >>>>> checking sys/time.h usability... yes >>>>> checking sys/time.h presence... yes >>>>> checking for sys/time.h... yes >>>>> checking sys/signal.h usability... yes >>>>> checking sys/signal.h presence... yes >>>>> checking for sys/signal.h... yes >>>>> checking signal.h usability... yes >>>>> checking signal.h presence... yes >>>>> checking for signal.h.. . yes >>>>> checking termios.h usability... yes >>>>> checking termios.h presence... yes >>>>> checking for termios.h... yes >>>>> checking asm/termbits.h usability... yes >>>>> checking asm/termbits.h presence... yes >>>>> checking for asm/termbits.h... yes >>>>> checking grp.h usability... yes >>>>> checking grp.h presence... yes >>>>> checking for grp.h... yes >>>>> checking pwd.h usability... yes >>>>> checking pwd.h presence... yes >>>>> checking for pwd.h... yes >>>>> checking whether gcc needs -traditional... no >>>>> checking whether to enable maintainer-specific portions of >> Makefiles... >>>> no >>>>> /usr/java/jdk1.5.0_13 >>>>> configure: WARNING: using JAVA_HOME environmental variable >>>>> adjusted java.home is /usr/java/jdk1.5.0_13 >>>>> checking os.name Linux >>>>> checking os.arch i386 >>>>> checking java.vendor Sun Microsystems Inc. >>>>> checking java.version 1.5.0_13 >>>>> checking os.version 2.6.18-8.el5xen >>>>> comm.jar appears to be installed already. >>>>> conftest.c: In function 'main': >>>>> conftest.c:6: warning: incompatible implicit declaration of built-in >>>>> function 'printf' >>>>> conftest.c:6: error: 'UTS_RELEASE' undeclared (first use in this >>>> function) >>>>> conftest.c:6: error: (Each undeclared identifier is reported only once >>>>> conftest.c:6: error: for each function it appears in.) >>>>> conftest.c:6: error: expected ')' before string constant >>>> >>>> >>>> This is an outdated kernel version check for when headers and kernels >>>> could cause problems for rxtx. If we made it past this, then you are >> OK. >>>> >>>> >>>>> conftest.c:7: warning: incompatible implicit declaration of built-in >>>>> function 'exit' >>>>> ./configure: line 9649: ./conftest: No such file or directory >>>>> ./configure: line 9649: test: 2.6.18-8.el5xen: unary operator expected >>>> >>>> It blew up but continues.. >>>> >>>>> conftest.c: In function 'main': >>>>> conftest.c:5: warning: incompatible implicit declaration of built-in >>>>> function 'printf' >>>>> conftest.c:10: warning: incompatible implicit declaration of built-in >>>>> function 'exit' >>>>> configure: creating ./config.status >>>>> config.status: creating Makefile >>>>> config.status: creating config.h >>>>> config.status : config.h is unchanged >>>>> config.status: executing depfiles commands >>>>> [root at smsgateway rxtx-2.0-7pre1]# make install >>>>> /usr/java/jdk1.5.0_13/bin/javac -classpath >>>>> .::/usr/java/jdk1.5.0_13/jre/lib/:/usr/java/jdk1.5.0_13/jre/lib/ext -d >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/ -O >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/LPRPort.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXCommDriver.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/RXTXPort.java >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/RXTXVersion.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1 >> /./src/UnSupportedLoggerException.java >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/Zystem.java >>>>> Note: /home/jboss/sources/rxtx-2.0-7pre1/./src/Configure.java uses or >>>>> overrides a deprecated API. >>>>> Note: Recompile with -Xlint:deprecation for details. >>>>> /usr/java/jdk1.5.0_13/bin/jar cf RXTXcomm.jar gnu/* >>>> >>>> >>>> The java jar should be fine now. You may need to change the source >> files >>>> as mentioned below. >>>> >>>>> gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu >> -I. >>>>> -I/usr/java/jdk1.5.0_13/include >> -I/usr/java/jdk1.5.0_13/include/./linux/ >>>> -g >>>>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c -fPIC -DPIC -o >>>>> /home/jboss/sources/rxtx-2.0-7pre1 >> /x86_64-unknown-linux-gnu/SerialImp.lo >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'init_threads': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1241: warning: >>>> cast >>>>> from pointer to integer of different size >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_nativeDrain': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:1434: warning: >>>> cast to >>>>> pointer from integer of different size >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'read_byte_array': >>>>> /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:2818: warning: >>>> cast to >>>>> pointer from integer of different size >>>> >>>> >>>> As I recall, this was caused by pointers (now 64 bit rather than 32 >> bit) >>>> being stored in java ints (jints). I would look at the diff between >> the >>>> CVS 2.1 SerialImp.c and RXTXPort.java files against 2.0. We >>>> did fix those issues. >>>> >>>> You have a .so file but the different pointer sizes will cause runtime >>>> errors. >>>> >>>> >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_readArray': >>>>> /home/jboss/sources/rxtx-2.0-7pre1 /./src/SerialImp.c:3269: warning: >>>>> comparison is always false due to limited range of data type >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/SerialImp.c: In function >>>>> 'Java_gnu_io_RXTXPort_readTerminatedArray': >>>>> /home/jboss/sources/rxtx- 2.0-7pre1/./src/SerialImp.c:3325: warning: >>>>> comparison is always false due to limited range of data type >>>>> mkdir .libs >>>>> rm -fr .libs/librxtxSerial.la .libs/librxtxSerial.* >> .libs/librxtxSerial- >>>>> 2.0.7pre1.* >>>>> gcc -shared -lpthread -Wl,-soname -Wl, librxtxSerial-2.0.7pre1.so-o >>>>> .libs/librxtxSerial-2.0.7pre1.so >>>>> (cd .libs && rm -f librxtxSerial.so && ln -s >> librxtxSerial-2.0.7pre1.so >>>>> librxtxSerial.so) >>>>> creating librxtxSerial.la >>>>> (cd .libs && rm -f librxtxSerial.la && ln -s ../librxtxSerial.la >>>>> librxtxSerial.la) >>>>> gcc -I/home/jboss/sources/rxtx-2.0-7pre1 -Ix86_64-unknown-linux-gnu >> -I. >>>>> -I/usr/java/jdk1.5.0_13/include >> -I/usr/java/jdk1.5.0_13/include/./linux/ >>>> -g >>>>> -O2 -D_POSIX_SOURCE -D_BSD_SOURCE -D__need_timespec -c >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c -fPIC -DPIC -o >>>>> /home/jboss/sources/rxtx- 2.0-7pre1 >>>> /x86_64-unknown-linux-gnu/ParallelImp.lo >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c: In function >>>>> 'Java_javax_comm_LPRPort_readArray': >>>>> /home/jboss/sources/rxtx-2.0-7pre1/./src/ParallelImp.c:606: warning: >>>>> comparison is always false due to limited range of data type >>>>> rm -fr .libs/librxtxParallel.la .libs/librxtxParallel.* >>>>> .libs/librxtxParallel-2.0.7pre1.* >>>>> gcc -shared -lpthread -Wl,-soname -Wl,librxtxParallel-2.0.7pre1.so-o >>>>> .libs/librxtxParallel- 2.0.7pre1.so >>>>> (cd .libs && rm -f librxtxParallel.so && ln -s >>>> librxtxParallel-2.0.7pre1.so >>>>> librxtxParallel.so) >>>>> creating librxtxParallel.la >>>>> (cd .libs && rm -f librxtxParallel.la && ln -s ../librxtxParallel.la >>>>> librxtxParallel.la) >>>>> make all-am >>>>> make[1]: Entering directory `/home/jboss/sources/rxtx-2.0-7pre1' >>>>> make[1]: Leaving directory `/home/jboss/sources/rxtx- 2.0-7pre1' >>>>> libtool: install: `x86_64-unknown-linux-gnu' must be an absolute >>>> directory >>>>> name >>>>> Try `libtool --help --mode=install' for more information. >>>>> make: *** [install] Error 1 >>>> >>>> A libtool change? Assuming you ran configure && make install in >>>> /home/jboss/sources/rxtx- 2.0-7pre1, libtool is looking for >>>> /home/jboss/sources/rxtx- >>>> 2.0-7pre1/x86_64-unknown-linux-gnu/.libs/librxtxSerial-2.0.7pre1.so. >>>> >>>> I think you have this? The file is just being copied to >>>> ~JAVA/jre/lib/$(JAVA_ARCH). >>>> >>>> -- >>>> Trent Jarvi >>>> tjarvi at qbang.org >>>> >>> >> > From guido.vogt at celsi.ch Tue Nov 13 00:28:01 2007 From: guido.vogt at celsi.ch (Guido Vogt) Date: Tue, 13 Nov 2007 08:28:01 +0100 Subject: [Rxtx] RTS Line can't be set Message-ID: <47395201.1050400@celsi.ch> I'm working on an Windows XP /SP2 System. Version of RXTX: 2.1.7. The serial line is connected to a modem. As I can see, the RTS-Line of the serial Port is inactive, when the port is opened (flowcontrol=none). Obviously, no data is coming from the modem. If I use the setRTS(true) command after open, the comport does not send out my data any more. This behaviour is regardless of flowcontrol. Anybody has an idea what do do? Thanks for help. From Martin.Oberhuber at windriver.com Tue Nov 13 08:58:23 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 13 Nov 2007 16:58:23 +0100 Subject: [Rxtx] Quality Engineering with rxtx In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803880918@ism-mail03.corp.ad.wrs.com> Hi Trent, as said before, I like the idea of discussing such quality engineering issues, but why hide these away from the rest of the public? Anyways, if you do want to create a new mailing list for these kinds of things I'll happily subscribe. 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: Sunday, November 11, 2007 1:46 AM > To: Oberhuber, Martin > Cc: Trent Jarvi; rxtx at qbang.org > Subject: RE: [Rxtx] Quality Engineering with rxtx > > On Mon, 5 Nov 2007, Oberhuber, Martin wrote: > > > Hi Trent, > > > > are the interestes of hobbyists really so different > > from commercial ones? Both should be interested in > > high quality and innovation the like. > > > > I haven't seen too many Open Source projects from the > > "inside" but those that I have seen did not have > > separate mailing lists for quality/testing/qa > > versus innovation/development. > > > > What I have seen with the Open Source projects that > > one would call "successful" is a good deal of > > process around automated builds, automated unit > > tests, predictable release dates and milestones, > > and policies around commiting/contributing/reviewing > > changes. > > > > I think that all of these benefit commercial users > > and hobbyists the like. > > > > If you were just asking about who's interested in > > discussing changes to foster more quality, count > > me in. I'm just not sure whether discussing these > > on a separate mailing list or other channel is the > > right thing to do. > > > > Hi Martin, > > There are two issues I'm thinking about. The first is the > generic unit > testing and quality initiatives required to move rxtx > forward. The second > is the inevitable fact that rxtx connects to external hardware. The > discussion deals with a different set of problems. > > Here is a simple example of what I'm getting at. > > We have the capability of setting custom baud rates in rxtx. > We may be > interested in seeing regressions in rxtx, the C library or > the kernel. > Some people may be doing some tests with loopback > connections. These will > always work even if the baud rate is not set to the expected > value. Some > people may use null modems between two ports. This may be > able to catch > the problem but not always. > > Will the build machines be able to test this? (no - for a few reasons) > Will people be trying to catch these type of regressions? (yes) > What type of coverage does the community have in the end? (?) > > We could include the discussions in the same list or another > equally open > list that may be of interest to some folks that deal with > these types of > problems on a regular basis. > > -- > Trent Jarvi > tjarvi at qbang.org > From toupsz at cs.tamu.edu Tue Nov 13 10:33:03 2007 From: toupsz at cs.tamu.edu (Zach Toups) Date: Tue, 13 Nov 2007 11:33:03 -0600 Subject: [Rxtx] [urgent] device's power off detection In-Reply-To: <4738F546.5010101@gatworks.com> References: <766782.10076.qm@web55803.mail.re3.yahoo.com> <4738F546.5010101@gatworks.com> Message-ID: Lacking any other specification on it...but can you set up the device to notify your software when it turns off? Send a message or somesuch? Maybe it can signal using RTS or DTR? -Zach On Nov 12, 2007 6:52 PM, U. George wrote: > Not sure what u are asking for. Are u asking for a way to detect if the > device is OFF? Are u asking how to power off the device - via software ? > Is it a Serial device? > is it a parallel device? > is it a usb device? > > Sara Hugh wrote: > > Hello all, > > I have a small application built on top of rxtx api. This application > > can retrieve the incoming data from a device through a port. The device > > can be powered off after the port get closed from the application. I > > have been trying a couple of hours to find a way to detect the power > > switching from device. If anyone knows how to handle it through rxtx, > > could you please give me a help? Thank you very much. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- -Zach ----- Zachary O. Toups Interface Ecology Lab | Computer Science Department Texas A&M University College Station, Texas, USA AIM: amenoryuu Email: toupsz at cs.tamu.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071113/e5859e4d/attachment-0022.html From tjarvi at qbang.org Tue Nov 13 20:02:03 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 13 Nov 2007 20:02:03 -0700 (MST) Subject: [Rxtx] #ifndef TIOCSERGETLSR In-Reply-To: <472E3AAF.7050709@gatworks.com> References: <472E3AAF.7050709@gatworks.com> Message-ID: On Sun, 4 Nov 2007, U. George wrote: > For Linux, it seems that you need the code for both *having* a > TIOCSERGETLSR, and *not having* a TIOCSERGETLSR. Maybe the ioctl exists > system wide, but not necessarily for the device driver itself ( always > returns -1 ) . > > Are there systems that have a *functioning* TIOCSERGETLSR for all their > devices? Then this would be the case where the "#ifndef TIOCSERGETLSR" > directive could be useful is eliminating the unnecessary code and tests. > > And for those systems that dont have a TIOCSERGETLSR, then the code for > TIOCSERGETLSR can be eliminated. > > It would be a simple case to have, as a foundation, all the code to > simulate the missing TIOCSERGETLSR ioctl. If the system does have the > ioctl, then that code can be ifdef'd in, and co-exist with the > functionality of the code that simulates the missing TIOCSERGETLSR ioctl. > Ah, there is the post. Sorry I was on vacation. Hi George, Yes there are systems that have functioning TIOCSERGETLSR for all of their devices. These are machines that just use traditional UARTs. If you mean operating systems, then probably not. Let me explain a bit about the history of those #ifdefs to help clear up a mess. RXTX aims to follow POSIX. TIOCSERGETLSR turns out to not be POSIX at all as I understand. It isn't in BSD, Solaris, AIX or HP-UX. It certainly provides access to important information. I assumed it was standard when I coded rxtx on a Linux system. Ya, laugh. Then I looked at Win32.. Oh you are still laughing? ..I could not navigate msft's web site at the time [still can't really find anything today]. So google pointed me to someones 'reverse documentation' of the w32 API and an example msft put together back in the win3.0 days. It was enough but maybe not 100% correct. They covered overlapped IO which was important for events in rxtx. Looking at Win32 and Linux, it made sense to implement TIOCSERGETLSR for win32 with the way rxtx works. That was how things matched up. But when I got feedback about other systems, it didn't match up. When people used multiport cards with money saving designs in Linux, it didn't match up. And today, there are drivers for unusual serial ports that don't match up. Now we have some ugly logic that mostly works for most serial ports. It isn't right though. The important aspect of TIOSERGETLSR is knowing when the output is really gone. But POSIX tcdrain tells us the same thing. So there is logic in the ifdefs to match that up as you suggest. Perhaps a more formal solution along those lines would be worth looking into. I would suggest the roles should be switched though. We should use POSIX calls on all systems and hide things that don't work on everything like we have with other undocumented calls. TIOSERGETLSR is nice and would be great if it was standard. It isn't as far as I can tell. In the end, many people write Java code because they want portability. The TIOSERGETLSR does not really fit. In someways, this is limiting to the least common denominator which is Solaris if you have seen it's serial kernel driver code. -- Trent Jarvi tjarvi at qbang.org From Martin.Oberhuber at windriver.com Thu Nov 15 09:10:59 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Thu, 15 Nov 2007 17:10:59 +0100 Subject: [Rxtx] RXTX blocking on unconnected virtual port Message-ID: <460801A4097E3D4CA04CC64EE648584803919080@ism-mail03.corp.ad.wrs.com> Hello, we came across the following issue: * Set up a virtual serial port, e.g. with com0com: http://com0com.sourceforge.net/ * Connect RXTX to one end, e.g. cnc1a * Do not connect the other end, e.g. cnc1b * Have RXTX write data to the port --> Since the data is not being read, RXTX blocks - RXTXPort.SerialOutputStream.write increases the RXTXPort.IOLocked variable - it then calls the native writeByte or writeArray method (which blocks) closing the RXTXPort hangs for ever too: - RXTXPort.close() has a while( IOLocked > 0 ) {..Thread.sleep(500);...} which spins for ever ==> once the communication hangs, it cannot recover. Has anybody else seen such a problem before, or even got an idea how to solve it? When I connect Hyperterminal to the same half-open port, and type a character, it hangs for about 3 seconds but then times out and is available again. I guess that's what I'd like to see in RXTX as well, with a (configurable) timeout. Our big problem with the current situation is that once RXTX gets stuck, there is nothing at all we can do to make it go live again - that's why our original workaround of writing to the port in a background thread is not good enough. For more background information, the issue is being tracked in https://bugs.eclipse.org/bugs/show_bug.cgi?id=208185 Thanks for any hints or ideas, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From tjarvi at qbang.org Sun Nov 18 09:43:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 09:43:26 -0700 (MST) Subject: [Rxtx] PortInUseException - Cannot close and reopen serial port In-Reply-To: <460801A4097E3D4CA04CC64EE64858480351C711@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE64858480351C711@ism-mail03.corp.ad.wrs.com> Message-ID: These have been submitted to CVS and the bugzilla entries have been changed to reflect the changes. ChangeLog: find ports which were added after program startup on Mac OS X. Martin Oberhuber http://bugzilla.qbang.org/show_bug.cgi?id=48 Clean up CommPort Ownership code, avoid possible deadlocks, fix lost commport ownership events. http://bugzilla.qbang.org/show_bug.cgi?id=83 Martin Oberhuber On Wed, 24 Oct 2007, Oberhuber, Martin wrote: > 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) > > > > > > > > > > > > > > > From tjarvi at qbang.org Sun Nov 18 09:45:39 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 09:45:39 -0700 (MST) Subject: [Rxtx] PortInUseException - Cannot close and reopen serial port In-Reply-To: References: <460801A4097E3D4CA04CC64EE6485848020CAF26@ism-mail03.corp.ad.wrs.com> Message-ID: The current CVS code should have all the entries. With version information, I usually do not change the version until we tag and release a zip file. Any feedback would be appreciated. On Wed, 27 Jun 2007, Greg Johnson wrote: > 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) >> >> >> >> >> > From tjarvi at qbang.org Sun Nov 18 13:51:27 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 13:51:27 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs Message-ID: The following bugs have been closed and CVS updated as needed: CommPortIdentifier.getPortIdentifier throws NoSuchPortException http://bugzilla.qbang.org/show_bug.cgi?id=48 CommPortOwnership events not sent http://bugzilla.qbang.org/show_bug.cgi?id=83 JVM 1.6 builds http://bugzilla.qbang.org/show_bug.cgi?id=84 I'd like to give Martin Oberhuber CVS write access. He has been doing a great job of pushing safe patches into rxtx. I'll be preparing seperate patches for the changes I have and submitting them to the list. I'll need to work with George to do a couple things: 1) break the patch into smaller pieces to isolate issues for discussion. 2) work through the Line Status Register changes so it does not cause problems on other systems. George: If you could do the first one, it would be greatly appreciated. -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Sun Nov 18 15:33:36 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 15:33:36 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: Message-ID: I'm not running any tests at this point, I'm trying to apply the small safe patches and make sure everything is compiling. As mentioned at the bottom, there are 3 patches + the USB fix posted here that need more review before accepting. The following bugs have been closed and CVS updated as needed. Most of these are already in CVS. The diff will be small. configure script failed at line UTS_RELEASE megov http://bugzilla.qbang.org/show_bug.cgi?id=80 code cleanup patch (extra ';' creates bug for if statements + new String() calls removed) Xavier Le Vourch http://bugzilla.qbang.org/show_bug.cgi?id=77 Wont compile on linux ppc with glibc 2.5 - no sys/io.h Brian Johnson http://bugzilla.qbang.org/show_bug.cgi?id=72 rxtx overwrites System properties Andrew Gillett Nektarios K. Papadopoulos Neboj??a http://bugzilla.qbang.org/show_bug.cgi?id=64 Solaris ACM port support Dave Cleal http://bugzilla.qbang.org/show_bug.cgi?id=59 Setting of non-standard baud rate fails. Andrew Prunicki http://bugzilla.qbang.org/show_bug.cgi?id=58 RXTX uses lockfiles on MacOS X (instead of ioctl TIOCEXCL) Joachim Buechse http://bugzilla.qbang.org/show_bug.cgi?id=50 JavaDoc fixes Joachim Buechse http://bugzilla.qbang.org/show_bug.cgi?id=49 I need to further review the following: http://bugzilla.qbang.org/show_bug.cgi?id=53 http://bugzilla.qbang.org/show_bug.cgi?id=46 http://bugzilla.qbang.org/show_bug.cgi?id=41 On Sun, 18 Nov 2007, Trent Jarvi wrote: > > The following bugs have been closed and CVS updated as needed: > > CommPortIdentifier.getPortIdentifier throws NoSuchPortException > http://bugzilla.qbang.org/show_bug.cgi?id=48 > CommPortOwnership events not sent > http://bugzilla.qbang.org/show_bug.cgi?id=83 > JVM 1.6 builds > http://bugzilla.qbang.org/show_bug.cgi?id=84 > > I'd like to give Martin Oberhuber CVS write access. He has been doing a > great job of pushing safe patches into rxtx. > > I'll be preparing seperate patches for the changes I have and submitting > them to the list. > > I'll need to work with George to do a couple things: > > 1) break the patch into smaller pieces to isolate issues for discussion. > 2) work through the Line Status Register changes so it does not cause > problems on other systems. > > George: If you could do the first one, it would be greatly appreciated. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From netbeans at gatworks.com Sun Nov 18 16:20:02 2007 From: netbeans at gatworks.com (U. George) Date: Sun, 18 Nov 2007 18:20:02 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: Message-ID: <4740C8A2.6030908@gatworks.com> > I'll need to work with George to do a couple things: > > 1) break the patch into smaller pieces to isolate issues for discussion. > 2) work through the Line Status Register changes so it does not cause > problems on other systems. > > George: If you could do the first one, it would be greatly appreciated. there are ( probably ) 3 pieces: 1) the select() failure when the USB-serial device is unceremoniously unplugged ( causes rxtx to spin ) 2) TIOCSERGETLSR, need to have the simulation of it available for all os's . If the system has the capability, don't simulate for devices that have the capability. For devices that dont have the capability, but the OS still defines TIOCSERGETLSR, fall back to simulation. 3) I rearranged DEBUG ifdef's. This is probably the bulk of the patches. From tjarvi at qbang.org Sun Nov 18 18:26:26 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 18 Nov 2007 18:26:26 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <4740C8A2.6030908@gatworks.com> References: <4740C8A2.6030908@gatworks.com> Message-ID: On Sun, 18 Nov 2007, U. George wrote: > >> I'll need to work with George to do a couple things: >> >> 1) break the patch into smaller pieces to isolate issues for discussion. >> 2) work through the Line Status Register changes so it does not cause >> problems on other systems. >> >> George: If you could do the first one, it would be greatly appreciated. > > there are ( probably ) 3 pieces: > 1) the select() failure when the USB-serial device is unceremoniously > unplugged ( causes rxtx to spin ) > 2) TIOCSERGETLSR, need to have the simulation of it available for all os's . > If the system has the capability, don't simulate for devices that have the > capability. For devices that dont have the capability, but the OS still > defines TIOCSERGETLSR, fall back to simulation. > 3) I rearranged DEBUG ifdef's. This is probably the bulk of the patches. > Hi George, I suspect if you do cvs update, there will be very few conflicts if any. While the list of fixes is fairly long, the changes are small. -- Trent Jarvi tjarvi at qbang.org From EdwardRF at xtremax.com Mon Nov 19 03:32:29 2007 From: EdwardRF at xtremax.com (Edward) Date: Mon, 19 Nov 2007 18:32:29 +0800 Subject: [Rxtx] Cannot Read under Windows XP Message-ID: <4741663D.4070200@xtremax.com> Hi Guys, I have a iTegno 3000 usb GSM modem, it is an usb-serial device. I am trying to use RXTX with it under Windows XP. The problem is it seems RXTX cannot read any data from it, but writing to it seems successful. I blindly issue a series of command to send off a SMS, it is successfully delivered, but neither the echo from the modem nor the "OK" response was received. I tried to connect to the modem directly using hyper terminal, there was no problem reading or writing. So can i assume it is not the driver problem? Then i turned to Serial Port Monitor for help, when I use hyper terminal, monitor shows both way traffic, and nothing abnormal, but when I connect using RXTX, only the data I sent to the modem is being detected, no input was detected. Does anyone else experience similar problem? Best Regards Edward From tjarvi at qbang.org Mon Nov 19 03:38:02 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Nov 2007 03:38:02 -0700 (MST) Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: <4741663D.4070200@xtremax.com> References: <4741663D.4070200@xtremax.com> Message-ID: On Mon, 19 Nov 2007, Edward wrote: > Hi Guys, > > I have a iTegno 3000 usb GSM modem, it is an usb-serial device. I am > trying to use RXTX with it under Windows XP. > The problem is it seems RXTX cannot read any data from it, but writing > to it seems successful. I blindly issue a series of command to send off > a SMS, it is successfully delivered, but neither the echo from the modem > nor the "OK" response was received. > > I tried to connect to the modem directly using hyper terminal, there was > no problem reading or writing. So can i assume it is not the driver problem? > > Then i turned to Serial Port Monitor for help, when I use hyper > terminal, monitor shows both way traffic, and nothing abnormal, but when > I connect using RXTX, only the data I sent to the modem is being > detected, no input was detected. > > Does anyone else experience similar problem? > Hi Edward, A common mistake is to send Strings to the modem which are i18n. You want to send the bytes. Examples of doing this are in the contrib directory with the sourcecode. ie SimpleSnuV1.java -- Trent Jarvi tjarvi at qbang.org From EdwardRF at xtremax.com Mon Nov 19 04:42:16 2007 From: EdwardRF at xtremax.com (Edward) Date: Mon, 19 Nov 2007 19:42:16 +0800 Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: References: <4741663D.4070200@xtremax.com> Message-ID: <47417698.3060705@xtremax.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20071119/b0f08ba9/attachment-0017.html From netbeans at gatworks.com Mon Nov 19 06:31:30 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 19 Nov 2007 08:31:30 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: <4740C8A2.6030908@gatworks.com> Message-ID: <47419032.8080406@gatworks.com> Did the "make install". The install does not want to go to or use Makefiles's prefix = /usr/local/rxtx-devel Not terribly happy that it installed in /home/gat/JAVA/JDK14/j2sdk1.4.2_08/jre/lib/i386 Trent Jarvi wrote: > > I suspect if you do cvs update, there will be very few conflicts if any. > While the list of fixes is fairly long, the changes are small. > > -- > Trent Jarvi > tjarvi at qbang.org > > From Martin.Oberhuber at windriver.com Mon Nov 19 07:00:48 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 19 Nov 2007 15:00:48 +0100 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE6485848039986E6@ism-mail03.corp.ad.wrs.com> It's great to see things progressing - thanks Trent! I checked CVS, and it seems that most of the patch authors are yet missing from the AUTHORS file, is this intentional? The issues areound RXTXPort.close() are interesting for us in the context of Eclipse as well: https://bugs.eclipse.org/bugs/show_bug.cgi?id=208185#c3 I did a quick review and found some issues / comments: http://bugzilla.qbang.org/show_bug.cgi?id=46#c3 http://bugzilla.qbang.org/show_bug.cgi?id=53#c9 Thanks for proposing CVS write access for me. I promise to use these thoughtfully, and discuss potential fixes openly (on bugzilla) before applying them [unless it's really trivial issues only like obvious Javadoc syntax or spelling errors]. Cheers, -- 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 Mon Nov 19 07:24:16 2007 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Mon, 19 Nov 2007 15:24:16 +0100 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: Message-ID: <460801A4097E3D4CA04CC64EE648584803998711@ism-mail03.corp.ad.wrs.com> Hi all, I think I've got a better version for RXTXCommDriver.checkSolaris(): http://bugzilla.qbang.org/show_bug.cgi?id=77#c3 Cheers, -- Martin Oberhuber Wind River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm From netbeans at gatworks.com Mon Nov 19 09:01:22 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 19 Nov 2007 11:01:22 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <47419032.8080406@gatworks.com> References: <4740C8A2.6030908@gatworks.com> <47419032.8080406@gatworks.com> Message-ID: <4741B352.8070205@gatworks.com> U. George wrote: > Did the "make install". The install does not want to go to or use > Makefiles's prefix = /usr/local/rxtx-devel > > Not terribly happy that it installed in > /home/gat/JAVA/JDK14/j2sdk1.4.2_08/jre/lib/i386 > Put libs and jar in MY preferential places. Ran application. And it loves to spin. Deja gnu all over again. :-/ It did find the avail /dev/ttyUSB0 port connected to LINUX usbserial/pl2303 device driver. Now to find the spin. and apply simpler set of patches From tjarvi at qbang.org Mon Nov 19 10:14:38 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Nov 2007 10:14:38 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <4741B352.8070205@gatworks.com> References: <4740C8A2.6030908@gatworks.com> <47419032.8080406@gatworks.com> <4741B352.8070205@gatworks.com> Message-ID: On Mon, 19 Nov 2007, U. George wrote: > U. George wrote: >> Did the "make install". The install does not want to go to or use >> Makefiles's prefix = /usr/local/rxtx-devel >> >> Not terribly happy that it installed in >> /home/gat/JAVA/JDK14/j2sdk1.4.2_08/jre/lib/i386 >> > Put libs and jar in MY preferential places. Ran application. And it loves to > spin. Deja gnu all over again. :-/ > > It did find the avail /dev/ttyUSB0 port connected to LINUX usbserial/pl2303 > device driver. > > Now to find the spin. and apply simpler set of patches > Hi George, When the prefix code was stomped on and the library was installed in the jre, It wasnt clear how the layout would end up looking. I'm still not sure. My usual attack was to dump a jdk onto the filesystem, set JAVA_HOME and install. When I was done, I would nuke the jdk. Obviously that may not be what people want but I'm not sure a prefix is enough to let us know what they do want. For a shared library prefix /usr/local means the library goes in /usr/local/lib. What would it mean for the jar and shared library in Java? -- Trent Jarvi tjarvi at qbang.org From tjarvi at qbang.org Mon Nov 19 10:24:08 2007 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 19 Nov 2007 10:24:08 -0700 (MST) Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: <460801A4097E3D4CA04CC64EE6485848039986E6@ism-mail03.corp.ad.wrs.com> References: <460801A4097E3D4CA04CC64EE6485848039986E6@ism-mail03.corp.ad.wrs.com> Message-ID: On Mon, 19 Nov 2007, Oberhuber, Martin wrote: > > I checked CVS, and it seems that most of the patch > authors are yet missing from the AUTHORS file, > is this intentional? > There isn't a hard rule covering who goes into AUTHORS. If I recognize a person from previous patches, I try to make sure they are in. Everyone contributing (authors) is in the ChangeLog with what they did going all the way back to the first release. AUTHORS is more of a summary of what they did after a few submissions. -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Mon Nov 19 11:39:51 2007 From: netbeans at gatworks.com (U. George) Date: Mon, 19 Nov 2007 13:39:51 -0500 Subject: [Rxtx] CVS updates and closed bugs In-Reply-To: References: <4740C8A2.6030908@gatworks.com> <47419032.8080406@gatworks.com> <4741B352.8070205@gatworks.com> Message-ID: <4741D877.80203@gatworks.com> For me, the makefile/prefix = /usr/local sorta suggest thats where the libs/bins/jars/... should eventually wind up. If a user does not like /usr/local, then a quick change would put it somewhere else. At this moment I dont care where the jar winds up ( in lib, or a jar directory ). So I like to keep the jre/sdk directory protected from meddling, and changes. But if a user has a penchant to use 'java -jar', then the RXTXcomm.jar file should be stuffed with the other jre/sdk jar files. From ajmas at sympatico.ca Mon Nov 19 11:54:29 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 19 Nov 2007 13:54:29 -0500 Subject: [Rxtx] CVS updates and closed bugs Message-ID: <20071119185429.SPYK18413.tomts22-srv.bellnexxia.net@smtp1.sympatico.ca> On this day in November "U. George" wrote: > > For me, the makefile/prefix = /usr/local sorta suggest thats where the > libs/bins/jars/... should eventually wind up. > If a user does not like /usr/local, then a quick change would put it > somewhere else. At this moment I dont care where the jar winds up ( in > lib, or a jar directory ). > So I like to keep the jre/sdk directory protected from meddling, and > changes. > But if a user has a penchant to use 'java -jar', then the RXTXcomm.jar > file should be stuffed with the other jre/sdk jar files. It should be noted that some platforms, such as MacOS X might have different conventions. In the case of MacOS X there are two 'correct' places for Java libraries that aren't part of an application: - /Library/Java/Extensions/ - ~/Library/Java/Extensions/ Andre From ajmas at sympatico.ca Mon Nov 19 18:15:37 2007 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 19 Nov 2007 20:15:37 -0500 Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: <47417698.3060705@xtremax.com> References: <4741663D.4070200@xtremax.com> <47417698.3060705@xtremax.com> Message-ID: <3D24B671-06CA-4709-AE3C-BCDB542F427F@sympatico.ca> On 19-Nov-07, at 06:42 , Edward wrote: > Hi Trent, > > First of all, I did sent them as bytes, eg, > > output.write("at\r\n".getBytes()); > > And if writing is every the problem, it wouldn't be able to explain > why i could send out a sms successfully using RXTX. > If you have the section of code that does the communicating, could you share it with us? This should help us tell whether it is a coding issue or something more fundamental with RXTX. Andre From EdwardRF at xtremax.com Mon Nov 19 19:39:36 2007 From: EdwardRF at xtremax.com (EdwardRF) Date: Tue, 20 Nov 2007 10:39:36 +0800 Subject: [Rxtx] Cannot Read under Windows XP In-Reply-To: <3D24B671-06CA-4709-AE3C-BCDB542F427F@sympatico.ca> References: <4741663D.4070200@xtremax.com> <47417698.3060705@xtremax.com> <3D24B671-06CA-4709-AE3C-BCDB542F427F@sympatico.ca> Message-ID: <474248E8.7070002@xtremax.com> Hi Guys, Thanks for the help, i've finally found out the problem. It was a flow control issue, i did not set the flow control properly. Btw, what is the default flow control behavior for rxtx2.1.7? was it the same as 2.0? Because i remember i did not need to set the flow control when I use rxtx 2.0 2 years back. Best Regards Edward Andre-John Mas wrote: > > On 19-Nov-07, at 06:42 , Edward wrote: > >> Hi Trent, >> >> First of all, I did sent them as bytes, eg, >> >> output.write("at\r\n".getBytes()); >> >> And if writing is every the problem, it w